Skip to content

Commit

Permalink
test_freeze_git_clone: No dep on github.com
Browse files Browse the repository at this point in the history
  • Loading branch information
msabramo committed Mar 11, 2015
1 parent e5b1d4f commit 1141e6c
Showing 1 changed file with 12 additions and 36 deletions.
48 changes: 12 additions & 36 deletions tests/functional/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest
from doctest import OutputChecker, ELLIPSIS

from tests.lib import _create_test_package
from tests.lib.local_repos import local_checkout, local_repo


Expand Down Expand Up @@ -101,29 +102,19 @@ def test_freeze_svn(script, tmpdir):
_check_output(result, expected)


@pytest.mark.network
@pytest.mark.git
def test_freeze_git_clone(script, tmpdir):
"""
Test freezing a Git clone.
"""
# Returns path to a generated package called "version_pkg"
pkg_version = _create_test_package(script)

result = script.run(
'git',
'clone',
local_repo(
'git+http://github.com/pypa/pip-test-package.git',
tmpdir.join("cache"),
),
'pip-test-package',
'git', 'clone', pkg_version, 'pip-test-package',
expect_stderr=True,
)
repo_dir = script.scratch_path / 'pip-test-package'
result = script.run(
'git',
'checkout',
'7d654e66c8fa7149c165ddeffa5b56bc06619458',
cwd=repo_dir,
expect_stderr=True,
)
result = script.run(
'python', 'setup.py', 'develop',
cwd=repo_dir,
Expand All @@ -134,39 +125,24 @@ def test_freeze_git_clone(script, tmpdir):
"""
Script result: ...pip freeze
-- stdout: --------------------
...-e %s@...#egg=pip_test_package-...
...-e git+...#egg=version_pkg-master
...
""" %
local_checkout(
'git+http://github.com/pypa/pip-test-package.git',
tmpdir.join("cache"),
)
"""
).strip()
_check_output(result, expected)

result = script.pip(
'freeze', '-f',
'%s#egg=pip_test_package' %
local_checkout(
'git+http://github.com/pypa/pip-test-package.git',
tmpdir.join("cache"),
),
'freeze', '-f', '%s#egg=pip_test_package' % repo_dir,
expect_stderr=True,
)
expected = textwrap.dedent(
"""
Script result: pip freeze -f %(repo)s#egg=pip_test_package
-- stdout: --------------------
-f %(repo)s#egg=pip_test_package...
-e %(repo)s@...#egg=pip_test_package-0.1.1
-e git+...#egg=version_pkg-master
...
""" %
{
'repo': local_checkout(
'git+http://github.com/pypa/pip-test-package.git',
tmpdir.join("cache"),
),
},
""" % {'repo': repo_dir},
).strip()
_check_output(result, expected)

Expand All @@ -189,7 +165,7 @@ def test_freeze_git_clone(script, tmpdir):
"""
Script result: ...pip freeze
-- stdout: --------------------
...-e ...@...#egg=pip_test_package-branch_name_with_slash...
...-e ...@...#egg=version_pkg-branch_name_with_slash...
...
"""
).strip()
Expand Down

0 comments on commit 1141e6c

Please sign in to comment.