From d94ebdb3d892079bb4ffb4c8069c1a91df914c01 Mon Sep 17 00:00:00 2001 From: HgO Date: Thu, 18 Apr 2024 12:03:05 +0200 Subject: [PATCH] fix test for help command --- tests/test_command.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_command.py b/tests/test_command.py index ad68b08..4d43c1b 100644 --- a/tests/test_command.py +++ b/tests/test_command.py @@ -109,7 +109,8 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase): # We don't spec config, as it doesn't currently have well defined attributes self.fake_config = Mock() self.fake_config.allowed_rooms = [self.fake_room.room_id] - self.fake_config.allowed_reactions = {"🤫", "😶", "🤐"} + self.fake_config.allowed_reactions = {"🤫", "😶", "🤐", "🤗"} + self.fake_config.insult_reactions = {"🤗"} @patch.object(matrix_alertbot.command.AckAlertCommand, "process") async def test_process_ack_command(self, fake_ack: Mock) -> None: @@ -671,6 +672,13 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase): fake_send_text_to_room.assert_called_once() _, _, text = fake_send_text_to_room.call_args.args self.assertIn("Here is the list of available commands", text) + reactions = ( + self.fake_config.allowed_reactions - self.fake_config.insult_reactions + ) + for reaction in reactions: + self.assertIn(reaction, text) + for reaction in self.fake_config.insult_reactions: + self.assertNotIn(reaction, text) @patch.object(matrix_alertbot.command, "send_text_to_room") async def test_angry_user(self, fake_send_text_to_room: Mock) -> None: