summaryrefslogtreecommitdiff
path: root/scripts/PYTHON_SOFTWARE/test/tests/qserial.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/PYTHON_SOFTWARE/test/tests/qserial.py')
-rw-r--r--scripts/PYTHON_SOFTWARE/test/tests/qserial.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/scripts/PYTHON_SOFTWARE/test/tests/qserial.py b/scripts/PYTHON_SOFTWARE/test/tests/qserial.py
deleted file mode 100644
index 43ba3c8..0000000
--- a/scripts/PYTHON_SOFTWARE/test/tests/qserial.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from test.helpers.syscmd import SysCommand
-import unittest
-import uuid
-import serial
-import time
-
-class Qserial(unittest.TestCase):
-
- def __init__(self, testname, testfunc, port, baudrate):
- super(Qserial, self).__init__(testfunc)
- self.__port = port
- self.__serial = serial.Serial(self.__port, timeout=1)
- self.__serial.baudrate = baudrate
- self._testMethodDoc = testname
-
- def __del__(self):
- self.__serial.close()
-
- def execute(self):
- self.__serial.flushInput()
- self.__serial.flushOutput()
- test_uuid = str(uuid.uuid4()).encode()
- self.__serial.write(test_uuid)
- time.sleep(0.05) # there might be a small delay
- if self.__serial.inWaiting() == 0:
- self.fail("failed: PORT {} wait timeout exceded, wrong communication?".format(self.__port))
- else:
- if (self.__serial.readline() != test_uuid):
- self.fail("failed: PORT {} write/read mismatch".format(self.__port))
-