From 1d4321a5041d3910f1fb9c86223d38f61c0dbeba Mon Sep 17 00:00:00 2001 From: Adam Gregory Date: Thu, 4 Aug 2022 17:51:33 +0100 Subject: [PATCH] Add test_generate_env_name_uses_real_path() unit test --- tests/utils/test_env.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/utils/test_env.py b/tests/utils/test_env.py index a3a4474b399..c65ee0f6f40 100644 --- a/tests/utils/test_env.py +++ b/tests/utils/test_env.py @@ -1362,6 +1362,13 @@ def test_generate_env_name_ignores_case_for_case_insensitive_fs(tmp_dir: str): assert venv_name1 != venv_name2 +def test_generate_env_name_uses_real_path(tmp_dir: str, mocker: MockerFixture): + mocker.patch("os.path.realpath", return_value="the_real_dir") + venv_name1 = EnvManager.generate_env_name("simple-project", "the_real_dir") + venv_name2 = EnvManager.generate_env_name("simple-project", "linked_dir") + assert venv_name1 == venv_name2 + + @pytest.fixture() def extended_without_setup_poetry() -> Poetry: poetry = Factory().create_poetry(