summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers/syscmd.py
diff options
context:
space:
mode:
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