Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raman325 committed Sep 21, 2023
1 parent c102521 commit 3b83975
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ async def test_listen_not_success(client_session, url, result, driver_ready):
"""Test receive result message with success False on listen."""
result["success"] = False
result["errorCode"] = "error_code"
result["message"] = "test"
client = Client(url, client_session)
await client.connect()

Expand All @@ -222,6 +223,7 @@ async def test_initialize_not_success(
"""Test receive result message with success False on listen."""
initialize_data["success"] = False
initialize_data["errorCode"] = "error_code"
initialize_data["message"] = "test"
client = Client(url, client_session)
await client.connect()

Expand All @@ -237,6 +239,7 @@ async def test_get_log_config_not_success(
"""Test receive log config message with success False on listen."""
get_log_config_data["success"] = False
get_log_config_data["errorCode"] = "error_code"
get_log_config_data["message"] = "test"
client = Client(url, client_session)
await client.connect()

Expand Down Expand Up @@ -310,6 +313,7 @@ async def test_command_error_handling(client, mock_command):
{"command": "some_command"},
{
"errorCode": "unknown_command",
"message": "test"
},
False,
)
Expand All @@ -318,6 +322,7 @@ async def test_command_error_handling(client, mock_command):
await client.async_send_command({"command": "some_command"})

assert raised.value.error_code == "unknown_command"
assert str(raised.value) == "unknown_command: test"

mock_command(
{"command": "some_zjs_command"},
Expand Down

0 comments on commit 3b83975

Please sign in to comment.