diff --git a/tests/functional/test_freeze.py b/tests/functional/test_freeze.py index a2597c35a65..7cf4ff57360 100644 --- a/tests/functional/test_freeze.py +++ b/tests/functional/test_freeze.py @@ -218,41 +218,32 @@ def test_freeze_mercurial_clone(script, tmpdir): _check_output(result, expected) -@pytest.mark.network +@pytest.mark.bzr def test_freeze_bazaar_clone(script, tmpdir): """ Test freezing a Bazaar clone. """ - - checkout_path = local_checkout( - 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/' - 'release-0.1', - tmpdir.join("cache"), - ) - # bzr internally stores windows drives as uppercase; we'll match that. + try: + checkout_path = _create_test_package(script, vcs='bazaar') + except OSError as e: + pytest.fail('Invoking `bzr` failed: %s' % e) checkout_pathC = checkout_path.replace('c:', 'C:') result = script.run( - 'bzr', 'checkout', '-r', '174', - local_repo( - 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/' - 'release-0.1', - tmpdir.join("cache"), - ), - 'django-wikiapp', + 'bzr', 'checkout', checkout_path, 'bzr-package' ) result = script.run( 'python', 'setup.py', 'develop', - cwd=script.scratch_path / 'django-wikiapp', + cwd=script.scratch_path / 'bzr-package', expect_stderr=True, ) result = script.pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- - ...-e %s@...#egg=django_wikiapp-... - ...""" % checkout_pathC) + ...-e bzr+file://%s@1#egg=version_pkg-0.1-... + ...""" % checkout_path) _check_output(result, expected) result = script.pip( @@ -264,7 +255,7 @@ def test_freeze_bazaar_clone(script, tmpdir): Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp -- stdout: -------------------- -f %(repo)s/#egg=django-wikiapp - ...-e %(repoC)s@...#egg=django_wikiapp-... + ...-e bzr+file://%(repoC)s@...#egg=version_pkg-... ...""" % {'repoC': checkout_pathC, 'repo': checkout_path}) _check_output(result, expected) diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py index 7a701a5b783..caa10655ec9 100644 --- a/tests/lib/__init__.py +++ b/tests/lib/__init__.py @@ -505,6 +505,17 @@ def main(): checkout_path = checkout_path.replace('c:', 'C:') version_pkg_path = checkout_path + elif vcs == 'bazaar': + script.run('bzr', 'init', cwd=version_pkg_path) + script.run('bzr', 'add', '.', cwd=version_pkg_path) + script.run( + 'bzr', 'whoami', 'pip ', + cwd=version_pkg_path) + script.run( + 'bzr', 'commit', '-q', + '--author', 'pip ', + '-m', 'initial version', cwd=version_pkg_path, + ) else: raise ValueError('Unknown vcs: %r' % vcs) return version_pkg_path