Exemplo n.º 1
0
def test_beep(context):
    update = MockTelegramUpdate.with_command()
    beep = BeepFunctionality()

    beep.call(update, context)

    context.bot.send_message.assert_called()
    assert context.bot.send_message.call_args[1][
        'chat_id'] == update.message.chat_id
    assert context.bot.send_message.call_args[1]['text'] == "boop"
Exemplo n.º 2
0
def test_welcome_message(context):
    update = MockTelegramUpdate.with_command()
    func = WelcomeFunctionality()

    func.call(update, context)

    context.bot.send_message.assert_called()
    assert context.bot.send_message.call_args[1][
        'chat_id'] == update.message.chat_id
    message_text = context.bot.send_message.call_args[1]['text']
    assert "@deerspangle" in message_text
    assert "https://github.com/Deer-Spangle/FA-search-bot" in message_text
    assert FASearchBot.VERSION in message_text
Exemplo n.º 3
0
 def test_can_create_command(self):
     update = MockTelegramUpdate.with_command()
     assert update.callback_query is None
     assert update.message is not None
     assert update.message.message_id is not None
     assert update.message.chat_id is not None