コード例 #1
0
 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')
コード例 #2
0
 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')
コード例 #3
0
 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')
コード例 #4
0
 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"
         )
コード例 #5
0
 def test_uninstall_n_invalid_package_name(self):
     global invalid_package_name
     result = adb.uninstall(invalid_package_name)
     self.assertRegexpMatches(result[1], 'DELETE_FAILED_INTERNAL_ERROR')
コード例 #6
0
 def test_uninstall_keep_data(self):
     global valid_package_name
     result = adb.uninstall(valid_package_name, '-k')
     self.assertRegexpMatches(result[1], 'Success')
コード例 #7
0
 def test_uninstall_invalid_package_name(self):
     global INVALID_PACKAGE_NAME
     result = adb.uninstall(INVALID_PACKAGE_NAME)
     self.assertRegexpMatches(result[1], 'DELETE_FAILED_INTERNAL_ERROR')
コード例 #8
0
 def test_uninstall_keep_data(self):
     global VALID_PACKAGE_NAME
     result = adb.uninstall(VALID_PACKAGE_NAME, '-k')
     self.assertRegexpMatches(result[1], 'Success')
コード例 #9
0
 def test_uninstall_invalid_package_name(self):
     result = adb.uninstall(INVALID_PACKAGE_NAME)
     result[1].should.match(r'DELETE_FAILED_INTERNAL_ERROR')
コード例 #10
0
 def test_uninstall(self):
     result = adb.uninstall(VALID_PACKAGE_NAME)
     result[1].should.match(r'Success')
コード例 #11
0
 def test_uninstall_n_invalid_package_name(self):
     global invalid_package_name
     result = adb.uninstall(invalid_package_name)
     self.assertRegexpMatches(result[1], "DELETE_FAILED_INTERNAL_ERROR")
コード例 #12
0
 def test_uninstall_keep_data(self):
     global valid_package_name
     result = adb.uninstall(valid_package_name, "-k")
     self.assertRegexpMatches(result[1], "Success")