Esempio n. 1
0
    def _get_handlers(self) -> Tuple[Any, StubBotHandler]:
        bot = get_bot_message_handler(self.bot_name)
        bot_handler = StubBotHandler()

        if hasattr(bot, 'initialize'):
            bot.initialize(bot_handler)

        return bot, bot_handler
Esempio n. 2
0
    def _get_handlers(self) -> Tuple[Any, StubBotHandler]:
        bot = get_bot_message_handler(self.bot_name)
        bot_handler = StubBotHandler()

        if hasattr(bot, 'initialize'):
            bot.initialize(bot_handler)

        return bot, bot_handler
Esempio n. 3
0
 def test_bot_usage(self) -> None:
     bot = get_bot_message_handler(self.bot_name)
     assert bot.usage() != ''
Esempio n. 4
0
 def validate_valid_config(self, config_data: Dict[str, str]) -> None:
     bot_class = type(get_bot_message_handler(self.bot_name))
     bot_class.validate_config(config_data)
Esempio n. 5
0
 def validate_invalid_config(self, config_data: Dict[str, str],
                             error_regexp: str) -> None:
     bot_class = type(get_bot_message_handler(self.bot_name))
     with self.assertRaisesRegexp(ConfigValidationError, error_regexp):
         bot_class.validate_config(config_data)
Esempio n. 6
0
 def test_bot_usage(self):
     # type: () -> None
     bot = get_bot_message_handler(self.bot_name)
     self.assertNotEqual(bot.usage(), '')
Esempio n. 7
0
 def test_bot_usage(self) -> None:
     bot = get_bot_message_handler(self.bot_name)
     assert bot.usage() != ''
Esempio n. 8
0
 def validate_valid_config(self, config_data: Dict[str, str]) -> None:
     bot_class = type(get_bot_message_handler(self.bot_name))
     bot_class.validate_config(config_data)
Esempio n. 9
0
 def validate_invalid_config(self, config_data: Dict[str, str], error_regexp: str) -> None:
     bot_class = type(get_bot_message_handler(self.bot_name))
     with self.assertRaisesRegexp(ConfigValidationError, error_regexp):
         bot_class.validate_config(config_data)