diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-02-23 18:02:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-02-23 18:02:56 +0000 |
| commit | c2f5945ef62117771d6cff411d6071052c085d30 (patch) | |
| tree | fa573e702f658a1fa20a7c0c9c41381768b4dd2e /openstackclient/tests/network/v2/fakes.py | |
| parent | ab40add0c6a46bbdbbd7d90764c4ea5076373a64 (diff) | |
| parent | dccde70c57baf9266a795a54198238515d7fdda6 (diff) | |
| download | python-openstackclient-c2f5945ef62117771d6cff411d6071052c085d30.tar.gz | |
Merge "Add "security group rule show" command"
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index c24410e1..b1784b60 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -480,15 +480,13 @@ class FakeSecurityGroupRule(object): :param Dictionary methods: A dictionary with all methods :return: - A FakeResource object, with id, name, etc. + A FakeResource object, with id, etc. """ # Set default attributes. security_group_rule_attrs = { - 'description': 'security-group-rule-desc-' + uuid.uuid4().hex, 'direction': 'ingress', 'ethertype': 'IPv4', 'id': 'security-group-rule-id-' + uuid.uuid4().hex, - 'name': 'security-group-rule-name-' + uuid.uuid4().hex, 'port_range_max': None, 'port_range_min': None, 'protocol': None, @@ -502,7 +500,11 @@ class FakeSecurityGroupRule(object): security_group_rule_attrs.update(attrs) # Set default methods. - security_group_rule_methods = {} + security_group_rule_methods = { + 'keys': ['direction', 'ethertype', 'id', 'port_range_max', + 'port_range_min', 'protocol', 'remote_group_id', + 'remote_ip_prefix', 'security_group_id', 'tenant_id'], + } # Overwrite default methods. security_group_rule_methods.update(methods) @@ -511,6 +513,10 @@ class FakeSecurityGroupRule(object): info=copy.deepcopy(security_group_rule_attrs), methods=copy.deepcopy(security_group_rule_methods), loaded=True) + + # Set attributes with special mappings. + security_group_rule.project_id = security_group_rule_attrs['tenant_id'] + return security_group_rule @staticmethod |
