示例#1
0
 def test_extra_values_none_or_empty(self):
     ret = extra_minion_data_in_pillar.ext_pillar('fake_id', self.pillar,
                                                  'fake_include', None)
     self.assertEqual(ret, {})
     ret = extra_minion_data_in_pillar.ext_pillar('fake_id', self.pillar,
                                                  'fake_include', {})
     self.assertEqual(ret, {})
 def test_include_specific_keys(self):
     # Tests partially existing key, key with and without subkey,
     ret = extra_minion_data_in_pillar.ext_pillar(
         'fake_id', self.pillar,
         include=['key1:subkey1', 'key2:subkey3', 'key3', 'key4'],
         extra_minion_data=self.extra_minion_data)
     self.assertEqual(ret, {'key1': {'subkey1': 'value1'},
                            'key3': 'value3',
                            'key4': {'subkey4': 'value4'}})
示例#3
0
 def test_include_specific_keys(self):
     # Tests partially existing key, key with and without subkey,
     ret = extra_minion_data_in_pillar.ext_pillar(
         "fake_id",
         self.pillar,
         include=["key1:subkey1", "key2:subkey3", "key3", "key4"],
         extra_minion_data=self.extra_minion_data,
     )
     self.assertEqual(
         ret,
         {
             "key1": {
                 "subkey1": "value1"
             },
             "key3": "value3",
             "key4": {
                 "subkey4": "value4"
             },
         },
     )
示例#4
0
 def test_include_all(self):
     for include_all in ['*', '<all>']:
         ret = extra_minion_data_in_pillar.ext_pillar(
             'fake_id', self.pillar, include_all, self.extra_minion_data)
         self.assertEqual(ret, self.extra_minion_data)
示例#5
0
 def test_include_all(self):
     for include_all in ["*", "<all>"]:
         ret = extra_minion_data_in_pillar.ext_pillar(
             "fake_id", self.pillar, include_all, self.extra_minion_data)
         self.assertEqual(ret, self.extra_minion_data)