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

Add unit tests for bazaar URL handling

Tested on 2.4.4, 2.7.1 and 3.2

nosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:

2.4:

----------------------------------------------------------------------
Ran 107 tests in 167.345s

OK

2.7 fails 1 on Test freezing a mercurial clone

Script result: python setup.py develop
-- stderr: --------------------
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'docs/build'
no previously-included directories found matching 'docs/build/html/_sources'

3.2

I got a bunch of failures, mostly environments (bzr, hg) and fragility I think.

----------------------------------------------------------------------
Ran 107 tests in 289.871s

FAILED (failures=5, errors=6, skipped=2)
This commit is contained in:
Paul Nasrat 2011-04-20 11:42:37 +01:00
parent 6061831c88
commit ab9fed3a9a

29
tests/test_vcs_bazaar.py Normal file
View file

@ -0,0 +1,29 @@
from tests.test_pip import pyversion
from pip.vcs.bazaar import Bazaar
if pyversion >= '3':
VERBOSE_FALSE = False
else:
VERBOSE_FALSE = 0
def test_bazaar_simple_urls():
"""
Test bzr url support.
SSH and launchpad have special handling.
"""
http_bzr_repo = Bazaar(url='bzr+http://bzr.myproject.org/MyProject/trunk/#egg=MyProject')
https_bzr_repo = Bazaar(url='bzr+https://bzr.myproject.org/MyProject/trunk/#egg=MyProject')
ssh_bzr_repo = Bazaar(url='bzr+ssh://bzr.myproject.org/MyProject/trunk/#egg=MyProject')
ftp_bzr_repo = Bazaar(url='bzr+ftp://bzr.myproject.org/MyProject/trunk/#egg=MyProject')
sftp_bzr_repo = Bazaar(url='bzr+sftp://bzr.myproject.org/MyProject/trunk/#egg=MyProject')
launchpad_bzr_repo = Bazaar(url='bzr+lp:MyLaunchpadProject#egg=MyLaunchpadProject')
assert http_bzr_repo.get_url_rev() == ('http://bzr.myproject.org/MyProject/trunk/', None)
assert https_bzr_repo.get_url_rev() == ('https://bzr.myproject.org/MyProject/trunk/', None)
assert ssh_bzr_repo.get_url_rev() == ('bzr+ssh://bzr.myproject.org/MyProject/trunk/', None)
assert ftp_bzr_repo.get_url_rev() == ('ftp://bzr.myproject.org/MyProject/trunk/', None)
assert sftp_bzr_repo.get_url_rev() == ('sftp://bzr.myproject.org/MyProject/trunk/', None)
assert launchpad_bzr_repo.get_url_rev() == ('lp:MyLaunchpadProject', None)