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_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))