From dc982fe5eb06a8a8b79de9959e9048e5b23daa7a Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Thu, 10 Feb 2022 15:12:27 +0800 Subject: [PATCH] :white_check_mark: Fix update cause failed test --- tests/test_adapters/test_template.py | 2 +- tests/test_examples/test_weather.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_adapters/test_template.py b/tests/test_adapters/test_template.py index 32974b63..84856625 100644 --- a/tests/test_adapters/test_template.py +++ b/tests/test_adapters/test_template.py @@ -1,4 +1,4 @@ -from utils import make_fake_message, escape_text +from utils import escape_text, make_fake_message def test_template_basis(): diff --git a/tests/test_examples/test_weather.py b/tests/test_examples/test_weather.py index 08bab064..086e2c1c 100644 --- a/tests/test_examples/test_weather.py +++ b/tests/test_examples/test_weather.py @@ -29,7 +29,11 @@ async def test_weather(app: App): event = make_fake_event(_message=msg, _to_me=True)() ctx.receive_event(bot, event) - ctx.should_call_send(event, Message("你想查询的城市 南京 暂不支持,请重新输入!"), True) + ctx.should_call_send( + event, + Message.template("你想查询的城市 {} 暂不支持,请重新输入!").format("南京"), + True, + ) ctx.should_rejected() msg = Message("北京") @@ -53,7 +57,11 @@ async def test_weather(app: App): event = make_fake_event(_message=msg)() ctx.receive_event(bot, event) - ctx.should_call_send(event, Message("你想查询的城市 杭州 暂不支持,请重新输入!"), True) + ctx.should_call_send( + event, + Message.template("你想查询的城市 {} 暂不支持,请重新输入!").format("杭州"), + True, + ) ctx.should_rejected() msg = Message("北京")