From 9ed47266aadd20b2fd23f5fc4f073120bc3a186f Mon Sep 17 00:00:00 2001 From: Dhruv Thakker Date: Wed, 7 Mar 2018 22:34:05 +0530 Subject: [PATCH] test_lib : Add helper for connection test --- zulip_bots/zulip_bots/test_lib.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zulip_bots/zulip_bots/test_lib.py b/zulip_bots/zulip_bots/test_lib.py index 24a9f64..09a1ae3 100755 --- a/zulip_bots/zulip_bots/test_lib.py +++ b/zulip_bots/zulip_bots/test_lib.py @@ -9,6 +9,7 @@ from zulip_bots.custom_exceptions import ( from zulip_bots.request_test_lib import ( mock_http_conversation, + mock_request_exception ) from zulip_bots.simple_lib import ( @@ -182,6 +183,10 @@ class BotTestCase(TestCase): http_data = read_bot_fixture_data(self.bot_name, test_name) return mock_http_conversation(http_data) + def mock_request_exception(self): + # type: () -> Any + return mock_request_exception() + def mock_config_info(self, config_info): # type: (Dict[str, str]) -> Any return patch('zulip_bots.test_lib.StubBotHandler.get_config_info', return_value=config_info)