Teach utils.option to fail so that it can succeed

This commit is contained in:
George Marshall 2014-02-27 18:16:08 -08:00
parent b18e89fdc3
commit acdb4d3d85

View File

@ -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
============================