99from fprime_gds .common .data_types .ch_data import ChData
1010from fprime_gds .common .testing_fw .api import IntegrationTestAPI
1111
12+ ON = "ON"
13+ OFF = "OFF"
14+
1215loadswitch = "ReferenceDeployment.face0LoadSwitch"
1316
1417
@@ -33,7 +36,7 @@ def turn_off(fprime_test_api: IntegrationTestAPI):
3336 proves_send_and_assert_command (fprime_test_api , f"{ loadswitch } .TURN_OFF" )
3437
3538
36- def get_is_on (fprime_test_api : IntegrationTestAPI ) -> int :
39+ def get_is_on (fprime_test_api : IntegrationTestAPI ) -> str :
3740 """Helper function to request packet and get fresh IsOn telemetry"""
3841 proves_send_and_assert_command (
3942 fprime_test_api ,
@@ -49,7 +52,7 @@ def get_is_on(fprime_test_api: IntegrationTestAPI) -> int:
4952def test_01_loadswitch_telemetry_basic (fprime_test_api : IntegrationTestAPI , start_gds ):
5053 """Test that we can read IsOn telemetry"""
5154 value = get_is_on (fprime_test_api )
52- assert value in (0 , 1 ), f"IsOn should be 0 or 1 , got { value } "
55+ assert value in (ON , OFF ), f"IsOn should be { ON } or { OFF } , got { value } "
5356
5457
5558def test_02_turn_on_sets_high (fprime_test_api : IntegrationTestAPI , start_gds ):
@@ -65,7 +68,7 @@ def test_02_turn_on_sets_high(fprime_test_api: IntegrationTestAPI, start_gds):
6568
6669 # Confirm telemetry IsOn is 1
6770 value = get_is_on (fprime_test_api )
68- assert value == 1 , f"Expected IsOn = 1 after TURN_ON, got { value } "
71+ assert value == ON , f"Expected IsOn = { ON } after TURN_ON, got { value } "
6972
7073
7174def test_03_turn_off_sets_low (fprime_test_api : IntegrationTestAPI , start_gds ):
@@ -81,4 +84,4 @@ def test_03_turn_off_sets_low(fprime_test_api: IntegrationTestAPI, start_gds):
8184
8285 # Confirm telemetry IsOn is 0
8386 value = get_is_on (fprime_test_api )
84- assert value == 0 , f"Expected IsOn = 0 after TURN_OFF, got { value } "
87+ assert value == OFF , f"Expected IsOn = { OFF } after TURN_OFF, got { value } "
0 commit comments