def test_accelerator_post(self, mock_uuid, mock_create):
mock_uuid.return_value = self.ACCELERATOR_UUID
body = gen_post_body(name='test_accelerator')
headers = self.gen_headers(self.context)
response = self.post_json('/accelerators', body, headers=headers)
self.assertEqual(http_client.CREATED, response.status_int)
response = response.json
self.assertEqual(self.ACCELERATOR_UUID, response['uuid'])
self.assertEqual(body['name'], response['name'])
mock_create.assert_called_once_with(mock.ANY, mock.ANY, mock.ANY)
评论列表
文章目录