예제 #1
0
파일: test_process.py 프로젝트: jrgm/circus
 def test_base(self):
     cmd = "%s -c 'import time; time.sleep(2)'"
     process = Process('test', cmd % sys.executable, shell=True)
     try:
         info = process.info()
         self.assertEqual(process.pid, info['pid'])
         age = process.age()
         self.assertTrue(age > 0.)
         self.assertFalse(process.is_child(0))
     finally:
         process.stop()
예제 #2
0
 def test_base(self):
     cmd = sys.executable
     args = "-c 'import time; time.sleep(2)'"
     process = Process('test', cmd, args=args, shell=False)
     try:
         info = process.info()
         self.assertEqual(process.pid, info['pid'])
         age = process.age()
         self.assertTrue(age > 0.)
         self.assertFalse(process.is_child(0))
     finally:
         process.stop()
예제 #3
0
파일: test_process.py 프로젝트: jwal/circus
 def test_base(self):
     cmd = sys.executable
     args = "-c 'import time; time.sleep(2)'"
     process = Process("test", cmd, args=args, shell=False)
     try:
         info = process.info()
         self.assertEqual(process.pid, info["pid"])
         age = process.age()
         self.assertTrue(age > 0.0)
         self.assertFalse(process.is_child(0))
     finally:
         process.stop()
예제 #4
0
 def test_base(self):
     cmd = PYTHON
     args = "-c 'import time; time.sleep(10)'"
     process = Process('test', cmd, args=args, shell=False,
                       use_fds=USE_FDS)
     try:
         info = process.info()
         self.assertEqual(process.pid, info['pid'])
         # Make sure the process lived a measurable amount of time
         # (precision error on Windows)
         time.sleep(0.01)
         age = process.age()
         self.assertTrue(age > 0.)
         self.assertFalse(process.is_child(0))
     finally:
         process.stop()
예제 #5
0
 def test_base(self):
     cmd = PYTHON
     args = "-c 'import time; time.sleep(10)'"
     process = Process('test', 1, cmd, args=args, shell=False,
                       use_fds=USE_FDS)
     try:
         info = process.info()
         self.assertEqual(process.pid, info['pid'])
         # Make sure the process lived a measurable amount of time
         # (precision error on Windows)
         time.sleep(0.01)
         age = process.age()
         self.assertTrue(age > 0.)
         self.assertFalse(process.is_child(0))
     finally:
         process.stop()