def test_cache_path(self, env_var): mock_zip = mock.MagicMock(spec=ZipFile) mock_zip.filename = "test" uuid = str(uuid4()) assert cache_path(mock_zip, 'foo', uuid) == Path("foo", f"test_{uuid}") with env_var("FOO", "foo"): assert cache_path(mock_zip, '$FOO', uuid) == Path("foo", f"test_{uuid}")
def test_cache_path(self): mock_zip = mock.MagicMock(spec=ZipFile) mock_zip.filename = "test" uuid = str(uuid4()) assert cache_path(mock_zip, Path.cwd(), uuid) == Path.cwd() / f"test_{uuid}"