Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_get_latest_commit():
sha = get_latest_commit("https://github.com/apache/spark")
assert len(sha) == 40
with pytest.raises(UsageError):
get_latest_commit("https://google.com")
with pytest.raises(Exception):
get_latest_commit("https://github.com/apache/nonexistent-repo")
def test_get_latest_commit():
sha = get_latest_commit("https://github.com/apache/spark")
assert len(sha) == 40
with pytest.raises(UsageError):
get_latest_commit("https://google.com")
with pytest.raises(Exception):
get_latest_commit("https://github.com/apache/nonexistent-repo")
def test_get_latest_commit():
sha = get_latest_commit("https://github.com/apache/spark")
assert len(sha) == 40
with pytest.raises(UsageError):
get_latest_commit("https://google.com")
with pytest.raises(Exception):
get_latest_commit("https://github.com/apache/nonexistent-repo")