Skip to content

Commit 3ce4abe

Browse files
committed
include 4th response for SR,A,Auto in the check
1 parent b96489f commit 3ce4abe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compliance/check.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,13 @@ def get_command_by_value_and_number(cmd: str, number: int) -> Optional[str]:
262262
initial_amps = get_initial_range(1, msgs[2]["reply"])
263263
initial_volts = get_initial_range(3, msgs[2]["reply"])
264264

265-
initial_amps_command = get_command_by_value_and_number("SR,A", 3)
265+
# sometimes the SR,A,Auto comes from 3rd or 4th response
266+
initial_amps_command_3 = get_command_by_value_and_number("SR,A", 3)
267+
initial_amps_command_4 = get_command_by_value_and_number("SR,A", 4)
266268
initial_volts_command = get_command_by_value_and_number("SR,V", 3)
267-
268269
assert (
269-
initial_amps_command == f"SR,A,{initial_amps}"
270-
), f"Do not set Amps range as initial. Expected 'SR,A,{initial_amps}', got {initial_amps_command!r}."
270+
(initial_amps_command_3 == f"SR,A,{initial_amps}") or (initial_amps_command_4 == f"SR,A,{initial_amps}")
271+
), f"Do not set Amps range as initial. Expected 'SR,A,{initial_amps}', got {initial_amps_command_3!r} and {initial_amps_command_4!r}."
271272
assert (
272273
initial_volts_command == f"SR,V,{initial_volts}"
273274
), f"Do not set Volts range as initial. Expected 'SR,V,{initial_volts}', got {initial_volts_command!r}."

0 commit comments

Comments
 (0)