Coverage for test_object_edit_windows.py: 88%
30 statements
« prev ^ index » next coverage.py v7.2.7, created at 2024-04-10 15:08 +0100
« prev ^ index » next coverage.py v7.2.7, created at 2024-04-10 15:08 +0100
1#-----------------------------------------------------------------------------------
2# System tests to check the basic display and function of all library object permutations
3#-----------------------------------------------------------------------------------
5from system_test_harness import *
7#-----------------------------------------------------------------------------------
8# Create and then edit/save all object types - to test default configuration is unchanged
9# Note that this test exercises all of the windows controls (CANCEL, RESET, APPLY, OK)
10#-----------------------------------------------------------------------------------
12def test_edit_object_windows(delay:float=0.0):
13 print("Testing all object edit windows")
14 # Create new default objects on the schematic
15 b1 = create_block_instrument()
16 select_and_move_objects(b1,500,200,delay=delay)
17 create_line()
18 create_colour_light_signal()
19 create_semaphore_signal()
20 create_ground_position_signal()
21 create_ground_disc_signal()
22 create_track_section()
23 create_left_hand_point()
24 create_right_hand_point()
25 create_textbox()
26 create_track_sensor()
27 # Test the configuration remains unchanged with Edit/Save
28 test_all_edit_object_windows(test_all_controls=True)
29 return()
31#-----------------------------------------------------------------------------------
32# System test to edit/save all schematic objects - to test configuration is unchanged
33# This does partially duplicate the above but we run it for all layout examples as well
34# IFor these tests we only exercise the OK Control
35#-----------------------------------------------------------------------------------
37def really_do_test_all_object_edit_windows(delay:float=0.0):
38 print("Testing all object edit windows")
39 test_all_edit_object_windows()
40 return()
42# This is the easy way to shorten the tests - miss out the object window tests
43def test_all_object_edit_windows(delay:float=0.0):
44 really_do_test_all_object_edit_windows(delay)
45 pass
47######################################################################################################
49def run_all_configuration_window_tests(delay:float=0.0, shutdown:bool=False):
50 initialise_test_harness()
51 test_edit_object_windows()
52 if shutdown: report_results()
54if __name__ == "__main__": 54 ↛ 55line 54 didn't jump to line 55, because the condition on line 54 was never true
55 start_application(lambda:run_all_configuration_window_tests(delay=0.0, shutdown=True))
57###############################################################################################################################