github_detail_bot: Add tests for bad requests.

(This module now has 100% coverage.)
This commit is contained in:
Dhruv Thakker 2018-03-08 18:52:12 +05:30 committed by showell
parent 8e978a0845
commit 68fcb3c8e1

View file

@ -67,6 +67,13 @@ class TestGithubDetailBot(BotTestCase):
with self.mock_config_info(self.mock_config):
self.verify_reply(request, bot_response)
def test_exception(self) -> None:
request = 'zulip/zulip#0'
bot_response = 'Failed to find issue/pr: zulip/zulip#0'
with self.mock_request_exception():
with self.mock_config_info(self.mock_config):
self.verify_reply(request, bot_response)
def test_random_text(self) -> None:
request = 'some random text'
bot_response = 'Failed to find any issue or PR.'