From 9c40a0e9a9f1469f0abd5c58a15481ba2b246cfc Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Tue, 3 Dec 2024 10:27:51 +0100 Subject: [PATCH] fix: sorting of nested list in printing modified objects --- otterdog/operations/__init__.py | 4 ++-- tests/operations/test_operation.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/otterdog/operations/__init__.py b/otterdog/operations/__init__.py index 023f954..74ecd96 100644 --- a/otterdog/operations/__init__.py +++ b/otterdog/operations/__init__.py @@ -280,8 +280,8 @@ def _print_modified_dict_internal( def _print_modified_list_internal(self, current_value, expected_value, prefix: str, color: str) -> None: from difflib import SequenceMatcher - a = sorted([str(x) for x in current_value]) - b = sorted([str(x) for x in expected_value]) + a = sorted(current_value) + b = sorted(expected_value) max_length_a = max((len(str(x)) for x in a), default=0) max_length_b = max((len(str(x)) for x in b), default=0) diff --git a/tests/operations/test_operation.py b/tests/operations/test_operation.py index 313be7a..159e4cd 100644 --- a/tests/operations/test_operation.py +++ b/tests/operations/test_operation.py @@ -62,7 +62,7 @@ def test_print_modified_dict(self, test_input, expected: str): operation.print_modified_dict(test_input, "", False) - assert expected == _strip_string(output.getvalue()) + assert _strip_string(output.getvalue()) == expected def _strip_string(input_string: str) -> str: