test__github.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:ci-diff-helper 作者: dhermes 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号