@@ -117,6 +117,76 @@ def test_fin_flutter_analysis(flight_calisto_custom_wind):
117117 assert np .isclose (safety_factor (np .inf ), 61.669562809629035 , atol = 5e-3 )
118118
119119
120+ def test_fin_flutter_analysis_with_prints (flight_calisto_custom_wind ):
121+ """Test fin_flutter_analysis with see_prints=True to cover print branch.
122+
123+ Parameters
124+ ----------
125+ flight_calisto_custom_wind : Flight
126+ A Flight object with a rocket with fins.
127+ """
128+ flutter_mach , safety_factor = utilities .fin_flutter_analysis (
129+ fin_thickness = 2 / 1000 ,
130+ shear_modulus = 10e9 ,
131+ flight = flight_calisto_custom_wind ,
132+ see_prints = True ,
133+ see_graphs = False , # False = returns tuple!
134+ filename = None ,
135+ )
136+
137+ # Verify returns are valid
138+ assert flutter_mach is not None
139+ assert safety_factor is not None
140+
141+
142+ @patch ("matplotlib.pyplot.show" )
143+ def test_fin_flutter_analysis_with_graphs (mock_show , flight_calisto_custom_wind ): # pylint: disable=unused-argument
144+ """Test fin_flutter_analysis with see_graphs=True to cover plotting branch.
145+
146+ Parameters
147+ ----------
148+ mock_show : mock
149+ Mock of matplotlib.pyplot.show function.
150+ flight_calisto_custom_wind : Flight
151+ A Flight object with a rocket with fins.
152+ """
153+ result = utilities .fin_flutter_analysis (
154+ fin_thickness = 2 / 1000 ,
155+ shear_modulus = 10e9 ,
156+ flight = flight_calisto_custom_wind ,
157+ see_prints = False ,
158+ see_graphs = True , # True = returns None!
159+ filename = None ,
160+ )
161+
162+ assert result is None
163+ mock_show .assert_called ()
164+
165+
166+ @patch ("matplotlib.pyplot.show" )
167+ def test_fin_flutter_analysis_complete_output (mock_show , flight_calisto_custom_wind ): # pylint: disable=unused-argument
168+ """Test fin_flutter_analysis with both prints and graphs enabled.
169+
170+ Parameters
171+ ----------
172+ mock_show : mock
173+ Mock of matplotlib.pyplot.show function.
174+ flight_calisto_custom_wind : Flight
175+ A Flight object with a rocket with fins.
176+ """
177+ result = utilities .fin_flutter_analysis (
178+ fin_thickness = 2 / 1000 ,
179+ shear_modulus = 10e9 ,
180+ flight = flight_calisto_custom_wind ,
181+ see_prints = True ,
182+ see_graphs = True , # True = returns None!
183+ filename = None ,
184+ )
185+
186+ assert result is None
187+ mock_show .assert_called ()
188+
189+
120190def test_flutter_prints (flight_calisto_custom_wind ):
121191 """Tests the _flutter_prints function.
122192
0 commit comments