1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/tests/test_basic.txt

78 lines
3.9 KiB
Plaintext

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
#<BLANKLINE>
#-- 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
Cloning from Git::
>>> reset_env()
>>> result = run_pip('install', '-e', 'git://github.com/jezdez/django-dbtemplates.git#egg=django-dbtemplates', expect_error=True)
>>> egg_link = result.files_created[lib_py + 'site-packages/django-dbtemplates.egg-link']
>>> # FIXME: I don't understand why there's a trailing . here:
>>> egg_link.bytes
'.../test-scratch/src/django-dbtemplates\n.'
>>> assert (lib_py + 'site-packages/easy-install.pth') in result.files_updated
>>> assert 'src/django-dbtemplates' in result.files_created
>>> assert 'src/django-dbtemplates/.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
Checking out from Bazaar::
>>> reset_env()
>>> result = run_pip('install', '-e', 'bzr+http://bazaar.launchpad.net/%7Ejezdez/pip-test/test/#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