def test_run_application(self): """ Tests running an application """ self.tetris.execute() import time time.sleep(5) import application_running app = application_running.getAppRunning() self.assertNotEqual(app, None) self.assertEqual(app.poll(), None)
def test_terminate_application(self): """ Kills the running application (if none runnig, it starts it) """ import application_running import time if not application_running.isAppRunning(): self.tetris.execute() time.sleep(5) app = application_running.getAppRunning() # guarantee the application is running self.assertNotEqual(app, None) application_running.killAppRunning() time.sleep(5) self.assertNotEqual(app.poll(), None)