Example #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')
Example #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')
Example #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')
Example #4
0
 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')
Example #5
0
    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')
Example #6
0
    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')
Example #7
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"
         )
Example #8
0
 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"
         )
Example #9
0
 def test_shell_n_misspelled(self):
     result = adb.shell('misspelled')
     self.assertRegexpMatches(result[1], 'not found')
Example #10
0
 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]')
Example #11
0
 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)')
Example #12
0
 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)')
Example #13
0
 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]')
Example #14
0
 def test_shell_misspelled(self):
     result = adb.shell('misspelled')
     result[1].should.match(r'not found')
Example #15
0
 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]')
Example #16
0
 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)')
Example #17
0
 def test_shell_misspelled(self):
     result = adb.shell('misspelled')
     self.assertRegexpMatches(result[1], 'not found')
Example #18
0
 def test_shell_n_misspelled(self):
     result = adb.shell("misspelled")
     self.assertRegexpMatches(result[1], "not found")