summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/network/v2/fakes.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-01 18:03:19 +0000
committerGerrit Code Review <review@openstack.org>2017-03-01 18:03:19 +0000
commit3816433b53cf6098d062961320e37083451cb9e1 (patch)
treec031bfcdd48aa6bf64344c9b824f450836c6e5cc /openstackclient/tests/unit/network/v2/fakes.py
parent1654f56f4e4f3757cd707bc6c908f493102d97ea (diff)
parent1169434f42a751ca9ef37fed2fa2fd04fe8b6f8b (diff)
downloadpython-openstackclient-3816433b53cf6098d062961320e37083451cb9e1.tar.gz
Merge "Auto allocated topology for OSC"
Diffstat (limited to 'openstackclient/tests/unit/network/v2/fakes.py')
-rw-r--r--openstackclient/tests/unit/network/v2/fakes.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py
index 612dcab0..7afe3328 100644
--- a/openstackclient/tests/unit/network/v2/fakes.py
+++ b/openstackclient/tests/unit/network/v2/fakes.py
@@ -157,6 +157,31 @@ class FakeAddressScope(object):
return mock.Mock(side_effect=address_scopes)
+class FakeAutoAllocatedTopology(object):
+ """Fake Auto Allocated Topology"""
+
+ @staticmethod
+ def create_one_topology(attrs=None):
+ attrs = attrs or {}
+
+ auto_allocated_topology_attrs = {
+ 'id': 'network-id-' + uuid.uuid4().hex,
+ 'tenant_id': 'project-id-' + uuid.uuid4().hex,
+ }
+
+ auto_allocated_topology_attrs.update(attrs)
+
+ auto_allocated_topology = fakes.FakeResource(
+ info=copy.deepcopy(auto_allocated_topology_attrs),
+ loaded=True)
+
+ auto_allocated_topology.project_id = auto_allocated_topology_attrs[
+ 'tenant_id'
+ ]
+
+ return auto_allocated_topology
+
+
class FakeAvailabilityZone(object):
"""Fake one or more network availability zones (AZs)."""