Skip to content

Commit bcfbae8

Browse files
committed
checking a differnt conversion for the tests
1 parent 583a7a4 commit bcfbae8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

FprimeZephyrReference/test/int/load_switch_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from fprime_gds.common.data_types.ch_data import ChData
1010
from fprime_gds.common.testing_fw.api import IntegrationTestAPI
1111

12+
ON = "ON"
13+
OFF = "OFF"
14+
1215
loadswitch = "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:
4952
def 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

5558
def 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

7174
def 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

Comments
 (0)