test.sip vervangen door io.StringIO file

This commit is contained in:
Marcel Nijenhof
2021-07-25 15:49:41 +02:00
parent 8e85c8ab3a
commit 0b201743ba
2 changed files with 5 additions and 6 deletions

View File

@@ -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)

View File

@@ -1,3 +0,0 @@
LI USER,PASS
TI LMW
LO