summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/network/v2/fakes.py5
-rw-r--r--openstackclient/tests/network/v2/test_network.py14
2 files changed, 11 insertions, 8 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py
index b45c5412..80760a77 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 f22224b6..12ac802c 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):
@@ -186,20 +186,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):
@@ -340,7 +340,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),
@@ -485,20 +485,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):