summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-10-13 23:26:24 +0000
committerGerrit Code Review <review@openstack.org>2020-10-13 23:26:24 +0000
commit2eeab20eca4b51feb6e81e8e59124f2b092e9b20 (patch)
treec95aac07e852829217a87d28b279813d71fa9804 /openstackclient/tests/unit
parent73765da3104cfdc977a77fb30ea0623a9ba67e5d (diff)
parente410e61d204d09eeb7bcf0a33e3858ef7b110dd3 (diff)
downloadpython-openstackclient-2eeab20eca4b51feb6e81e8e59124f2b092e9b20.tar.gz
Merge "Always display direction for security group rules"
Diffstat (limited to 'openstackclient/tests/unit')
-rw-r--r--openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py1
-rw-r--r--openstackclient/tests/unit/network/v2/test_security_group_rule_network.py16
2 files changed, 9 insertions, 8 deletions
diff --git a/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py b/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py
index 5720e305..b7e38afb 100644
--- a/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py
+++ b/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py
@@ -362,6 +362,7 @@ class TestListSecurityGroupRuleCompute(TestSecurityGroupRuleCompute):
'Ethertype',
'IP Range',
'Port Range',
+ 'Direction',
'Remote Security Group',
)
expected_columns_no_group = \
diff --git a/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py b/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py
index 0a9522b0..01411611 100644
--- a/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py
+++ b/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py
@@ -870,7 +870,7 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
_security_group_rules = [_security_group_rule_tcp,
_security_group_rule_icmp]
- expected_columns_with_group_and_long = (
+ expected_columns_with_group = (
'ID',
'IP Protocol',
'Ethertype',
@@ -885,14 +885,15 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
'Ethertype',
'IP Range',
'Port Range',
+ 'Direction',
'Remote Security Group',
'Security Group',
)
- expected_data_with_group_and_long = []
+ expected_data_with_group = []
expected_data_no_group = []
for _security_group_rule in _security_group_rules:
- expected_data_with_group_and_long.append((
+ expected_data_with_group.append((
_security_group_rule.id,
_security_group_rule.protocol,
_security_group_rule.ether_type,
@@ -909,6 +910,7 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
_security_group_rule.remote_ip_prefix,
security_group_rule._format_network_port_range(
_security_group_rule),
+ _security_group_rule.direction,
_security_group_rule.remote_group_id,
_security_group_rule.security_group_id,
))
@@ -935,14 +937,12 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
self.assertEqual(self.expected_columns_no_group, columns)
self.assertEqual(self.expected_data_no_group, list(data))
- def test_list_with_group_and_long(self):
+ def test_list_with_group(self):
self._security_group_rule_tcp.port_range_min = 80
arglist = [
- '--long',
self._security_group.id,
]
verifylist = [
- ('long', True),
('group', self._security_group.id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -952,8 +952,8 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
self.network.security_group_rules.assert_called_once_with(**{
'security_group_id': self._security_group.id,
})
- self.assertEqual(self.expected_columns_with_group_and_long, columns)
- self.assertEqual(self.expected_data_with_group_and_long, list(data))
+ self.assertEqual(self.expected_columns_with_group, columns)
+ self.assertEqual(self.expected_data_with_group, list(data))
def test_list_with_ignored_options(self):
self._security_group_rule_tcp.port_range_min = 80