From cd196c2143f520a6b1579ac61316a81f992aa94a Mon Sep 17 00:00:00 2001 From: HgO Date: Tue, 12 Jul 2022 00:29:46 +0200 Subject: [PATCH] improve error message --- matrix_alertbot/command.py | 2 +- tests/test_command.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix_alertbot/command.py b/matrix_alertbot/command.py index 6f7214c..0747ee4 100644 --- a/matrix_alertbot/command.py +++ b/matrix_alertbot/command.py @@ -97,7 +97,7 @@ class Command: await send_text_to_room( self.client, self.room.room_id, - f"I tried really hard, but I can't convert this duration to a number of seconds: {duration}.", + f"I tried really hard, but I can't convert the duration '{duration}' to a number of seconds.", ) return diff --git a/tests/test_command.py b/tests/test_command.py index b16cc83..8c14307 100644 --- a/tests/test_command.py +++ b/tests/test_command.py @@ -402,7 +402,7 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase): self.fake_cache, self.fake_alertmanager, self.fake_config, - "ack duration", + "ack invalid duration", self.fake_room, self.fake_sender, self.fake_event_id, @@ -415,7 +415,7 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase): fake_send_text_to_room.assert_called_once_with( self.fake_client, self.fake_room.room_id, - "I tried really hard, but I can't convert this duration to a number of seconds: duration.", + "I tried really hard, but I can't convert the duration 'invalid duration' to a number of seconds.", ) @patch.object(matrix_alertbot.command, "send_text_to_room")