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

25 lines
674 B
Python

from unittest import TestCase
import subprocess
class GPIOTest(TestCase):
LANGUAGES = {
'zh': {
'GPIOTest': 'GPIO',
'test_gpio': '开灯'
},
'en': {
'GPIOTest': 'GPIO',
'test_gpio': 'Turn on light'
}
}
def test_gpio(self):
try:
gpios = '47 48 49 50 51 52 70 71 72 73 74 75 76 77 78 90 91 92'
cmd = f'/opt/factorytest/utils/gpio.sh {gpios}'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except:
self.fail('Create gpio subprocess fail')