コード例 #1
0
 def testSendCommandWithParams(self):
     p = PythonScriptLauncher()
     params = {'toreplace' : 'REPLACED' }
     p.sendCommand(self.tmpfile3, 4,params)
     out = p.readOutput()
     print out
     self.assertIn("REPLACED", out)
コード例 #2
0
 def testRunFailTimeOut(self):
     p = PythonScriptLauncher()
     p.sendCommand(self.tmpfile, 0.1)
     
     self.assertFalse(p.globalVariables.has_key('a'))
     self.assertEqual(p.localVariables['a'],1)
     self.assertFalse(p.localVariables.has_key('b'))
     
     out = p.readOutput()
     self.assertEqual(out,None)
コード例 #3
0
 def testInputOutputParams(self):
     p = PythonScriptLauncher()
     params = {'param1' : 1234, 'param2' : 5678 }
     p.setInputParameters(params)
     p.sendCommand(self.tmpfile2, 4)
     out = p.readOutput()
     print out
     self.assertIn("{'param2': 5678, 'param1': 1234}", out)
     res = p.getResult()
     self.assertEqual(res,{'out' : 1234})
コード例 #4
0
 def testRunSuccess(self):
     p = PythonScriptLauncher()
     p.sendCommand(self.tmpfile, 4)
     
     self.assertFalse(p.globalVariables.has_key('a'))
     self.assertEqual(p.localVariables['a'],1)
     self.assertEqual(p.localVariables['b'],2)
     
     out = p.readOutput()
     self.assertEqual(out,'Starting...\nFinishing...\n')