def test_from_response_404(self):
r = models.Response()
r.status_code = 404
r.headers['Content-Type'] = "application/json"
r._content = json.dumps(
{"description": "Archive policy rule foobar does not exist"}
).encode('utf-8')
exc = exceptions.from_response(r)
self.assertIsInstance(exc, exceptions.ArchivePolicyRuleNotFound)
test_exceptions.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录