changeset 50:e4a97d6f2811

* add kinda a redundant test * stub out introspecting packages
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 01 Mar 2012 14:26:28 -0800
parents ca456e08924f
children 6a8071eab89e
files tests/doctest.txt
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/doctest.txt	Thu Mar 01 14:14:12 2012 -0800
+++ b/tests/doctest.txt	Thu Mar 01 14:26:28 2012 -0800
@@ -6,6 +6,7 @@
     >>> import os
     >>> import shutil
     >>> import simpypi
+    >>> import tempfile
     >>> from paste.fixture import TestApp
 
 The directory is initially empty::
@@ -32,6 +33,11 @@
     >>> os.listdir(os.path.join(directory, 'HelloWorld'))
     ['HelloWorld-0.0.tar.gz']
 
+Ensure the package is what you expect it to be::
+
+    >>> tmpdir = tempfile.mkdtemp()
+    >>> shutil.rmtree(tmpdir)
+
 Upload the same package but with the wrong name::
 
     >>> shutil.rmtree(os.path.join(directory, 'HelloWorld'))
@@ -42,4 +48,13 @@
     ['HelloWorld']
     >>> os.listdir(os.path.join(directory, 'HelloWorld'))
     ['HelloWorld-0.0.tar.gz']
-
+    >>> shutil.rmtree(os.path.join(directory, 'HelloWorld'))
+    >>> os.listdir(directory)
+    []
+    >>> filename = 'MisleadingFilename.tar.gz'
+    >>> contents = file(os.path.join(here, filename)).read()
+    >>> response = testapp.post('/', upload_files=[(field, filename, contents)])
+    >>> os.listdir(directory)
+    ['HelloWorld']
+    >>> os.listdir(os.path.join(directory, 'HelloWorld'))
+    ['HelloWorld-0.0.tar.gz']