Ejemplo n.º 1
0
 def testRealScript(self):
     p = PythonScriptLauncher()
     params = {'data_file_full_path':'/net/serdon/illdata/131/in5/exp_TEST-2216/rawdata/104041.nxs'}
     p.sendCommand('/home/leal/git/reductionServer/src/query/scripts/ILL_IN5_theta_vs_counts.py', 30,params)
     res = p.getResult()
     print res
     self.assertIn("data_values", res)
Ejemplo n.º 2
0
 def testSendCommandWithParams(self):
     p = PythonScriptLauncher()
     params = {'toreplace' : 'REPLACED' }
     p.sendCommand(self.tmpfile3, 4,params)
     out = p.readOutput()
     print out
     self.assertIn("REPLACED", out)
Ejemplo n.º 3
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)
Ejemplo n.º 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')
Ejemplo n.º 5
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})