Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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"
         )
Exemplo n.º 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')
Exemplo n.º 6
0
 def test_uninstall_keep_data(self):
     global valid_package_name
     result = adb.uninstall(valid_package_name, '-k')
     self.assertRegexpMatches(result[1], 'Success')
Exemplo n.º 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')
Exemplo n.º 8
0
 def test_uninstall_keep_data(self):
     global VALID_PACKAGE_NAME
     result = adb.uninstall(VALID_PACKAGE_NAME, '-k')
     self.assertRegexpMatches(result[1], 'Success')
Exemplo n.º 9
0
 def test_uninstall_invalid_package_name(self):
     result = adb.uninstall(INVALID_PACKAGE_NAME)
     result[1].should.match(r'DELETE_FAILED_INTERNAL_ERROR')
Exemplo n.º 10
0
 def test_uninstall(self):
     result = adb.uninstall(VALID_PACKAGE_NAME)
     result[1].should.match(r'Success')
Exemplo n.º 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")
Exemplo n.º 12
0
 def test_uninstall_keep_data(self):
     global valid_package_name
     result = adb.uninstall(valid_package_name, "-k")
     self.assertRegexpMatches(result[1], "Success")