Exemplo n.º 1
0
    def test_kill_and_run_process_by_name(self):
        warnings.simplefilter('ignore', ResourceWarning)
        WindowsOsUtil.run_process_by_name(self.processToTestRunAndKill)
        self.assertTrue(WindowsOsUtil.check_process_running(self.processToTestRunAndKill))

        WindowsOsUtil.kill_process_by_name(self.processToTestRunAndKill)
        self.assertFalse(WindowsOsUtil.check_process_running(self.processToTestRunAndKill))
    def test_kill_and_run_process_by_name(self):
        WindowsOsUtil.run_process_by_name(self.processToTestRunAndKill)
        assert WindowsOsUtil.check_process_running(
            self.processToTestRunAndKill)

        WindowsOsUtil.kill_process_by_name(self.processToTestRunAndKill)
        assert not WindowsOsUtil.check_process_running(
            self.processToTestRunAndKill)
 def setup_params(self):
     self.processIsRunning = 'python.exe'
     self.processNotRunning = 'retroarch.exe'
     self.processToTestRunAndKill = 'notepad.exe'
     self.command = 'echo 123'
     yield
     if WindowsOsUtil.check_process_running(self.processToTestRunAndKill):
         WindowsOsUtil.kill_process_by_name(self.processToTestRunAndKill)
Exemplo n.º 4
0
 def test_check_process_running(self):
     with self.subTest():
         self.assertTrue(WindowsOsUtil.check_process_running(self.processIsRunning))
     with self.subTest():
         self.assertFalse(WindowsOsUtil.check_process_running(self.processNotRunning))
Exemplo n.º 5
0
 def tearDownClass(cls):
     if WindowsOsUtil.check_process_running(cls.processToTestRunAndKill):
         WindowsOsUtil.kill_process_by_name(cls.processToTestRunAndKill)
 def test_check_process_running(self):
     assert WindowsOsUtil.check_process_running(self.processIsRunning)
     assert not WindowsOsUtil.check_process_running(self.processNotRunning)