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