mirror of https://github.com/pypa/pip
Added basic and freeze tests for Git and Mercurial support
This commit is contained in:
parent
49b518ad10
commit
f9c29d8aa1
|
@ -39,3 +39,27 @@ Now, checking out from svn::
|
|||
>>> 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
|
||||
|
|
|
@ -64,3 +64,59 @@ Bah, that's no good! Let's give it a hint::
|
|||
-e svn+http://svn.colorstudy.com/INITools/trunk@...#egg=INITools-...dev_r...
|
||||
simplejson==1.7.4...
|
||||
<BLANKLINE>
|
||||
|
||||
What about a Git clone?::
|
||||
|
||||
>>> reset_env()
|
||||
>>> env = get_env()
|
||||
>>> result = env.run('git', 'clone', 'git://github.com/ericflo/django-pagination.git', 'django-pagination')
|
||||
>>> result = env.run('git', 'checkout', '1df6507872d73ee387eb375428eafbfc253dfcd8',
|
||||
... cwd=os.path.join(env.base_path, 'django-pagination'), expect_stderr=True)
|
||||
>>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
|
||||
... cwd=os.path.join(env.base_path, 'django-pagination'))
|
||||
>>> result = run_pip('freeze', expect_stderr=True)
|
||||
>>> print result
|
||||
Script result: ...ython... ../../pip.py -E .../test-scratch freeze
|
||||
-- stderr: --------------------
|
||||
Git URL does not fit normal structure: git://github.com/ericflo/django-pagination.git
|
||||
<BLANKLINE>
|
||||
-- stdout: --------------------
|
||||
-e git://github.com/ericflo/django-pagination.git@...#egg=django_pagination-dev
|
||||
...
|
||||
<BLANKLINE>
|
||||
|
||||
>>> result = run_pip('freeze', '-f', 'git://github.com/ericflo/django-pagination.git#egg=django_pagination-dev', expect_stderr=True)
|
||||
>>> print result
|
||||
Script result: ...ython... ../../pip.py -E .../test-scratch freeze -f git://github.com/ericflo/django-pagination.git#egg=django_pagination-dev
|
||||
-- stderr: --------------------
|
||||
Git URL does not fit normal structure: git://github.com/ericflo/django-pagination.git
|
||||
<BLANKLINE>
|
||||
-- stdout: --------------------
|
||||
-f git://github.com/ericflo/django-pagination.git#egg=django_pagination-dev
|
||||
-e git://github.com/ericflo/django-pagination.git@...#egg=django_pagination-dev
|
||||
...
|
||||
<BLANKLINE>
|
||||
|
||||
Now what about Mercurial::
|
||||
|
||||
>>> reset_env()
|
||||
>>> env = get_env()
|
||||
>>> result = env.run('hg', 'clone', '-r', 'a5748745272a', 'http://bitbucket.org/mitsuhiko/pygments-main/', 'pygments')
|
||||
>>> result = env.run(os.path.join(env.base_path, 'bin/python'), 'setup.py', 'develop',
|
||||
... cwd=os.path.join(env.base_path, 'pygments'))
|
||||
>>> result = run_pip('freeze', expect_stderr=True)
|
||||
>>> print result
|
||||
Script result: ...ython... ../../pip.py -E .../test-scratch freeze
|
||||
-- stdout: --------------------
|
||||
-e hg+http://bitbucket.org/mitsuhiko/pygments-main/@...#egg=Pygments-...
|
||||
...
|
||||
<BLANKLINE>
|
||||
|
||||
>>> result = run_pip('freeze', '-f', 'hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments', expect_stderr=True)
|
||||
>>> print result
|
||||
Script result: ...ython... ../../pip.py -E .../test-scratch freeze -f hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments
|
||||
-- stdout: --------------------
|
||||
-f hg+http://bitbucket.org/mitsuhiko/pygments-main#egg=Pygments
|
||||
-e hg+http://bitbucket.org/mitsuhiko/pygments-main/@...#egg=Pygments-...
|
||||
...
|
||||
<BLANKLINE>
|
||||
|
|
Loading…
Reference in New Issue