def testSimple(self): self.proc = Popen(['python2.5', '-c', 'print 1'], stdout=PIPE, stderr=PIPE) timer = ProcessTimer(self.proc, 10) timer.waitfor() self.assertEqual(self.proc.poll(), 0)
def testOutput(self): self.proc = Popen([ 'python2.5', '-c', 'print 1', ], stdout=PIPE, stderr=PIPE) timer = ProcessTimer(self.proc, 1) timer.waitfor() self.assertEqual(self.proc.stdout.read().strip(), '1')
def testSimple(self): self.proc = Popen(['python2.5', '-c', '"print"'], stdout=PIPE, stderr=PIPE) timer = ProcessTimer(self.proc, 10) timer.waitfor()
def testRaise(self): self.proc = Popen(['python2.5', '-c', 'while True: pass'], stdout=PIPE, stderr=PIPE) timer = ProcessTimer(self.proc, 1) self.assertRaises(TimeoutException, timer.waitfor)
def testOutput(self): self.proc = Popen(['python2.5', '-c', 'print 1',], stdout=PIPE, stderr=PIPE) timer = ProcessTimer(self.proc, 1) timer.waitfor() self.assertEqual(self.proc.stdout.read().strip(), '1')