mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
module grains tests: test list order preservation
This commit is contained in:
parent
c40e5d8d12
commit
7b9451451f
@ -447,12 +447,12 @@ class GrainsModuleTestCase(TestCase):
|
|||||||
'c': 8})
|
'c': 8})
|
||||||
|
|
||||||
def test_set_nested_list_replace_key(self):
|
def test_set_nested_list_replace_key(self):
|
||||||
grainsmod.__grains__ = {'a': 'aval', 'b': ['l1', 'l2'], 'c': 8}
|
grainsmod.__grains__ = {'a': 'aval', 'b': ['l1', 'l2', 'l3'], 'c': 8}
|
||||||
res = grainsmod.set('b,l2', 'val2', delimiter=',')
|
res = grainsmod.set('b,l2', 'val2', delimiter=',')
|
||||||
self.assertTrue(res['result'])
|
self.assertTrue(res['result'])
|
||||||
self.assertEqual(res['changes'], {'b': ['l1', {'l2': 'val2'}]})
|
self.assertEqual(res['changes'], {'b': ['l1', {'l2': 'val2'}, 'l3']})
|
||||||
self.assertEqual(grainsmod.__grains__, {'a': 'aval',
|
self.assertEqual(grainsmod.__grains__, {'a': 'aval',
|
||||||
'b': ['l1', {'l2': 'val2'}],
|
'b': ['l1', {'l2': 'val2'}, 'l3'],
|
||||||
'c': 8})
|
'c': 8})
|
||||||
|
|
||||||
def test_set_nested_list_update_dict_key(self):
|
def test_set_nested_list_update_dict_key(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user