summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers/syscmd.py
diff options
context:
space:
mode:
authorManel Caro <mcaro@iseebcn.com>2020-03-04 17:46:36 +0100
committerManel Caro <mcaro@iseebcn.com>2020-03-04 17:46:36 +0100
commit09de774dcc1a5abc1c8f3a00fdb039aa3c522f52 (patch)
treec4bd3963d0df01d2e3a33732247388ed4651b186 /test-cli/test/helpers/syscmd.py
parentb6932fbaf898724ae87c29f8965621610f377084 (diff)
downloadboard-09de774dcc1a5abc1c8f3a00fdb039aa3c522f52.zip
board-09de774dcc1a5abc1c8f3a00fdb039aa3c522f52.tar.gz
board-09de774dcc1a5abc1c8f3a00fdb039aa3c522f52.tar.bz2
SOPA Initial Commit
Diffstat (limited to 'test-cli/test/helpers/syscmd.py')
-rw-r--r--test-cli/test/helpers/syscmd.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/test-cli/test/helpers/syscmd.py b/test-cli/test/helpers/syscmd.py
index b579e39..a869bd7 100644
--- a/test-cli/test/helpers/syscmd.py
+++ b/test-cli/test/helpers/syscmd.py
@@ -10,15 +10,24 @@ class TestSysCommand(unittest.TestCase):
__outdata = None
__outtofile = False
- def __init__(self, testname, testfunc, str_cmd, outtofile = False):
+ #varlist: str_cmd, outtofile
+ def __init__(self, testname, testfunc, varlist):
""" init """
super(TestSysCommand, self).__init__(testfunc)
- self.__str_cmd = str_cmd
+ if "str_cmd" in varlist:
+ self.__str_cmd = varlist["str_cmd"]
+ else:
+ raise Exception('str_cmd param inside TestSysCommand have been be defined')
self.__testname = testname
- self.__outtofile = outtofile
+ if "outtofile" in varlist:
+ self.__outtofile = varlist["outtofile"]
+ if self.__outtofile is True:
+ self.__outfilename = '/tmp/{}.txt'.format(testname)
+ else:
+ self.__outtofile = None
+ self.__outfilename = None
self._testMethodDoc = testname
- if self.__outtofile is True:
- self.__outfilename = '/tmp/{}.txt'.format(testname)
+
def getName(self):
return self.__testname