Esempio n. 1
0
    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))
Esempio n. 2
0
    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))
Esempio n. 3
0
    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))