コード例 #1
0
    def test_with_pattern(self, chosen_inline_result):
        handler = ChosenInlineResultHandler(self.callback_basic,
                                            pattern='.*ult.*')

        assert handler.check_update(chosen_inline_result)

        chosen_inline_result.chosen_inline_result.result_id = 'nothing here'
        assert not handler.check_update(chosen_inline_result)
        chosen_inline_result.chosen_inline_result.result_id = 'result_id'
コード例 #2
0
    def test_basic(self, dp, chosen_inline_result):
        handler = ChosenInlineResultHandler(self.callback_basic)
        dp.add_handler(handler)

        assert handler.check_update(chosen_inline_result)
        dp.process_update(chosen_inline_result)
        assert self.test_flag
コード例 #3
0
    def test_basic(self, dp, chosen_inline_result):
        handler = ChosenInlineResultHandler(self.callback_basic)
        dp.add_handler(handler)

        assert handler.check_update(chosen_inline_result)
        dp.process_update(chosen_inline_result)
        assert self.test_flag
コード例 #4
0
 def test_other_update_types(self, false_update):
     handler = ChosenInlineResultHandler(self.callback_basic)
     assert not handler.check_update(false_update)
コード例 #5
0
 def test_other_update_types(self, false_update):
     handler = ChosenInlineResultHandler(self.callback_basic)
     assert not handler.check_update(false_update)