diff --git a/lmwsip/tests/__init__.py b/lmwsip/tests/__init__.py index 5979063..b35f4aa 100755 --- a/lmwsip/tests/__init__.py +++ b/lmwsip/tests/__init__.py @@ -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) diff --git a/lmwsip/tests/test.sip b/lmwsip/tests/test.sip deleted file mode 100644 index 2a4cfe9..0000000 --- a/lmwsip/tests/test.sip +++ /dev/null @@ -1,3 +0,0 @@ -LI USER,PASS -TI LMW -LO