Fix update cause failed test

This commit is contained in:
Mix 2022-02-10 15:12:27 +08:00
parent b7762b9176
commit dc982fe5eb
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from utils import make_fake_message, escape_text from utils import escape_text, make_fake_message
def test_template_basis(): def test_template_basis():

View File

@ -29,7 +29,11 @@ async def test_weather(app: App):
event = make_fake_event(_message=msg, _to_me=True)() event = make_fake_event(_message=msg, _to_me=True)()
ctx.receive_event(bot, event) ctx.receive_event(bot, event)
ctx.should_call_send(event, Message("你想查询的城市 南京 暂不支持,请重新输入!"), True) ctx.should_call_send(
event,
Message.template("你想查询的城市 {} 暂不支持,请重新输入!").format("南京"),
True,
)
ctx.should_rejected() ctx.should_rejected()
msg = Message("北京") msg = Message("北京")
@ -53,7 +57,11 @@ async def test_weather(app: App):
event = make_fake_event(_message=msg)() event = make_fake_event(_message=msg)()
ctx.receive_event(bot, event) ctx.receive_event(bot, event)
ctx.should_call_send(event, Message("你想查询的城市 杭州 暂不支持,请重新输入!"), True) ctx.should_call_send(
event,
Message.template("你想查询的城市 {} 暂不支持,请重新输入!").format("杭州"),
True,
)
ctx.should_rejected() ctx.should_rejected()
msg = Message("北京") msg = Message("北京")