aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual_test.py
diff options
context:
space:
mode:
authortarek <none@none>2009-12-20 12:39:48 +0100
committertarek <none@none>2009-12-20 12:39:48 +0100
commitdeb90e5287e5aedc705d9dd0aea8e7f163b9d484 (patch)
tree81703d2d70c4053a16efa75c15d366696b49868c /tests/manual_test.py
parent807501891521f68f9e3f273afd2a0c896c4bc0ec (diff)
downloadexternal_python_setuptools-deb90e5287e5aedc705d9dd0aea8e7f163b9d484.tar.gz
external_python_setuptools-deb90e5287e5aedc705d9dd0aea8e7f163b9d484.tar.bz2
external_python_setuptools-deb90e5287e5aedc705d9dd0aea8e7f163b9d484.zip
added manual functional tests for checking a release
--HG-- branch : distribute extra : rebase_source : d7bc6ba1843217a020be419a8f3ed562e5ff4a3f
Diffstat (limited to 'tests/manual_test.py')
-rw-r--r--tests/manual_test.py79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/manual_test.py b/tests/manual_test.py
new file mode 100644
index 00000000..1bafb0d9
--- /dev/null
+++ b/tests/manual_test.py
@@ -0,0 +1,79 @@
+#!/bin/python
+import os
+import shutil
+import tempfile
+import urllib2
+import subprocess
+import sys
+
+def tempdir(func):
+ def _tempdir(*args, **kwargs):
+ test_dir = tempfile.mkdtemp()
+ old_dir = os.getcwd()
+ os.chdir(test_dir)
+ try:
+ return func(*args, **kwargs)
+ finally:
+ os.chdir(old_dir)
+ shutil.rmtree(test_dir)
+ return _tempdir
+
+SIMPLE_BUILDOUT = """\
+[buildout]
+
+parts = eggs
+
+[eggs]
+recipe = zc.recipe.egg
+
+eggs =
+ extensions
+"""
+
+BOOTSTRAP = 'http://python-distribute.org/bootstrap.py'
+PYVER = sys.version.split()[0][:3]
+
+@tempdir
+def test_virtualenv():
+ """virtualenv with distribute"""
+ os.system('virtualenv --no-site-packages . --distribute')
+ os.system('bin/easy_install -q distribute==dev')
+ # linux specific
+ site_pkg = os.listdir(os.path.join('.', 'lib', 'python'+PYVER, 'site-packages'))
+ site_pkg.sort()
+ assert 'distribute' in site_pkg[0]
+ easy_install = os.path.join('.', 'lib', 'python'+PYVER, 'site-packages',
+ 'easy-install.pth')
+ with open(easy_install) as f:
+ res = f.read()
+ assert 'distribute' in res
+ assert 'setuptools' not in res
+
+@tempdir
+def test_full():
+ """virtualenv + pip + buildout"""
+ os.system('virtualenv --no-site-packages .')
+ os.system('bin/easy_install -q distribute==dev')
+ os.system('bin/easy_install -qU distribute==dev')
+ os.system('bin/easy_install -q pip')
+ os.system('bin/pip install -q zc.buildout')
+ with open('buildout.cfg', 'w') as f:
+ f.write(SIMPLE_BUILDOUT)
+
+ with open('bootstrap.py', 'w') as f:
+ f.write(urllib2.urlopen(BOOTSTRAP).read())
+
+ os.system('bin/python bootstrap.py --distribute')
+ os.system('bin/buildout -q')
+ eggs = os.listdir('eggs')
+ eggs.sort()
+ assert len(eggs) == 3
+ assert eggs[0].startswith('distribute')
+ assert eggs[1:] == ['extensions-0.3-py2.6.egg',
+ 'zc.recipe.egg-1.2.2-py2.6.egg']
+
+
+if __name__ == '__main__':
+ test_virtualenv()
+
+