Esempio n. 1
0
    def test_group_chat(self):
        query = BotQuery()
        query.is_group = True
        query.user_first_name = "Foobar"
        query.chat_title = "Anonymous"
        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)
Esempio n. 2
0
    def test_group_chat(self):
        query = BotQuery()
        query.is_group = True
        query.user_first_name = "Foobar"
        query.chat_title = "Anonymous"
        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 Anonymous! I am the DAS Bot, Foobar has summoned me here!")