Use compact encoding for JSON websocket messages (#67148)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
5366c0e3e3
commit
c9e46d360b
3 changed files with 8 additions and 4 deletions
|
@ -83,13 +83,13 @@ async def test_message_to_json(caplog):
|
|||
|
||||
json_str = message_to_json({"id": 1, "message": "xyz"})
|
||||
|
||||
assert json_str == '{"id": 1, "message": "xyz"}'
|
||||
assert json_str == '{"id":1,"message":"xyz"}'
|
||||
|
||||
json_str2 = message_to_json({"id": 1, "message": _Unserializeable()})
|
||||
|
||||
assert (
|
||||
json_str2
|
||||
== '{"id": 1, "type": "result", "success": false, "error": {"code": "unknown_error", "message": "Invalid JSON in response"}}'
|
||||
== '{"id":1,"type":"result","success":false,"error":{"code":"unknown_error","message":"Invalid JSON in response"}}'
|
||||
)
|
||||
assert "Unable to serialize to JSON" in caplog.text
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue