diff options
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index b1784b60..ea2d38d1 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -635,14 +635,24 @@ class FakeFloatingIP(object): 'id': 'floating-ip-id-' + uuid.uuid4().hex, 'floating_ip_address': '1.0.9.0', 'fixed_ip_address': '2.0.9.0', + 'dns_domain': None, + 'dns_name': None, + 'status': 'DOWN', + 'floating_network_id': 'network-id-' + uuid.uuid4().hex, + 'router_id': 'router-id-' + uuid.uuid4().hex, 'port_id': 'port-id-' + uuid.uuid4().hex, + 'tenant_id': 'project-id-' + uuid.uuid4().hex, } # Overwrite default attributes. floating_ip_attrs.update(attrs) # Set default methods. - floating_ip_methods = {} + floating_ip_methods = { + 'keys': ['id', 'floating_ip_address', 'fixed_ip_address', + 'dns_domain', 'dns_name', 'status', 'router_id', + 'floating_network_id', 'port_id', 'tenant_id'] + } # Overwrite default methods. floating_ip_methods.update(methods) @@ -650,7 +660,12 @@ class FakeFloatingIP(object): floating_ip = fakes.FakeResource( info=copy.deepcopy(floating_ip_attrs), methods=copy.deepcopy(floating_ip_methods), - loaded=True) + loaded=True + ) + + # Set attributes with special mappings in OpenStack SDK. + floating_ip.project_id = floating_ip_attrs['tenant_id'] + return floating_ip @staticmethod |
