From cc7716a2b7bf99d30c4781402bab349860fa596e Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 9 Sep 2024 16:05:02 +0200 Subject: [PATCH] [minor] improved unittest result --- tests/test_autopickstation/test_autopickstation.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_autopickstation/test_autopickstation.py b/tests/test_autopickstation/test_autopickstation.py index f861c3f3..4efd5c86 100644 --- a/tests/test_autopickstation/test_autopickstation.py +++ b/tests/test_autopickstation/test_autopickstation.py @@ -272,7 +272,8 @@ class TestAutopickStation(unittest.TestCase): with HidePrints(): result, station = autopickstation(wfstream=wfstream, pickparam=self.pickparam_taupy_disabled, metadata=(None, None)) - compare_dicts(result, expected) + compare_dicts(result=result['P'], expected=expected['P']) + compare_dicts(result=result['S'], expected=expected['S']) self.assertEqual('GRA1', station) def test_autopickstation_a106_taupy_enabled(self): @@ -290,7 +291,8 @@ class TestAutopickStation(unittest.TestCase): with HidePrints(): result, station = autopickstation(wfstream=self.a106, pickparam=self.pickparam_taupy_enabled, metadata=self.metadata, origin=self.origin) - compare_dicts(result=result, expected=expected) + compare_dicts(result=result['P'], expected=expected['P']) + compare_dicts(result=result['S'], expected=expected['S']) def test_autopickstation_station_missing_in_metadata(self): @@ -312,7 +314,8 @@ class TestAutopickStation(unittest.TestCase): with HidePrints(): result, station = autopickstation(wfstream=self.a005a, pickparam=self.pickparam_taupy_enabled, metadata=self.metadata, origin=self.origin) - compare_dicts(result, expected) + compare_dicts(result=result['P'], expected=expected['P']) + compare_dicts(result=result['S'], expected=expected['S']) def run_dict_comparison(result, expected): @@ -332,8 +335,8 @@ def compare_dicts(result, expected): run_dict_comparison(result, expected) except AssertionError: raise AssertionError(f'Dictionaries not equal.' - f'\n<>: \n\n{pretty_print_dict(expected)}' - f'\n<>: \n{pretty_print_dict(result)}') + f'\n\n<>\n{pretty_print_dict(expected)}' + f'\n\n<>\n{pretty_print_dict(result)}') def pretty_print_dict(dct):