Exemplo n.º 1
0
 def test_driver_setup_and_teardown(self, Popen, call):
     Popen.return_value = 1
     dl = DesktopLibrary()
     dl.driver_setup()
     self.assertTrue(dl.winappdriver.process)
     dl.driver_teardown()
     self.assertFalse(dl.winappdriver.process)
Exemplo n.º 2
0
 def test_driver_child_process_teardown(self):
     mock_child = MagicMock()
     dl = DesktopLibrary()
     dl.winappdriver.process = MagicMock()
     dl.winappdriver.process.pid = 1
     psutil.Process.create_time = MagicMock()
     psutil.Process.children = MagicMock(return_value=[mock_child])
     self.assertFalse(dl.winappdriver.process is None)
     dl.driver_teardown()
     self.assertTrue(dl.winappdriver.process is None)
Exemplo n.º 3
0
 def test_teardown_without_setup(self, call):
     dl = DesktopLibrary()
     dl.driver_teardown()
     self.assertFalse(dl.winappdriver.process)