def test_generate_cert_generating_twice_throws_exception(saved_key, key_path): with pytest.raises(FileExistsError): sut.generate_cert(key_path)
def test_generate_cert_with_replace_generates_different_key( saved_key, key_path): new_key = sut.generate_cert(key_path, replace=True) assert saved_key != new_key
def saved_key(key_path): return sut.generate_cert(key_path)