diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-02-24 17:26:13 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-02-24 17:26:13 +0800 |
| commit | f0960f0fef263298e56d7e81acf50597073becc7 (patch) | |
| tree | 4d1dad68b652d5b4e900fd434059256e4e5ad3ca /openstackclient/tests/network/v2/fakes.py | |
| parent | e5fe9a70718589b8ce7d455c3e2a3524f85510cb (diff) | |
| download | python-openstackclient-f0960f0fef263298e56d7e81acf50597073becc7.tar.gz | |
Floating IP: Neutron support for "ip floating show" command
Change-Id: I30350076621c83c758927444e5f8bcc2b7d0fc74
Partial-Bug: 1519502
Related-to: blueprint neutron-client
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 |
