# HG changeset patch
# User Jeff Hammel <jhammel@mozilla.com>
# Date 1330622935 28800
# Node ID a02d08627d9c53004fd72c1f9706503abe7f3421
# Parent  315b7b49eaf4d954a5a5ce24ace18fd1db4c9d3f
stub a test to upload a package

diff -r 315b7b49eaf4 -r a02d08627d9c simpypi/wsgi.py
--- a/simpypi/wsgi.py	Thu Mar 01 09:23:29 2012 -0800
+++ b/simpypi/wsgi.py	Thu Mar 01 09:28:55 2012 -0800
@@ -49,6 +49,13 @@
         # get the package
         package = self.request.POST.get('package')
 
+        # sanity check:
+        # - does the field exist?
+        # - is it a file?
+        # TODO
+
+        # put the package in the right place
+
         # redirect to the main page
         return exc.HTTPSeeOther(add_slash=True)
 
diff -r 315b7b49eaf4 -r a02d08627d9c tests/doctest.txt
--- a/tests/doctest.txt	Thu Mar 01 09:23:29 2012 -0800
+++ b/tests/doctest.txt	Thu Mar 01 09:28:55 2012 -0800
@@ -16,3 +16,10 @@
 
     >>> app = simpypi.SimPyPI(directory)
     >>> testapp = TestApp(app)
+
+Upload a package::
+
+    >>> field = 'package'
+    >>> filename = 'HelloWorld-0.0.tar.gz'
+    >>> contents = file(os.path.join(here, filename)).read()
+    >>> response = testapp.post('/', upload_files=(field, filename, package))