hitl_tester.test_cases.bms.test_thermo_couple

A simple test case to see if we can read any temperatures from the thermocouples.

Used in these test plans:

  • thermo_test ⠀⠀⠀(bms/thermo_test.plan)

Example Command (warning: test plan may run other test cases):

  • ./hitl_tester.py thermo_test -DSAMPLE_TIME=10
 1"""
 2A simple test case to see if we can read any temperatures from the thermocouples.
 3"""
 4
 5import time
 6import pytest
 7
 8from hitl_tester.modules.bms.bms_hw import BMSHardware
 9
10SAMPLE_TIME = 10
11
12bms_hardware = BMSHardware(pytest.flags)  # type: ignore[arg-type]
13bms_hardware.init()
14
15
16def test_thermo_couple():
17    """Check the thermocouples."""
18    start_time = time.perf_counter()
19    while True:
20        bms_hardware.csv.thermo.record(time.perf_counter() - start_time)
21        time.sleep(SAMPLE_TIME)
SAMPLE_TIME = 10
def test_thermo_couple():
17def test_thermo_couple():
18    """Check the thermocouples."""
19    start_time = time.perf_counter()
20    while True:
21        bms_hardware.csv.thermo.record(time.perf_counter() - start_time)
22        time.sleep(SAMPLE_TIME)

Check the thermocouples.