Ejemplo n.º 1
0
    def test_send_message(self, mocker):
        bot = TululBot('TOKEN')
        return_value = 'some return value'
        mock_send_message = mocker.patch.object(bot._telebot, 'send_message',
                                                return_value=return_value,
                                                autospec=True)
        chat_id = 12345
        text = 'Hello world'

        rv = bot.send_message(chat_id, text)

        assert rv == return_value
        mock_send_message.assert_called_once_with(chat_id, text)