def test_validate_conda_invalid_file(self, test_directory, absolute_path): _, _, _, bad_conda_file = test_directory if absolute_path: bad_conda_file = bad_conda_file.resolve() with pytest.raises(ValueError): parse_and_validate_conda(str(bad_conda_file))
def test_validate_conda_valid_file(self, test_directory, absolute_path): _, _, good_conda_file, _ = test_directory if absolute_path: good_conda_file = good_conda_file.resolve() assert parse_and_validate_conda(str(good_conda_file)) == CONDA_DICT
def test_validate_conda_valid_dict(self): assert parse_and_validate_conda(CONDA_DICT) == CONDA_DICT
def test_validate_conda_invalid_path(self): with pytest.raises(ValueError): parse_and_validate_conda("../bad_path.yaml")
def test_validate_conda_str(self, test_directory): assert parse_and_validate_conda("my_env_name") == "my_env_name"
def test_validate_conda_invalid_types(self): with pytest.raises(TypeError): parse_and_validate_conda(1) with pytest.raises(TypeError): parse_and_validate_conda(True)