diff options
| author | Terry Howe <terrylhowe@gmail.com> | 2015-12-10 14:58:16 -0700 |
|---|---|---|
| committer | Terry Howe <terrylhowe@gmail.com> | 2015-12-10 15:22:38 -0700 |
| commit | 1cf320302bee2e406ed7189d3cf3d08542770637 (patch) | |
| tree | b466f7c1823815cb435fb07f7bf9fcfe3fc34bc6 /openstackclient/tests | |
| parent | 823ba770e0baafa707c89723c576db060b1b4742 (diff) | |
| download | python-openstackclient-1cf320302bee2e406ed7189d3cf3d08542770637.tar.gz | |
Map some of the SDK field names
The keys() method returns the keys returned from Neutron, but
the SDK maps some things like tenant_id to project_id. This
makes the output a little prettier.
Change-Id: Ibd8c890b61ffc94021f93fc1051fcf5dabd1e9ea
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 5 | ||||
| -rw-r--r-- | openstackclient/tests/network/v2/test_network.py | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index abb88ee4..0e601a72 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -73,11 +73,12 @@ class FakeNetwork(object): router_external, status, subnets, tenant_id """ # Set default attributes. + project_id = 'project-id-' + uuid.uuid4().hex network_attrs = { 'id': 'network-id-' + uuid.uuid4().hex, 'name': 'network-name-' + uuid.uuid4().hex, 'status': 'ACTIVE', - 'tenant_id': 'project-id-' + uuid.uuid4().hex, + 'tenant_id': project_id, 'admin_state_up': True, 'shared': False, 'subnets': ['a', 'b'], @@ -101,6 +102,8 @@ class FakeNetwork(object): network = fakes.FakeResource(info=copy.deepcopy(network_attrs), methods=copy.deepcopy(network_methods), loaded=True) + network.project_id = project_id + return network @staticmethod diff --git a/openstackclient/tests/network/v2/test_network.py b/openstackclient/tests/network/v2/test_network.py index e8651492..df61b0db 100644 --- a/openstackclient/tests/network/v2/test_network.py +++ b/openstackclient/tests/network/v2/test_network.py @@ -44,20 +44,20 @@ class TestCreateNetworkIdentityV3(TestNetwork): 'admin_state_up', 'id', 'name', + 'project_id', 'router_external', 'status', 'subnets', - 'tenant_id', ) data = ( network._format_admin_state(_network.admin_state_up), _network.id, _network.name, + _network.project_id, network._format_router_external(_network.router_external), _network.status, utils.format_list(_network.subnets), - _network.tenant_id, ) def setUp(self): @@ -176,20 +176,20 @@ class TestCreateNetworkIdentityV2(TestNetwork): 'admin_state_up', 'id', 'name', + 'project_id', 'router_external', 'status', 'subnets', - 'tenant_id', ) data = ( network._format_admin_state(_network.admin_state_up), _network.id, _network.name, + _network.project_id, network._format_router_external(_network.router_external), _network.status, utils.format_list(_network.subnets), - _network.tenant_id, ) def setUp(self): @@ -330,7 +330,7 @@ class TestListNetwork(TestNetwork): net.id, net.name, net.status, - net.tenant_id, + net.project_id, network._format_admin_state(net.admin_state_up), net.shared, utils.format_list(net.subnets), @@ -475,20 +475,20 @@ class TestShowNetwork(TestNetwork): 'admin_state_up', 'id', 'name', + 'project_id', 'router_external', 'status', 'subnets', - 'tenant_id', ) data = ( network._format_admin_state(_network.admin_state_up), _network.id, _network.name, + _network.project_id, network._format_router_external(_network.router_external), _network.status, utils.format_list(_network.subnets), - _network.tenant_id, ) def setUp(self): |
