Basic setup:: >>> from __main__ import here, reset_env, run_pip, pyversion, lib_py >>> reset_env() First a test of the distutils-configuration-setting command (which is distinct from other commands):: #>>> print run_pip('-vv', '--distutils-cfg=easy_install:index_url:http://download.zope.org/ppix/', expect_error=True) #Script result: python ../../poacheggs.py -E .../poacheggs-tests/test-scratch -vv --distutils-cfg=easy_install:index_url:http://download.zope.org/ppix/ #-- stdout: -------------------- #Distutils config .../poacheggs-tests/test-scratch/lib/python.../distutils/distutils.cfg is writable #Replaced setting index_url #Updated .../poacheggs-tests/test-scratch/lib/python.../distutils/distutils.cfg # #-- updated: ------------------- # lib/python2.4/distutils/distutils.cfg (346 bytes) Next, a simple test:: >>> result = run_pip('install', '-vvv', 'INITools==0.2', expect_error=True) >>> assert (lib_py + 'site-packages/INITools-0.2-py%s.egg-info' % pyversion) in result.files_created, str(result) #sorted(result.files_created.keys()) >>> assert (lib_py + 'site-packages/initools') in result.files_created, sorted(result.files_created.keys()) Let's try that again, editable:: >>> reset_env() >>> result = run_pip('install', '-e', 'INITools==0.2', expect_error=True) >>> assert "--editable=INITools==0.2 should be formatted with svn+URL" in result.stdout >>> assert len(result.files_created) == 1 and not result.files_updated Now, checking out from svn:: >>> reset_env() >>> result = run_pip('install', '-e', 'svn+http://svn.colorstudy.com/INITools/trunk#egg=initools-dev', expect_error=True) >>> egg_link = result.files_created[lib_py + 'site-packages/INITools.egg-link'] >>> # FIXME: I don't understand why there's a trailing . here: >>> egg_link.bytes '.../test-scratch/src/initools\n.' >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated >>> assert 'src/initools' in result.files_created >>> assert 'src/initools/.svn' in result.files_created Using package==dev:: >>> reset_env() >>> result = run_pip('install', 'INITools==dev', expect_error=True) >>> assert (lib_py + 'site-packages/initools') in result.files_created, str(result.stdout) Cloning from Git:: >>> reset_env() >>> result = run_pip('install', '-e', 'git://github.com/jezdez/django-feedutil.git#egg=django-feedutil', expect_error=True) >>> egg_link = result.files_created[lib_py + 'site-packages/django-feedutil.egg-link'] >>> # FIXME: I don't understand why there's a trailing . here: >>> egg_link.bytes '.../test-scratch/src/django-feedutil\n.' >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated >>> assert 'src/django-feedutil' in result.files_created >>> assert 'src/django-feedutil/.git' in result.files_created Cloning from Mercurial:: >>> reset_env() >>> result = run_pip('install', '-e', 'hg+http://bitbucket.org/ubernostrum/django-registration/#egg=django-registration', expect_error=True) >>> egg_link = result.files_created[lib_py + 'site-packages/django-registration.egg-link'] >>> # FIXME: I don't understand why there's a trailing . here: >>> egg_link.bytes '.../test-scratch/src/django-registration\n.' >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated >>> assert 'src/django-registration' in result.files_created >>> assert 'src/django-registration/.hg' in result.files_created Presence or absence of final slash is also normalized:: >>> reset_env() >>> result = run_pip('install', '-e', 'hg+http://bitbucket.org/ubernostrum/django-registration#egg=django-registration', expect_error=True) >>> assert 'pip-log.txt' not in result.files_created, result.files_created['pip-log.txt'].bytes Checking out from Bazaar:: >>> reset_env() >>> result = run_pip('install', '-e', 'bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/@1#egg=pip-test', expect_error=True) >>> egg_link = result.files_created[lib_py + 'site-packages/pip-test.egg-link'] >>> # FIXME: I don't understand why there's a trailing . here: >>> egg_link.bytes '.../test-scratch/src/pip-test\n.' >>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated >>> assert 'src/pip-test' in result.files_created >>> assert 'src/pip-test/.bzr' in result.files_created Urlquoted characters are normalized for repo URL comparison:: >>> result = run_pip('install', '-e', 'bzr+http://bazaar.launchpad.net/~jezdez/pip-test/test#egg=pip-test', expect_error=True) >>> assert 'pip-log.txt' not in result.files_created, result.files_created['pip-log.txt'].bytes