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)
예제 #5
0
    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)
예제 #6
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')
예제 #7
0
 def testSimple(self):
     self.proc = Popen(['python2.5', '-c', '"print"'], stdout=PIPE, stderr=PIPE)
     timer = ProcessTimer(self.proc, 10)
     timer.waitfor()