def test_help_if_not_running(self): quest = MagicMock() bot_logic = BotLogic(quest) bot_logic.is_started = False messages_list = bot_logic.help() self.assertEqual(bot_logic.is_started, False) self.assertEqual(messages_list[0].text, bot_logic.messages['help']) self.assertEqual(len(messages_list), 1)
def test_handle_message_help(self): quest = MagicMock() update = MagicMock() update.message.text = '/help' context = MagicMock() bot_logic = BotLogic(quest) bot_logic.help = MagicMock(return_value=[]) bot_logic.handle_message(update, context) bot_logic.help.assert_called_once()