Beispiel #1
0
def test_dispatch_env_correctly_identifies_flit(fake_flit_project: Path):

    repo = Repo(name="test", owner="me", local_path=fake_flit_project)

    env = repo.dispatch_env(config=Config())

    assert isinstance(env, Flit)
Beispiel #2
0
def test_dispatch_env_correctly_identifies_requirements_dev_txt(
    requirements_dev_project: Path,
):

    repo = Repo(name="test", owner="me", local_path=requirements_dev_project)

    env = repo.dispatch_env(config=Config())

    assert isinstance(env, Requirements)
Beispiel #3
0
def test_dispatch_env_correctly_identifies_conda(mocker: MockerFixture):

    mocker.patch("pytoil.repo.Repo.is_conda", autospec=True, return_value=True)

    repo = Repo(name="test", owner="me", local_path=Path("somewhere"))

    env = repo.dispatch_env(config=Config())

    assert isinstance(env, Conda)
Beispiel #4
0
def test_dispatch_env_returns_none_if_it_cant_detect(mocker: MockerFixture):

    mocker.patch("pytoil.repo.Repo.is_conda", autospec=True, return_value=False)

    mocker.patch("pytoil.repo.Repo.is_setuptools", autospec=True, return_value=False)

    repo = Repo(name="test", owner="me", local_path=Path("somewhere"))

    env = repo.dispatch_env(config=Config())

    assert env is None