def test_failure(self):
import mock
import requests
from six.moves import http_client
response = requests.Response()
response.status_code = http_client.FORBIDDEN
to_patch = 'ci_diff_helper._github._rate_limit_info'
with mock.patch(to_patch) as patched:
with self.assertRaises(requests.HTTPError):
self._call_function_under_test(response)
patched.assert_called_once_with(response)
评论列表
文章目录