mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-27 18:45:05 +08:00
🚨 auto fix by pre-commit hooks
This commit is contained in:
parent
c48ddaf0a2
commit
9c0e05c615
@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from utils import make_fake_message
|
from utils import make_fake_message
|
||||||
|
|
||||||
|
|
||||||
@ -9,10 +10,10 @@ def test_dataclass_encoder():
|
|||||||
ms = MessageSegment.node_custom(
|
ms = MessageSegment.node_custom(
|
||||||
"1234", "testtest", "test" + MessageSegment.image("url")
|
"1234", "testtest", "test" + MessageSegment.image("url")
|
||||||
)
|
)
|
||||||
s = json.dumps(ms, cls = DataclassEncoder)
|
s = json.dumps(ms, cls=DataclassEncoder)
|
||||||
assert (
|
assert (
|
||||||
s
|
s
|
||||||
== '{"type": "node", "data": {"user_id": "1234", "nickname": "testtest", "content": [{"type": "text", "data": {"text": "test"}}, {"type": "image", "data": {"url": "url"}}]}}'
|
== '{"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"'
|
assert s1 == '"123"'
|
||||||
|
Loading…
Reference in New Issue
Block a user