Skip to content

Commit df3a680

Browse files
committed
Add tests for thermal commands
1 parent f6a41df commit df3a680

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

cros_ec_python/commands/thermal.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
from ..cros_ec import CrOS_EC
44
from ..constants.COMMON import *
55

6-
76
EC_CMD_THERMAL_SET_THRESHOLD: Final = 0x0050
87
EC_CMD_THERMAL_GET_THRESHOLD: Final = 0x0051
98

10-
119
EC_CMD_THERMAL_AUTO_FAN_CTRL: Final = 0x0052
1210

1311

@@ -26,6 +24,4 @@ def thermal_auto_fan_ctrl(ec: CrOS_EC, fan_idx: UInt8 | None = None) -> None:
2624

2725
EC_CMD_TMP006_GET_CALIBRATION: Final = 0x0053
2826
EC_CMD_TMP006_SET_CALIBRATION: Final = 0x0054
29-
30-
3127
EC_CMD_TMP006_GET_RAW: Final = 0x0055

tests/tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import unittest
22
from general import *
33
from features import *
4+
# These have some user input, uncomment if you're human.
5+
# from pwm import *
6+
# from leds import *
7+
from thermal import *
48

59

610
if __name__ == '__main__':

tests/thermal.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import unittest
2+
from cros_ec_python import CrOS_EC, thermal as ec_thermal
3+
4+
ec = CrOS_EC()
5+
6+
7+
class TestAutoFanControl(unittest.TestCase):
8+
def test_version0(self):
9+
ec_thermal.thermal_auto_fan_ctrl(ec)
10+
11+
def test_version1(self):
12+
ec_thermal.thermal_auto_fan_ctrl(ec, 0)
13+
14+
15+
if __name__ == '__main__':
16+
unittest.main()

0 commit comments

Comments
 (0)