diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-06-25 11:45:31 +0200 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-06-25 11:45:31 +0200 |
commit | db3b1e45c47a1ef23c1ad67114a09cbec0976681 (patch) | |
tree | 6833ba2e59be77f9e818823068570ca3d51959cc /test-cli/test/tests/qaudio.py | |
parent | 278b5729a44837e37fe13611518c1babc8de00df (diff) | |
download | board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.zip board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.gz board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.bz2 |
Solved bugs. Adapted to DB changes.
Diffstat (limited to 'test-cli/test/tests/qaudio.py')
-rw-r--r-- | test-cli/test/tests/qaudio.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/test-cli/test/tests/qaudio.py b/test-cli/test/tests/qaudio.py deleted file mode 100644 index ef4da67..0000000 --- a/test-cli/test/tests/qaudio.py +++ /dev/null @@ -1,39 +0,0 @@ -from test.helpers.syscmd import SysCommand -import unittest - - -class Qaudio(unittest.TestCase): - params = None - - def __init__(self, testname, testfunc, varlist): - self.params = varlist - super(Qaudio, self).__init__(testfunc) - self._testMethodDoc = testname - if "dtmfFile" in varlist: - self._dtmfFile = varlist["dtmfFile"] - else: - raise Exception('undercurrent param inside Qamp must be defined') - self.__sum = 0 - self.__refSum = 25 # 1+3+5+7+9 - - def execute(self): - str_cmd = "aplay test/files/dtmf-13579.wav & arecord -r 8000 -d 1 recorded.wav" # .format(self.__dtmfFile) - audio_loop = SysCommand("command-name", str_cmd) - if audio_loop.execute() == -1: # BUG: Returns -1 but work - lines = audio_loop.getOutput().splitlines() - str_cmd = "multimon -t wav -a DTMF recorded.wav -q" - dtmf_decoder = SysCommand("command-name", str_cmd) - a = dtmf_decoder.execute() - if dtmf_decoder.execute() == -1: # BUG: Returns -1 but work - self.__raw_out = dtmf_decoder.getOutput() - if self.__raw_out == "": - self.fail("failed: can not execute multimon command") - lines = dtmf_decoder.getOutput().splitlines() - for i in range(0, 5): - aux = [int(s) for s in lines[i].split() if s.isdigit()] - self.__sum = self.__sum + aux[0] - self.failUnless(self.__sum == self.__refSum), "failed: incorrect dtmf code" + str(self.__sum) - else: - self.fail("failed: fail reading recorded file") - else: - self.fail("failed: fail playing/recording file") |