def test_invalid_header(self, client):
client.app.add_route('/400', InvalidHeaderResource())
response = client.simulate_request(path='/400')
expected_desc = (u'The value provided for the X-Auth-Token '
u'header is invalid. Please provide a valid token.')
expected_body = {
u'title': u'Invalid header value',
u'description': expected_desc,
u'code': u'A1001',
}
assert response.status == falcon.HTTP_400
assert response.json == expected_body
评论列表
文章目录