From b27edc3c902dfdd8edc89578ea06feb198c0448b Mon Sep 17 00:00:00 2001 From: MateusStano Date: Wed, 29 Nov 2023 19:01:32 +0100 Subject: [PATCH] TST: add test --- tests/test_utilities.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_utilities.py b/tests/test_utilities.py index 577a8aaa7..aeb374db6 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -161,3 +161,16 @@ def test_fin_flutter_analysis(mock_show, flight): ) == None ) + + +def test_get_instance_attributes(flight_calisto_robust): + """Tests if get_instance_attributes returns the expected results for a + robust flight object.""" + + attributes = utilities.get_instance_attributes(flight_calisto_robust) + for key, value in attributes.items(): + attr = getattr(flight_calisto_robust, key) + if isinstance(attr, np.ndarray): + assert np.allclose(attr, value) + else: + assert attr == value