Test if a process is running
This commit is contained in:
parent
1d32eeb24a
commit
31b1bc957c
1 changed files with 11 additions and 0 deletions
|
@ -33,3 +33,14 @@ class TerminateProcessesTestCase(BaseTestCase):
|
||||||
self.assertIsNone(still_alive)
|
self.assertIsNone(still_alive)
|
||||||
for proc in created_processes:
|
for proc in created_processes:
|
||||||
self.assertEqual(proc.poll(), 0)
|
self.assertEqual(proc.poll(), 0)
|
||||||
|
|
||||||
|
|
||||||
|
class RunningProcessTestCase(BaseTestCase):
|
||||||
|
def test_current_process_running(self):
|
||||||
|
self.assertTrue(processes.is_process_running(os.getpid()))
|
||||||
|
|
||||||
|
def test_root_process_running(self):
|
||||||
|
self.assertTrue(processes.is_process_running(processes.get_root_process().pid))
|
||||||
|
|
||||||
|
def test_impossible_running_process(self):
|
||||||
|
self.assertFalse(processes.is_process_running(2938420983094892))
|
||||||
|
|
Reference in a new issue