🚨 auto fix by pre-commit hooks

This commit is contained in:
pre-commit-ci[bot] 2022-02-17 07:12:29 +00:00
parent c48ddaf0a2
commit 9c0e05c615

View File

@ -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)
s1 = json.dumps("123", cls=DataclassEncoder)
assert s1 == '"123"'