From c437c9ebcb4d279c0f55f46ddc6aed3be3ae5b65 Mon Sep 17 00:00:00 2001 From: Pedro Bressan Date: Tue, 3 Oct 2023 10:34:10 -0300 Subject: [PATCH] DOC: write docstring for the add motor test. --- tests/test_rocket.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/test_rocket.py b/tests/test_rocket.py index d370379a1..c636f5acc 100644 --- a/tests/test_rocket.py +++ b/tests/test_rocket.py @@ -400,6 +400,37 @@ def test_add_motor_coordinates( expected_motor_cdm, expected_motor_cpp, ): + """Test the method add_motor and related position properties in a Rocket + instance. + + This test checks the correctness of the `add_motor` method and the computed + `motor_center_of_dry_mass_position` and `center_of_propellant_position` + properties in the `Rocket` class using various parameters related to the + motor's position, nozzle's position, and other related coordinates. + Different scenarios are tested using parameterization, checking scenarios + moving from the nozzle to the combustion chamber and vice versa, and with + various specific physical and geometrical characteristics of the motor. + + Parameters + ---------- + calisto_motorless : Rocket instance + A predefined instance of a Rocket without a motor, used as a base for testing. + cdm_position : float + Position of the center of dry mass of the motor. + grain_cm_position : float + Position of the grains' center of mass. + nozzle_position : float + Position of the nozzle. + coord_direction : str + Direction for coordinate system orientation; + it can be "nozzle_to_combustion_chamber" or "combustion_chamber_to_nozzle". + motor_position : float + Position where the motor should be added to the rocket. + expected_motor_cdm : float + Expected position of the motor's center of dry mass after addition. + expected_motor_cpp : float + Expected position of the center of propellant after addition. + """ example_motor = SolidMotor( thrust_source="data/motors/Cesaroni_M1670.eng", burn_time=3.9,