diff --git a/scripts/tests/test_translate_model.py b/scripts/tests/test_translate_model.py index 1c35f5f3..24b20040 100644 --- a/scripts/tests/test_translate_model.py +++ b/scripts/tests/test_translate_model.py @@ -53,7 +53,9 @@ def test_broken_input2(self) -> None: class TestTranslateICU(unittest.TestCase): def test_standard(self) -> None: - model = {'a': {'x': 12, 'y': 88}, 'b': {'x': 47, 'z': 13}} + model = {} + model['b'] = {'x': 47, 'z': 13} + model['a'] = {'x': 12, 'y': 88} expect = ''' jaml { aKeys { diff --git a/scripts/translate_model.py b/scripts/translate_model.py index 525b24a3..e37b1c94 100644 --- a/scripts/translate_model.py +++ b/scripts/translate_model.py @@ -44,7 +44,7 @@ def translate_icu(model: typing.Dict[str, typing.Dict[str, int]]) -> str: """ indent = ' ' output = 'jaml {\n' - for group_name, members in model.items(): + for group_name, members in sorted(model.items()): output += f'{indent}{group_name}Keys {{\n' for key in members.keys(): output += f'{indent}{indent}"{key}",\n'