diff --git a/tests/test_utils.py b/tests/test_utils.py index d8936090..66f8b1ee 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,4 +1,5 @@ import json + from utils import make_fake_message @@ -9,10 +10,10 @@ def test_dataclass_encoder(): ms = MessageSegment.node_custom( "1234", "testtest", "test" + MessageSegment.image("url") ) - s = json.dumps(ms, cls = DataclassEncoder) + s = json.dumps(ms, cls=DataclassEncoder) assert ( s == '{"type": "node", "data": {"user_id": "1234", "nickname": "testtest", "content": [{"type": "text", "data": {"text": "test"}}, {"type": "image", "data": {"url": "url"}}]}}' ) - s1 = json.dumps("123", cls = DataclassEncoder) - assert s1 == '"123"' \ No newline at end of file + s1 = json.dumps("123", cls=DataclassEncoder) + assert s1 == '"123"'