diff --git a/tests/unit/utils/utils_test.py b/tests/unit/utils/utils_test.py index 313fa2fa77..cd04c52561 100644 --- a/tests/unit/utils/utils_test.py +++ b/tests/unit/utils/utils_test.py @@ -252,6 +252,14 @@ class UtilsTestCase(TestCase): self.assertTrue(utils.test_mode(Test=True)) self.assertTrue(utils.test_mode(tEsT=True)) + def test_option(self): + test_two_level_dict = {'foo': {'bar': 'baz'}} + + self.assertDictEqual({'not_found': 'nope'}, utils.option('foo:bar', {'not_found': 'nope'})) + self.assertEqual('baz', utils.option('foo:bar', {'not_found': 'nope'}, opts=test_two_level_dict)) + self.assertEqual('baz', utils.option('foo:bar', {'not_found': 'nope'}, pillar={'master': test_two_level_dict})) + self.assertEqual('baz', utils.option('foo:bar', {'not_found': 'nope'}, pillar=test_two_level_dict)) + def test_parse_docstring(self): test_keystone_str = '''Management of Keystone users ============================