diff options
author | Lars Wirzenius <liw@liw.fi> | 2024-01-10 16:34:39 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2024-01-10 17:38:05 +0200 |
commit | f660492c48f6d9b3acf80ab38aad19694bf8eb39 (patch) | |
tree | ab1329c9bba9bc2340ef4839676da8702401c823 | |
parent | 2cfafb8075bc829b4065e6059c9f9dd81a4662f4 (diff) | |
download | radicle-native-ci-f660492c48f6d9b3acf80ab38aad19694bf8eb39.tar.gz |
tests: malformed trigger request message
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-x | test-suite | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -172,6 +172,17 @@ class Suite: error = resps[1]["result"]["error"] assert commit in error + def test_malformed_trigger(self): + git = self._create_git_repo("malformed-trigger") + self._create_valid_native_yaml(git, "echo hello world") + rid, _commit = self._get_repo_info(git) + trigger = MalformedTrigger() + ci = self._create_ci() + exit, resps, stderr = ci.run(trigger) + + assert exit != 0 + assert len(resps) == 0 + def test_native_yaml_has_no_shell(self): exit, resps, stderr = self._test_case("no-shell", None) assert exit != 0 @@ -291,6 +302,11 @@ class Trigger: ) +class MalformedTrigger: + def json(self): + return json.dumps({"request": "trigger"}) + + class NativeCI: def __init__(self, rad, config): self.rad_home = rad.rad_home |