testcases.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:django-telegram-bot 作者: jlmadurga 项目源码 文件源码
def assertBotResponse(self, mock_send, command):
        args, kwargs = mock_send.call_args
        self.assertEqual(1, mock_send.call_count)
        self.assertEqual(kwargs['chat_id'], self.update.message.chat.id)
        self.assertEqual(kwargs['parse_mode'], command['out']['parse_mode'])
        if not command['out']['reply_markup']:
            self.assertTrue(isinstance(kwargs['reply_markup'], ReplyKeyboardRemove))
        else:
            self.assertInKeyboard(command['out']['reply_markup'], kwargs['reply_markup'].keyboard)
        if not PY3:
            kwargs['text'] = kwargs['text'].decode('utf-8')
        self.assertIn(command['out']['text'], kwargs['text'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号