def test_validate_specfile_valid(tmp_path, specfile): """ GIVEN a valid specification file WHEN validate_specfile is called THEN nothing happens """ spec = tmp_path / specfile spec.write_text("") cli.validate_specfile(spec)
def test_validate_specfile_does_not_exist(tmp_path): """ GIVEN a specification file which does not exist WHEN validate_specfile is called THEN a ValueError exception is raised """ spec = tmp_path / "specfile.txt" with pytest.raises(exceptions.CLIError): cli.validate_specfile(spec)
def test_validate_specfile_invalid_extension(tmp_path): """ GIVEN a invalid specification file extension WHEN validate_specfile is called THEN a ValueError exception is raised """ spec = tmp_path / "specfile.txt" spec.write_text("") with pytest.raises(exceptions.CLIError): cli.validate_specfile(spec)