From e05f02acd583797ceb449fc501d371d45a4293c1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 17 Jul 2023 23:03:59 +0200 Subject: switch to JSON-RPC as message format Instead of the weird `struct msg` I had, I switched to the JSON-RPC format. It's basically the same, but has a well-defined semantics in case of errors. --- test/py/test_basic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/py/test_basic.py b/test/py/test_basic.py index 7ac038c..eda12d0 100644 --- a/test/py/test_basic.py +++ b/test/py/test_basic.py @@ -47,18 +47,18 @@ def test_cmd_line_invalid_option(server_exe, worker_exe, client_exe): _test_cmd_line_invalid_option_internal(client_exe, 'client') -def test_run_client_no_msg(client): +def test_run_client_no_action(client): ec, output = client.try_run() assert ec != 0, f'Invalid exit code {ec}, output:\n{output}' - prefix = 'usage error: no message to send to the server\n' + prefix = 'usage error: no action specified\n' assert output.startswith(prefix), f'Invalid output:\n{output}' -def test_run_client_invalid_msg(server, client): +def test_run_client_invalid_request(server, client): ec, output = client.try_run('hello') assert ec != 0, f'Invalid exit code {ec}, output:\n{output}' - suffix = "Failed to connect to server or it couldn't process the request\n" - assert output.endswith(suffix), f'Invalid output:\n{output}' + prefix = 'usage error: invalid request\n' + assert output.startswith(prefix), f'Invalid output:\n{output}' def test_run_noop_server(server): -- cgit v1.2.3