mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added key sorting to have deterministing string repr of RecursiveDictDiffer objects
This commit is contained in:
parent
2d2f094810
commit
cdb028b794
2 changed files with 2 additions and 2 deletions
|
@ -217,7 +217,7 @@ class RecursiveDictDiffer(DictDiffer):
|
|||
Each inner difference is tabulated two space deeper
|
||||
'''
|
||||
changes_strings = []
|
||||
for p in diff_dict.keys():
|
||||
for p in sorted(diff_dict.keys()):
|
||||
if sorted(diff_dict[p].keys()) == ['new', 'old']:
|
||||
# Some string formatting
|
||||
old_value = diff_dict[p]['old']
|
||||
|
|
|
@ -89,7 +89,7 @@ class RecursiveDictDifferTestCase(TestCase):
|
|||
'a:\n'
|
||||
' c from 2 to 4\n'
|
||||
' e from \'old_value\' to \'new_value\'\n'
|
||||
' g from nothing to \'new_key\'\n'
|
||||
' f from \'old_key\' to nothing\n'
|
||||
' g from nothing to \'new_key\'\n'
|
||||
'h from nothing to \'new_key\'\n'
|
||||
'i from nothing to None')
|
||||
|
|
Loading…
Add table
Reference in a new issue