Merge "Pecan: wrap PUT response with resource name"
This commit is contained in:
commit
105c9a7da7
@ -106,7 +106,7 @@ class ItemController(utils.NeutronPecanController):
|
||||
# Bulk update is not supported, 'resources' always contains a single
|
||||
# elemenet
|
||||
data = {self.resource: resources[0]}
|
||||
return updater(neutron_context, self.item, data)
|
||||
return {self.resource: updater(neutron_context, self.item, data)}
|
||||
|
||||
@utils.when(index, method='DELETE')
|
||||
def delete(self):
|
||||
|
@ -264,6 +264,11 @@ class TestResourceController(TestRootController):
|
||||
params={'port': {'name': 'test'}},
|
||||
headers={'X-Project-Id': 'tenid'})
|
||||
self.assertEqual(response.status_int, 200)
|
||||
json_body = jsonutils.loads(response.body)
|
||||
self.assertEqual(1, len(json_body))
|
||||
self.assertIn('port', json_body)
|
||||
self.assertEqual('test', json_body['port']['name'])
|
||||
self.assertEqual('tenid', json_body['port']['tenant_id'])
|
||||
|
||||
def test_delete(self):
|
||||
response = self.app.delete('/v2.0/ports/%s.json' % self.port['id'],
|
||||
|
Loading…
Reference in New Issue
Block a user