zulip_bots: Get 100% test coverage for giphy bot.

This commit is contained in:
Robert Hönig 2017-11-27 16:04:30 +01:00 committed by showell
parent 93edededdd
commit 2cb43256e0
6 changed files with 85 additions and 9 deletions

View file

@ -137,7 +137,7 @@ class BotTestCaseBase(TestCase):
http_headers = http_data.get('response-headers')
with patch('requests.get') as mock_get:
mock_result = requests.Response()
mock_result._content = json.dumps(http_response).encode()
mock_result._content = json.dumps(http_response).encode() # type: ignore # We are modifying a "hidden" attribute.
mock_result.status_code = http_headers.get('status', 200)
mock_get.return_value = mock_result
yield