k1x-factorytest/tests/manual/test_03_fan.py
2024-04-30 17:48:07 +08:00

25 lines
643 B
Python

from unittest import TestCase
import subprocess
class FanTest(TestCase):
LANGUAGES = {
'zh': {
'FanTest': '风扇',
'test_speed': '开关'
},
'en': {
'FanTest': 'Fan',
'test_speed': 'On/Off',
'title': 'Fan'
}
}
def test_speed(self):
try:
gpio = 79
cmd = f'/opt/factorytest/utils/fan.sh {gpio}'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except:
self.fail('Create fan.sh subprocess failed')