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

41 lines
2 KiB
Text

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
>>> assert (lib_py + 'site-packages/initools') in result.files_created
Let's try that again, editable::
>>> reset_env()
>>> result = run_pip('install', '-e', 'INITools==0.2', expect_error=True)
>>> assert "--editable=INITools==0.2 is not the right format" 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