test.sip vervangen door io.StringIO file
This commit is contained in:
@@ -133,8 +133,10 @@ class lmwsipTest(unittest.TestCase):
|
||||
self.assertEqual(type(lmwsip.__version__), str)
|
||||
|
||||
def test_run(self):
|
||||
capturedOutput = io.StringIO()
|
||||
sys.stdout = capturedOutput
|
||||
capturedOutput = io.StringIO()
|
||||
sys.stdout = capturedOutput
|
||||
testSipFile = io.StringIO("LI USER,PASS\rTI LMW\rLO")
|
||||
testSipFile.seek(0)
|
||||
args = myTestArgs()
|
||||
args.debug = "DEBUG"
|
||||
args.host = "localhost"
|
||||
@@ -144,7 +146,7 @@ class lmwsipTest(unittest.TestCase):
|
||||
args.cleartelnet = False
|
||||
args.time = "+00:59"
|
||||
args.date = "2020-01-01"
|
||||
args.files = [open("lmwsip/tests/test.sip")]
|
||||
args.files = [testSipFile]
|
||||
run(args)
|
||||
args.files[0].close()
|
||||
self.assertEqual(capturedOutput.getvalue().find("!")>= 0, True)
|
||||
|
@@ -1,3 +0,0 @@
|
||||
LI USER,PASS
|
||||
TI LMW
|
||||
LO
|
Reference in New Issue
Block a user