changeset 69:10f343c483ee

install and import the thing
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 02 Mar 2012 10:13:25 -0800
parents e62d2fddb275
children 8fa30276b3e0
files tests/test_ttw.txt
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_ttw.txt	Fri Mar 02 09:36:58 2012 -0800
+++ b/tests/test_ttw.txt	Fri Mar 02 10:13:25 2012 -0800
@@ -32,7 +32,8 @@
 
 Get the index page::
 
-    >>> resource = urllib2.urlopen(url + 'index')
+    >>> index = url + 'index/'
+    >>> resource = urllib2.urlopen(index)
     >>> contents = resource.read()
     >>> 'Simple Index' in contents
     True
@@ -64,6 +65,20 @@
     >>> code = subprocess.call([venv.python, '-c', 'import helloworld'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     >>> code
     1
+
+Install the package and make sure you can import it::
+
+    >>> subprocess.call([venv.easy_install, '-i', index, 'HelloWorld'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    0
+    >>> code = subprocess.call([venv.python, '-c', 'import helloworld'])
+    >>> code
+    0
+    >>> process = subprocess.Popen([venv.python, '-c', 'import helloworld; print helloworld.hello'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    >>> stdout, stderr = process.communicate()
+    >>> stdout
+    'Hello, world!\n'
+    >>> process.returncode
+    0
     >>> shutil.rmtree(tmpdir)
 
 Shut down the server::