示例#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):
     """ 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')
示例#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')
示例#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')
示例#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"
         )
示例#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"
         )
示例#9
0
 def test_shell_n_misspelled(self):
     result = adb.shell('misspelled')
     self.assertRegexpMatches(result[1], 'not found')
示例#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]')
示例#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)')
示例#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)')
示例#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]')
示例#14
0
 def test_shell_misspelled(self):
     result = adb.shell('misspelled')
     result[1].should.match(r'not found')
示例#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]')
示例#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)')
示例#17
0
 def test_shell_misspelled(self):
     result = adb.shell('misspelled')
     self.assertRegexpMatches(result[1], 'not found')
示例#18
0
 def test_shell_n_misspelled(self):
     result = adb.shell("misspelled")
     self.assertRegexpMatches(result[1], "not found")