示例#1
0
 def test_private_chat(self):
     query = BotQuery()
     query.is_private = True
     query.user_first_name = "Lambda"
     help_command = HelpCommand(query)
     self.assertIs(help_command.query, query)
     
     help_command.handle_normal_query = Mock()
     help_command.execute()
     self.assertTrue(help_command.handle_normal_query.called)
示例#2
0
    def test_private_chat(self):
        query = BotQuery()
        query.is_private = True
        query.user_first_name = "Lambda"
        start_command = StartCommand(query)
        self.assertIs(start_command.query, query)

        start_command.handle_normal_query = Mock()
        start_command.execute()
        start_command.handle_normal_query.assert_called_once_with(
            "Hello Lambda! Welcome to the DAS bot!")