diff options
| author | Terry Howe <terrylhowe@gmail.com> | 2014-09-04 08:06:03 -0600 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2014-09-06 23:55:31 -0400 |
| commit | 514ecc6e963bd0c05425f0da8aec79a69ed122c6 (patch) | |
| tree | dae976e16ee325b502db2e19378b0e1f4dc2253c /openstackclient/tests/common/test_utils.py | |
| parent | dc68d3f5cfb2df1008bfb342984bd7fe1298f917 (diff) | |
| download | python-openstackclient-514ecc6e963bd0c05425f0da8aec79a69ed122c6.tar.gz | |
Unordered dicts and lists causes variable results
The unordered dict and lists causes variable results. The user
may see different results and tests can fail. Might as well make
this more consistent.
Change-Id: I7045b40b44cbf3ee0f2ca79c6ea0d279b6d8cfe3
Diffstat (limited to 'openstackclient/tests/common/test_utils.py')
| -rw-r--r-- | openstackclient/tests/common/test_utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/openstackclient/tests/common/test_utils.py b/openstackclient/tests/common/test_utils.py index 6d75a9b5..e782d410 100644 --- a/openstackclient/tests/common/test_utils.py +++ b/openstackclient/tests/common/test_utils.py @@ -130,3 +130,15 @@ class TestFindResource(test_utils.TestCase): str(result)) self.manager.get.assert_called_with(self.name) self.manager.find.assert_called_with(name=self.name) + + def test_format_dict(self): + expected = "a='b', c='d', e='f'" + self.assertEqual(expected, + utils.format_dict({'a': 'b', 'c': 'd', 'e': 'f'})) + self.assertEqual(expected, + utils.format_dict({'e': 'f', 'c': 'd', 'a': 'b'})) + + def test_format_list(self): + expected = 'a, b, c' + self.assertEqual(expected, utils.format_list(['a', 'b', 'c'])) + self.assertEqual(expected, utils.format_list(['c', 'b', 'a'])) |
