diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2015-12-23 13:44:22 -0600 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2015-12-23 13:44:22 -0600 |
| commit | 0e38ef84844ba406cb18fe3893dc6bebd205ef51 (patch) | |
| tree | 65f40b124d235b3bcd0bf0847894ba1d3411b406 /openstackclient/tests | |
| parent | 49bed38a89ffb932334b3bdab9e59b32099c9e81 (diff) | |
| download | python-openstackclient-0e38ef84844ba406cb18fe3893dc6bebd205ef51.tar.gz | |
Improve output for "os security group show"
Improve the security group rules output when running the
"os security group show" command. Each security group rule
is now displayed on a separate line.
Current output example:
$ openstack security group show default
+-------------+------------------------- ... ---+
| Field | Value ... |
+-------------+------------------------- ... ---+
| description | Default security group ... |
| id | 048a5fc3-3be1-407d-ae47-9... |
| name | default ... |
| project_id | 3b96bb2020c1459da76963f9e... |
| rules | [u"id='5d812367-9829-4340...t"] |
+-------------+------------------------- ... ---+
New output example:
+-------------+------------------------- ... ---+
| Field | Value ... |
+-------------+------------------------- ... ---+
| description | Default security group ... |
| id | 048a5fc3-3be1-407d-ae47-9... |
| name | default ... |
| project_id | 3b96bb2020c1459da76963f9e... |
| rules | id='5d812367-9829-4340-95...lt' |
| | id='ee451d1c-ade3-4975-8e...lt' |
+-------------+------------------------- ... ---+
Change-Id: I1386075310896c58a2b776e2bbec3603bd00eff1
Partial-Bug: #1519511
Related-To: blueprint neutron-client
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/common/test_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openstackclient/tests/common/test_utils.py b/openstackclient/tests/common/test_utils.py index b564ffab..064ad417 100644 --- a/openstackclient/tests/common/test_utils.py +++ b/openstackclient/tests/common/test_utils.py @@ -347,3 +347,10 @@ class TestFindResource(test_utils.TestCase): expected = 'a, b, c' self.assertEqual(expected, utils.format_list(['a', 'b', 'c'])) self.assertEqual(expected, utils.format_list(['c', 'b', 'a'])) + + def test_format_list_separator(self): + expected = 'a\nb\nc' + actual_pre_sorted = utils.format_list(['a', 'b', 'c'], separator='\n') + actual_unsorted = utils.format_list(['c', 'b', 'a'], separator='\n') + self.assertEqual(expected, actual_pre_sorted) + self.assertEqual(expected, actual_unsorted) |
