tests: commit is missing

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-01-10 17:38:05 +02:00
parent 1dad8cb66f
commit 2cfafb8075
+16
View File
@@ -156,6 +156,22 @@ class Suite:
assert "clone" in error
assert rid[len("rad:") :] in error
def test_commit_does_not_exist(self):
git = self._create_git_repo("commit-missing")
self._create_valid_native_yaml(git, "echo hello world")
rid, _commit = self._get_repo_info(git)
commit = "0000000000000000000000000000000000000000"
trigger = Trigger(rid, commit)
ci = self._create_ci()
exit, resps, stderr = ci.run(trigger)
assert exit != 0
assert len(resps) == 2
self.assert_triggered(resps[0])
self.assert_error(resps[1])
error = resps[1]["result"]["error"]
assert commit in error
def test_native_yaml_has_no_shell(self):
exit, resps, stderr = self._test_case("no-shell", None)
assert exit != 0