def test_json_HTTPResponse(self):
self.app.route('/')(lambda: bottle.HTTPResponse({'a': 1}, 500))
try:
self.assertBody(bottle.json_dumps({'a': 1}))
self.assertHeader('Content-Type','application/json')
except ImportError:
warn("Skipping JSON tests.")
评论列表
文章目录