def setUpClass(cls): """Set up a new project.""" os.chdir(TESTS_DIR) if is_device_rooted(): test_utils.stop_app(PACKAGE_NAME) test_utils.remove_directories_if_exist([PROJECT_DIR]) create_app.create_app([APP_NAME, DOMAIN])
def tearDown(self): if is_device_rooted(): # Wait until the app was started successful time.sleep(6) self.assertTrue(test_utils.is_app_running(PACKAGE_NAME)) test_utils.stop_app(PACKAGE_NAME)
def tearDown(self): self.assertTrue(os.path.exists(PROJECT_DIR)) # Wait for termination of the app installation before checking time.sleep(6) self.assertTrue(test_utils.is_app_running(PACKAGE_NAME)) if is_device_rooted(): test_utils.stop_app(PACKAGE_NAME) os.chdir(TESTS_DIR) test_utils.remove_directories_if_exist([PROJECT_DIR])
def setUp(self): """ Explicitly remove previous test projects, to be sure a new one is created. """ os.chdir(TESTS_DIR) if is_device_rooted(): test_utils.stop_app(PACKAGE_NAME) self.assertFalse(test_utils.is_app_running(PACKAGE_NAME)) test_utils.remove_directories_if_exist([PROJECT_DIR]) self.assertFalse(os.path.exists(PROJECT_DIR))
def setUpClass(cls): """Create a new test project and install and run it properly.""" if is_device_rooted(): os.chdir(TESTS_DIR) test_utils.stop_app(PACKAGE_NAME) hello_world.hello_world(show_log=False) # Wait for termination of the app installation before doing fast deploys. time.sleep(6) test_utils.stop_app(PACKAGE_NAME)
def test_examples(self): """Test deploying all examples.""" for example_name in self.conf.sections(): os.chdir(TESTS_DIR) app_name = example_name + create_example.APP_NAME_SUFFIX package_name = "%s.%s" % (create_example.DOMAIN, app_name) project_dir = os.path.join(TESTS_DIR, app_name) test_utils.remove_directories_if_exist([project_dir]) self.assertFalse(os.path.exists(project_dir)) if is_device_rooted(): test_utils.stop_app(package_name) self.assertFalse(test_utils.is_app_running(package_name)) create_example.create_example([example_name]) self.assertTrue(os.path.exists(project_dir)) complete_deploy.complete_deploy() time.sleep(8) self.assertTrue(test_utils.is_app_running(package_name)) if is_device_rooted(): test_utils.stop_app(package_name) test_utils.remove_directories_if_exist([project_dir])
def tearDown(self): # Wait for termination of the app installation before checking time.sleep(6) self.assertTrue(test_utils.is_app_running(PACKAGE_NAME)) if is_device_rooted(): test_utils.stop_app(PACKAGE_NAME)
def setUp(self): if is_device_rooted(): self.assertFalse(test_utils.is_app_running(PACKAGE_NAME))
def test_fast_deploy_python_api(self): """Test the fast deployment method via python api.""" if is_device_rooted(): fast_deploy.fast_deploy(show_log=False)
def test_fast_deploy_cmd_line(self): """Test the fast deployment method from command line.""" if is_device_rooted(): cmd = ["pydroid", "deploy", "fast"] subprocess.call(cmd)
def tearDownClass(cls): """Clean up the test project.""" if is_device_rooted(): test_utils.remove_directories_if_exist([PROJECT_DIR])