diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-09 19:08:49 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-09 19:08:49 +0100 |
| commit | 4632e6183d38bfd239f066d7e9698f3d118a3f77 (patch) | |
| tree | 8d458ea7395c6e52186f0bfb38344dbc84f68cbe /tests/test_obsclient.py | |
| parent | c906d90dcf0abdfb347bd67d6f33a2c45ae32e66 (diff) | |
| download | deck-it-4632e6183d38bfd239f066d7e9698f3d118a3f77.tar.gz deck-it-4632e6183d38bfd239f066d7e9698f3d118a3f77.zip | |
fix: use OBS's stored password and explain auth failures
Diffstat (limited to 'tests/test_obsclient.py')
| -rw-r--r-- | tests/test_obsclient.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_obsclient.py b/tests/test_obsclient.py index 54eadd1..fe97d35 100644 --- a/tests/test_obsclient.py +++ b/tests/test_obsclient.py @@ -25,6 +25,20 @@ class Disconnected(unittest.TestCase): oc.ObsClient(host="127.0.0.1", port=4455, password="").request("GetVersion") +class RecvJson(unittest.TestCase): + def test_empty_reply_is_a_clear_error(self): + c = oc.ObsClient() + c.ws = type("W", (), {"recv": lambda self: ""})() + with self.assertRaisesRegex(oc.ModuleError, "closed"): + c._recv_json() + + def test_non_json_reply_is_a_clear_error(self): + c = oc.ObsClient() + c.ws = type("W", (), {"recv": lambda self: "HTTP/1.1 400"})() + with self.assertRaisesRegex(oc.ModuleError, "non-JSON"): + c._recv_json() + + class RecvLoop(unittest.TestCase): def test_a_recv_timeout_does_not_end_the_loop(self): import websocket |
