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)
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)
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)
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