summaryrefslogtreecommitdiff
path: root/openstackclient/tests/common/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/common/test_utils.py')
-rw-r--r--openstackclient/tests/common/test_utils.py12
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']))