这是我正在测试的函数的定义:
def runCMD(cmd,subString=-1,stripSlashes=True,getReturnCode=False):
这是我的测试课
import unittest
from class_backups import *
class tests_backups(unittest.TestCase):
def test_runCMD(self):
cLInstance = class_backups()
assert(cLInstance.runCMD("ls",-1,True,True)==0)
# When this module is executed from the command-line, run all its tests
unittest.main()
这是我的错误:
E
======================================================================
ERROR: test_runCMD (__main__.tests_backups)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests_backups.py", line 11, in test_runCMD
assert(cLInstance.runCMD("ls",-1,True,True)==0)
TypeError: runCMD() takes at most 4 arguments (5 given)
----------------------------------------------------------------------
Ran 1 tests in 0.000s
FAILED (errors=1)
我究竟做错了什么?是否有隐含的第五个论点?是自己吗?