diff options
Diffstat (limited to 'test-cli')
-rw-r--r-- | test-cli/.idea/workspace.xml | 5 | ||||
-rw-r--r-- | test-cli/test/tests/qaudio.py | 7 | ||||
-rw-r--r-- | test-cli/test/tests/qusbdual.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/test-cli/.idea/workspace.xml b/test-cli/.idea/workspace.xml index edde041..4e10f5c 100644 --- a/test-cli/.idea/workspace.xml +++ b/test-cli/.idea/workspace.xml @@ -3,11 +3,8 @@ <component name="ChangeListManager"> <list default="true" id="4991a6e0-1b9d-4824-9b6e-5ac031eb4816" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/test/helpers/qrreader.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/helpers/qrreader.py" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/test/tests/qdmesg.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qdmesg.py" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/test/tests/qusb.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qusb.py" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/test/tests/qaudio.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qaudio.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/test/tests/qusbdual.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qusbdual.py" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/test_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/test_main.py" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> diff --git a/test-cli/test/tests/qaudio.py b/test-cli/test/tests/qaudio.py index acad4a9..f7ae33c 100644 --- a/test-cli/test/tests/qaudio.py +++ b/test-cli/test/tests/qaudio.py @@ -2,6 +2,7 @@ import unittest import sh import wave import contextlib +import time def calc_audio_duration(fname): @@ -27,6 +28,8 @@ class Qaudio(unittest.TestCase): def execute(self): # analize audio file recordtime = calc_audio_duration("/var/lib/hwtest-files/dtmf-13579.wav") + 0.15 + # wait time before playing + time.sleep(1) # play and record p1 = sh.aplay("/var/lib/hwtest-files/dtmf-13579.wav", _bg=True) p2 = sh.arecord("-r", 8000, "-d", recordtime, "/tmp/station/recorded.wav", _bg=True) @@ -42,8 +45,8 @@ class Qaudio(unittest.TestCase): self.__dtmf_secuence_result.append(li.split(" ")[1]) # compare original and processed dtmf sequence if len(self.__dtmf_secuence) == len(self.__dtmf_secuence_result): - for i in range(len(self.__dtmf_secuence)): - if self.__dtmf_secuence[i] != self.__dtmf_secuence_result[i]: + for a, b in zip(self.__dtmf_secuence, self.__dtmf_secuence_result): + if a != b: self.fail("failed: sent and received DTMF sequence don't match.") else: self.fail("failed: received DTMF sequence is shorter than expected.") diff --git a/test-cli/test/tests/qusbdual.py b/test-cli/test/tests/qusbdual.py index ad95b84..842d514 100644 --- a/test-cli/test/tests/qusbdual.py +++ b/test-cli/test/tests/qusbdual.py @@ -60,7 +60,7 @@ class Qusbdual(unittest.TestCase): self.fail("failed: Unable to calculate MD5 of the copied file.") newmd5 = p.stdout.decode().split(" ")[0] with open('/tmp/station/hdd_gadget/usb-test.bin.md5', 'r') as outfile: - oldmd5 = outfile.read() + oldmd5 = outfile.read().rstrip("\n") outfile.close() if newmd5 != oldmd5: sh.umount("/tmp/station/hdd_gadget") |