Esempio n. 1
0
def test_install_self_raises_if_conda_not_installed(mocker: MockerFixture,
                                                    silent: bool):
    mocker.patch("pytoil.environments.conda.Conda.create_from_yml",
                 autospec=True)

    conda = Conda(root=Path("somewhere"), environment_name="testy", conda=None)

    with pytest.raises(CondaNotInstalledError):
        conda.install_self(silent=silent)
Esempio n. 2
0
def test_install_self_calls_create_from_yml(mocker: MockerFixture,
                                            silent: bool):

    mock_create_from_yml = mocker.patch(
        "pytoil.environments.conda.Conda.create_from_yml", autospec=True)

    conda = Conda(root=Path("somewhere"),
                  environment_name="testy",
                  conda="notconda")

    conda.install_self(silent=silent)

    mock_create_from_yml.assert_called_once_with(
        project_path=Path("somewhere").resolve(),
        silent=silent,
        conda="notconda")