# HG changeset patch # User Jeff Hammel # Date 1330712005 28800 # Node ID 10f343c483ee19b45355b42c598e47520544e899 # Parent e62d2fddb275bd0a9936a40b4a201260f314966b install and import the thing diff -r e62d2fddb275 -r 10f343c483ee tests/test_ttw.txt --- 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::