From 916ea7f47400a34dbcf83ae8726e823498b143d4 Mon Sep 17 00:00:00 2001 From: jxltom Date: Mon, 8 Oct 2018 11:29:49 +0800 Subject: [PATCH] Add tests for locking editable packages with ref --- tests/integration/test_lock.py | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index 23d75f8e95..6085826825 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -347,6 +347,42 @@ def test_lock_editable_vcs_without_install(PipenvInstance, pypi): assert c.return_code == 0 +@pytest.mark.lock +@pytest.mark.vcs +@pytest.mark.needs_internet +def test_lock_editable_vcs_with_ref_in_git(PipenvInstance, pypi): + with PipenvInstance(pypi=pypi, chdir=True) as p: + with open(p.pipfile_path, 'w') as f: + f.write(""" +[packages] +requests = {git = "https://github.com/requests/requests.git@883caaf", editable = true} + """.strip()) + c = p.pipenv('lock') + assert c.return_code == 0 + assert p.lockfile['default']['requests']['git'] == 'https://github.com/requests/requests.git' + assert p.lockfile['default']['requests']['ref'] == '883caaf145fbe93bd0d208a6b864de9146087312' + c = p.pipenv('install') + assert c.return_code == 0 + + +@pytest.mark.lock +@pytest.mark.vcs +@pytest.mark.needs_internet +def test_lock_editable_vcs_with_ref(PipenvInstance, pypi): + with PipenvInstance(pypi=pypi, chdir=True) as p: + with open(p.pipfile_path, 'w') as f: + f.write(""" +[packages] +requests = {git = "https://github.com/requests/requests.git", ref = "883caaf", editable = true} + """.strip()) + c = p.pipenv('lock') + assert c.return_code == 0 + assert p.lockfile['default']['requests']['git'] == 'https://github.com/requests/requests.git' + assert p.lockfile['default']['requests']['ref'] == '883caaf145fbe93bd0d208a6b864de9146087312' + c = p.pipenv('install') + assert c.return_code == 0 + + @pytest.mark.extras @pytest.mark.lock @pytest.mark.vcs