From b16ac875a2e569d78e50c69ef38792215af5054a Mon Sep 17 00:00:00 2001 From: Giovani Hidalgo Ceotto Date: Tue, 21 Nov 2023 01:15:43 -0300 Subject: [PATCH] TST: fixes test that checks coordinate systems --- tests/test_rocket.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/test_rocket.py b/tests/test_rocket.py index 160ab9aa4..3d257a6d8 100644 --- a/tests/test_rocket.py +++ b/tests/test_rocket.py @@ -51,7 +51,7 @@ def test_coordinate_system_orientation( burn_time=3.9, dry_mass=1.815, dry_inertia=(0.125, 0.125, 0.002), - center_of_dry_mass_position=0.317, + center_of_dry_mass_position=-0.317, nozzle_position=0, grain_number=5, grain_density=1815, @@ -60,7 +60,7 @@ def test_coordinate_system_orientation( grain_separation=5 / 1000, grain_outer_radius=33 / 1000, grain_initial_height=120 / 1000, - grains_center_of_mass_position=0.397, + grains_center_of_mass_position=-0.397, grain_initial_inner_radius=15 / 1000, interpolation_method="linear", coordinate_system_orientation="combustion_chamber_to_nozzle", @@ -81,7 +81,7 @@ def test_coordinate_system_orientation( rocket_tail_to_nose.aerodynamic_surfaces.add(calisto_nose_cone, 1.160) rocket_tail_to_nose.aerodynamic_surfaces.add(calisto_trapezoidal_fins, -1.168) - static_margin_tail_to_nose = rocket_tail_to_nose.static_margin(0) + static_margin_tail_to_nose = rocket_tail_to_nose.static_margin rocket_nose_to_tail = Rocket( radius=0.0635, @@ -98,13 +98,9 @@ def test_coordinate_system_orientation( rocket_nose_to_tail.aerodynamic_surfaces.add(calisto_nose_cone, -1.160) rocket_nose_to_tail.aerodynamic_surfaces.add(calisto_trapezoidal_fins, 1.168) - static_margin_nose_to_tail = rocket_nose_to_tail.static_margin(0) + static_margin_nose_to_tail = rocket_nose_to_tail.static_margin - assert ( - rocket_tail_to_nose.all_info() == None - or rocket_nose_to_tail.all_info() == None - or not abs(static_margin_tail_to_nose - static_margin_nose_to_tail) < 0.0001 - ) + assert np.array_equal(static_margin_tail_to_nose, static_margin_nose_to_tail) @patch("matplotlib.pyplot.show")