test_http.py 文件源码

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

项目:python-valenceclient 作者: openstack 项目源码 文件源码
def test_server_exception_msg_only(self):
        error_body = "test error msg"
        error_body = _get_error_body(detail=error_body)
        kwargs = {"valence_url": "http://localhost"}
        client = http.HTTPClient(**kwargs)
        client.session = utils.mockSession(
            {'Content-Type': 'application/json'},
            error_body,
            version=1,
            status_code=http_client.INTERNAL_SERVER_ERROR)

        self.assertRaises(exc.InternalServerError,
                          client.json_request,
                          'GET', 'redfish/v1')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号