20
20
from ardupilot_methodic_configurator .__main__ import (
21
21
ApplicationState ,
22
22
backup_fc_parameters ,
23
+ check_updates ,
23
24
component_editor ,
24
25
connect_to_fc_and_set_vehicle_type ,
25
26
create_and_configure_component_editor ,
29
30
open_firmware_documentation ,
30
31
parameter_editor_and_uploader ,
31
32
process_component_editor_results ,
32
- setup_logging_and_check_updates ,
33
33
should_open_firmware_documentation ,
34
34
vehicle_directory_selection ,
35
35
write_parameter_defaults_if_dirty ,
@@ -145,15 +145,13 @@ def test_user_can_start_application_with_updates_disabled(self, application_stat
145
145
application_state .args .skip_check_for_updates = True
146
146
147
147
with (
148
- patch ("ardupilot_methodic_configurator.__main__.logging_basicConfig" ) as mock_logging ,
149
148
patch ("ardupilot_methodic_configurator.__main__.check_for_software_updates" ) as mock_check ,
150
149
):
151
150
# Act: User starts application
152
- should_exit = setup_logging_and_check_updates (application_state )
151
+ should_exit = check_updates (application_state )
153
152
154
153
# Assert: Application continues normally
155
154
assert should_exit is False
156
- mock_logging .assert_called_once ()
157
155
mock_check .assert_not_called ()
158
156
159
157
def test_user_receives_update_notification_when_new_version_available (self , application_state : ApplicationState ) -> None :
@@ -170,14 +168,12 @@ def test_user_receives_update_notification_when_new_version_available(self, appl
170
168
with (
171
169
patch ("ardupilot_methodic_configurator.__main__.logging_basicConfig" ),
172
170
patch ("ardupilot_methodic_configurator.__main__.check_for_software_updates" , return_value = True ),
173
- patch ("ardupilot_methodic_configurator.__main__.logging_info" ) as mock_log ,
174
171
):
175
172
# Act: User starts outdated application
176
- should_exit = setup_logging_and_check_updates (application_state )
173
+ should_exit = check_updates (application_state )
177
174
178
175
# Assert: User informed and application exits
179
176
assert should_exit is True
180
- mock_log .assert_called_once ()
181
177
182
178
def test_user_proceeds_normally_when_application_is_current (self , application_state : ApplicationState ) -> None :
183
179
"""
@@ -191,11 +187,10 @@ def test_user_proceeds_normally_when_application_is_current(self, application_st
191
187
application_state .args .skip_check_for_updates = False
192
188
193
189
with (
194
- patch ("ardupilot_methodic_configurator.__main__.logging_basicConfig" ),
195
190
patch ("ardupilot_methodic_configurator.__main__.check_for_software_updates" , return_value = False ),
196
191
):
197
192
# Act: User starts current application
198
- should_exit = setup_logging_and_check_updates (application_state )
193
+ should_exit = check_updates (application_state )
199
194
200
195
# Assert: Application continues normally
201
196
assert should_exit is False
@@ -461,7 +456,6 @@ def test_user_can_complete_standard_startup_workflow(self, mock_args: MagicMock)
461
456
mock_args .skip_check_for_updates = True # Skip for test efficiency
462
457
463
458
with (
464
- patch ("ardupilot_methodic_configurator.__main__.logging_basicConfig" ),
465
459
patch ("ardupilot_methodic_configurator.__main__.ProgramSettings.get_setting" , return_value = False ),
466
460
patch ("ardupilot_methodic_configurator.__main__.connect_to_fc_and_set_vehicle_type" ) as mock_connect ,
467
461
patch ("ardupilot_methodic_configurator.__main__.FlightControllerInfoWindow" ),
@@ -479,7 +473,7 @@ def test_user_can_complete_standard_startup_workflow(self, mock_args: MagicMock)
479
473
# Act: Execute complete startup workflow
480
474
state = ApplicationState (mock_args )
481
475
482
- should_exit = setup_logging_and_check_updates (state )
476
+ should_exit = check_updates (state )
483
477
assert should_exit is False
484
478
485
479
display_first_use_documentation () # Should complete without issues
0 commit comments