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'}})
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" }, }, )
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)
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)