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): 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): os.chdir(TESTS_DIR) test_utils.remove_directories_if_exist([PROJECT_DIR, RENAMED_PROJECT_DIR]) create_app.create_app([APP_NAME, DOMAIN]) self.assertTrue(os.path.exists(PROJECT_DIR)) os.chdir(PROJECT_DIR) self.conf = ConfigParser.ConfigParser() self.conf.read(libs_config_file())
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 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 tearDownClass(cls): test_utils.remove_directories_if_exist([EXAMPLE_PROJECT_DIR, NEW_PROJECT_DIR])
def setUp(self): os.chdir(TESTS_DIR) test_utils.remove_directories_if_exist([EXAMPLE_PROJECT_DIR, NEW_PROJECT_DIR])
def tearDownClass(cls): test_utils.remove_directories_if_exist([PROJECT_DIR, RENAMED_PROJECT_DIR])
def tearDownClass(cls): """Finally clean up the test project.""" os.chdir(TESTS_DIR) test_utils.remove_directories_if_exist([PROJECT_DIR])
def tearDownClass(cls): """Clean up the test project.""" if is_device_rooted(): test_utils.remove_directories_if_exist([PROJECT_DIR])
def tearDownClass(cls): test_utils.remove_directories_if_exist( [EXAMPLE_PROJECT_DIR, NEW_PROJECT_DIR])
def setUp(self): os.chdir(TESTS_DIR) test_utils.remove_directories_if_exist( [EXAMPLE_PROJECT_DIR, NEW_PROJECT_DIR])