From eb6054ac0cb2fb469661fe3e7cbabdf2ccc4fb3f Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 19 Sep 2022 18:34:26 -0400 Subject: [PATCH] Add test for isolated package lock. --- tests/integration/test_lock.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index 308f0693..501d7db9 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -721,3 +721,26 @@ requests = "*" assert "certifi" not in p.lockfile["develop"] assert "urllib3" not in p.lockfile["develop"] assert "chardet" not in p.lockfile["develop"] + + +@pytest.mark.lock +def test_lock_specific_named_category(pipenv_instance_private_pypi): + with pipenv_instance_private_pypi(chdir=True) as p: + contents = """ +[[source]] +url = "{}" +verify_ssl = true +name = "test" + +[packages] +requests = "*" + +[prereq] +six = "*" + """.format(p.index_url).strip() + with open(p.pipfile_path, 'w') as f: + f.write(contents) + c = p.pipenv("lock --categories prereq") + assert c.returncode == 0 + assert p.lockfile["prereq"]["six"]["index"] == "test" + assert p.lockfile["default"] == dict()