def test_get_envs_dir_raises_if_none_found(mocker: MockerFixture, fake_home_folder_no_conda: Path): mocker.patch( "pytoil.environments.conda.Path.home", autospec=True, return_value=fake_home_folder_no_conda, ) with pytest.raises(UnsupportedCondaInstallationError): Conda.get_envs_dir()
def test_get_envs_dir_returns_correctly_for_mambaforge( mocker: MockerFixture, fake_home_folder_mambaforge: Path): mocker.patch( "pytoil.environments.conda.Path.home", autospec=True, return_value=fake_home_folder_mambaforge, ) env = Conda.get_envs_dir() expected_env_dir = fake_home_folder_mambaforge.joinpath("mambaforge/envs") assert env == expected_env_dir