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'])
评论列表
文章目录