def test_create_success_with_201_response_code(
self, mock_client, mock_create):
body = {
"host": {
"name": "host-1", "type": "fake",
"reserved": False,
"on_maintenance": False,
"control_attributes": "fake-control_attributes"
}
}
fake_req = self.req
fake_req.headers['Content-Type'] = 'application/json'
fake_req.method = 'POST'
fake_req.body = jsonutils.dump_as_bytes(body)
resp = fake_req.get_response(self.app)
self.assertEqual(http.CREATED, resp.status_code)
评论列表
文章目录