def setUp(self): """Deletes *.apk if it already installed""" global valid_package_name result = adb.shell('pm list packages | grep ' + valid_package_name) if re.search(exp_install_cmd_output, result[1]): print('*** uninstalling existing ' + valid_package_name) adb.uninstall(valid_package_name) else: print('*** no need to uninstall ' + valid_package_name + ' since\ it is not yet installed')
def setUp(self): """Deletes *.apk if it already installed""" global VALID_PACKAGE_NAME result = adb.shell('pm list packages | grep ' + VALID_PACKAGE_NAME) if re.search(exp_install_cmd_output, result[1]): print('*** uninstalling existing ' + VALID_PACKAGE_NAME) adb.uninstall(VALID_PACKAGE_NAME) else: print('*** no need to uninstall ' + VALID_PACKAGE_NAME + ' since\ it is not yet installed')
def setUp(self): """Deletes *.apk if it already installed""" global VALID_PACKAGE_NAME result = adb.shell('pm list packages | grep ' + VALID_PACKAGE_NAME) if re.search(exp_install_cmd_output, result[1]): print('*** uninstalling existing ' + VALID_PACKAGE_NAME) adb.uninstall(VALID_PACKAGE_NAME, []) else: print('*** no need to uninstall ' + VALID_PACKAGE_NAME + ' since\ it is not yet installed')
def setUp(self): """ Installs apk before test execution """ global valid_package_name global path_to_valid_apk result = adb.shell('pm list packages | grep ' + valid_package_name) if not re.search(exp_install_cmd_output, result[1]): print('*** installing ' + valid_package_name) adb.install(path_to_valid_apk) else: print('*** no need to install ' + valid_package_name + ' since it is\ already installed')
def setUp(self): """ Installs apk before test execution """ global VALID_PACKAGE_NAME global PATH_TO_VALID_APK result = adb.shell('pm list packages | grep ' + VALID_PACKAGE_NAME) if not re.search(exp_install_cmd_output, result[1]): print('*** installing ' + VALID_PACKAGE_NAME) adb.install(PATH_TO_VALID_APK) else: print('*** no need to install ' + VALID_PACKAGE_NAME + ' since it is\ already installed')
def setUp(self): """Deletes *.apk if it already installed""" global valid_package_name result = adb.shell("pm list packages | grep " + valid_package_name) if re.search(exp_install_cmd_output, result[1]): print("*** uninstalling existing " + valid_package_name) adb.uninstall(valid_package_name) else: print( "*** no need to uninstall " + valid_package_name + " since\ it is not yet installed" )
def setUp(self): """ Installs apk before test execution """ global valid_package_name global path_to_valid_apk result = adb.shell("pm list packages | grep " + valid_package_name) if not re.search(exp_install_cmd_output, result[1]): print("*** installing " + valid_package_name) adb.install(path_to_valid_apk) else: print( "*** no need to install " + valid_package_name + " since it is\ already installed" )
def test_shell_n_misspelled(self): result = adb.shell('misspelled') self.assertRegexpMatches(result[1], 'not found')
def test_shell_p_w_option(self): result = adb.shell('ls -l') #search for time attribute which is for sure present in "-l" option self.assertRegexpMatches(result[1], '[0-2][0-9]:[0-5][0-9]')
def test_shell_p(self): result = adb.shell('ls') #search for folders which will be for sure on Adnroid OS self.assertRegexpMatches(result[1], '(\\r\\nroot|\\r\\nsys|\\r\\nsystem)')
def test_shell(self): result = adb.shell('ls') #search for folders which will be for sure on Adnroid OS self.assertRegexpMatches(result[1], '(\\r\\nroot|\\r\\nsys|\\r\\nsystem)')
def test_shell_w_option(self): result = adb.shell('ls -l') #search for time attribute which is for sure present in "-l" option self.assertRegexpMatches(result[1], '[0-2][0-9]:[0-5][0-9]')
def test_shell_misspelled(self): result = adb.shell('misspelled') result[1].should.match(r'not found')
def test_shell_w_option(self): result = adb.shell('ls -l') # search for time attribute which is for sure present in "-l" option result[1].should.match(r'[0-2][0-9]:[0-5][0-9]')
def test_shell(self): result = adb.shell('ls') # search for folders which will be for sure on Adnroid OS result[1].should.match('(\\r\\nroot|\\r\\nsys|\\r\\nsystem)')
def test_shell_misspelled(self): result = adb.shell('misspelled') self.assertRegexpMatches(result[1], 'not found')
def test_shell_n_misspelled(self): result = adb.shell("misspelled") self.assertRegexpMatches(result[1], "not found")