diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-09 18:25:59 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-09 18:25:59 +0100 |
| commit | 7f99167f0b6a3c83bf77e20bc5e03942b901fb71 (patch) | |
| tree | 6b60263b6f702e6088eae30087c6dfa2a5a71f4c /tests/test_server.py | |
| parent | 03e2adab3fb58532ba1e32c2f01a9ec14f11e484 (diff) | |
| download | deck-it-7f99167f0b6a3c83bf77e20bc5e03942b901fb71.tar.gz deck-it-7f99167f0b6a3c83bf77e20bc5e03942b901fb71.zip | |
fix: OBS idle timeout, payload validation, workspace list
Diffstat (limited to 'tests/test_server.py')
| -rw-r--r-- | tests/test_server.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_server.py b/tests/test_server.py index 1583ad2..bf571a6 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -38,7 +38,8 @@ class Server(unittest.TestCase): srv.TOKEN = TOKEN srv.REGISTRY = mod.Registry([ mod.Module("demo", "Demo", lambda: {"ok": True}, - {"ping": lambda body: {"got": body.get("n")}}), + {"ping": lambda body: {"got": body.get("n")}, + "boom": lambda body: int(body.get("x"))}), ]) cls.server = srv.UnixHTTPServer(cls.sock, srv.Handler) threading.Thread(target=cls.server.serve_forever, daemon=True).start() @@ -86,6 +87,10 @@ class Server(unittest.TestCase): {**HOST, **ORIGIN, "Content-Type": "application/json"}, big) self.assertEqual(status, 400) + def test_rejects_wrong_typed_body(self): + h = {**HOST, **ORIGIN, "Content-Type": "application/json"} + self.assertEqual(self.req("POST", "/api/demo/boom", h, '{"x": null}')[0], 400) + if __name__ == "__main__": unittest.main() |
