コード例 #1
0
ファイル: test_lib.py プロジェクト: Juljan/python-zulip-api
    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
コード例 #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
コード例 #3
0
ファイル: test_lib.py プロジェクト: suntofly/python-zulip-api
 def test_bot_usage(self) -> None:
     bot = get_bot_message_handler(self.bot_name)
     assert bot.usage() != ''
コード例 #4
0
ファイル: test_lib.py プロジェクト: suntofly/python-zulip-api
 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)
コード例 #5
0
ファイル: test_lib.py プロジェクト: suntofly/python-zulip-api
 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)
コード例 #6
0
ファイル: test_lib.py プロジェクト: sinwar/python-zulip-api
 def test_bot_usage(self):
     # type: () -> None
     bot = get_bot_message_handler(self.bot_name)
     self.assertNotEqual(bot.usage(), '')
コード例 #7
0
ファイル: test_lib.py プロジェクト: Juljan/python-zulip-api
 def test_bot_usage(self) -> None:
     bot = get_bot_message_handler(self.bot_name)
     assert bot.usage() != ''
コード例 #8
0
ファイル: test_lib.py プロジェクト: Juljan/python-zulip-api
 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)
コード例 #9
0
ファイル: test_lib.py プロジェクト: Juljan/python-zulip-api
 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)