Currently compute tenant_networks_client returns Response by removing top key from Response. For example- return service_client.ResponseBody(resp, body['network']) As service clients are in direction to move to Tempest-lib, all service clients should return Response without any truncation. One good example is Resource pagination links which are lost with current way of return value. Resource pagination links are present in parallel (not inside) to top key of Response. This patch makes compute tenant_networks_client to return complete Response body. Change-Id: Ie0f6e709cbb3a215752344cb39f2f7a6f5a7a91b Implements: blueprint method-return-value-and-move-service-clients-to-lib
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
# Copyright 2015 NEC Corporation. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from tempest.api.compute import base
|
|
from tempest import test
|
|
|
|
|
|
class NetworksTestJSON(base.BaseV2ComputeTest):
|
|
|
|
@classmethod
|
|
def resource_setup(cls):
|
|
super(NetworksTestJSON, cls).resource_setup()
|
|
cls.client = cls.os.tenant_networks_client
|
|
|
|
@test.idempotent_id('edfea98e-bbe3-4c7a-9739-87b986baff26')
|
|
def test_list_show_tenant_networks(self):
|
|
tenant_networks = self.client.list_tenant_networks()['networks']
|
|
self.assertNotEmpty(tenant_networks, "No tenant networks found.")
|
|
|
|
for net in tenant_networks:
|
|
tenant_network = (self.client.show_tenant_network(net['id'])
|
|
['network'])
|
|
self.assertEqual(net['id'], tenant_network['id'])
|