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
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
def test_bot_usage(self) -> None: bot = get_bot_message_handler(self.bot_name) assert bot.usage() != ''
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)
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)
def test_bot_usage(self): # type: () -> None bot = get_bot_message_handler(self.bot_name) self.assertNotEqual(bot.usage(), '')
def test_bot_usage(self) -> None: bot = get_bot_message_handler(self.bot_name) assert bot.usage() != ''
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)
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)