[api-ref]Fix response example file of update_type
The response sample of "Update a volume type" interface refers to that of "Show volume type detail", which is not the same. So this is to add a functional test to generate the update volume type response sample of "Update a volume type" own. https://docs.openstack.org/api-ref/block-storage/v3/index.html#update-a-volume-type Change-Id: I4e5bc87c6ab20ef6b85e0511d3965e7b1f4893ca partially-implements: blueprint volume-response-schema-validation
This commit is contained in:
parent
f0dddd6a13
commit
311b89ce1f
@ -0,0 +1,11 @@
|
||||
{
|
||||
"volume_type": {
|
||||
"id": "6685584b-1eac-4da6-b5c3-555430cf68ff",
|
||||
"name": "vol-type-001",
|
||||
"description": "volume type 0001",
|
||||
"is_public": true,
|
||||
"extra_specs": {
|
||||
"capabilities": "gpu"
|
||||
}
|
||||
}
|
||||
}
|
@ -66,7 +66,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume_type/volume-type-show-response.json
|
||||
.. literalinclude:: ./samples/volume_type/volume-type-update-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"volume_type": {
|
||||
"name": "%(name)s",
|
||||
"description": "%(description)s",
|
||||
"is_public": "%(bool)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"volume_type": {
|
||||
"id": "%(uuid)s",
|
||||
"name": "vol-type-001",
|
||||
"description": "volume type 0001",
|
||||
"is_public": true,
|
||||
"extra_specs": {
|
||||
"capabilities": "gpu"
|
||||
}
|
||||
}
|
||||
}
|
@ -58,6 +58,14 @@ class VolumeTypesSampleJsonTest(api_samples_test_base.ApiSampleTestBase):
|
||||
self._verify_response('volume-type-show-response',
|
||||
self.subs, response, 200)
|
||||
|
||||
def test_volume_type_update(self):
|
||||
res = self._volume_type_create()
|
||||
res = jsonutils.loads(res.content)['volume_type']
|
||||
response = self._do_put(
|
||||
'types/%s' % res['id'], 'volume-type-update-request', self.subs)
|
||||
self._verify_response('volume-type-update-response',
|
||||
self.subs, response, 200)
|
||||
|
||||
def test_volume_type_extra_spec_create_update(self):
|
||||
|
||||
res = self._volume_type_create()
|
||||
|
Loading…
Reference in New Issue
Block a user