Ejemplo n.º 1
0
    def test_remount_fail(self):
        """
        Test remount fail.
        """
        str_ret = textwrap.dedent("""\
                                  error: device offline
                                  """)
        # return code is 0, but no "remount succeeded" message will return False.
        self.mock_obj.communicate.return_value = [str_ret, None]
        self.mock_popen.return_value = self.mock_obj
        ret = AdbWrapper.adb_remount()
        self.assertFalse(ret, 'The result should be False.')

        # return code is not 0 will raise exception
        with self.assertRaises(Exception) as cm:
            self.mock_obj.returncode = 1
            self.mock_obj.communicate.return_value = [str_ret, None]
            self.mock_popen.return_value = self.mock_obj
            ret = AdbWrapper.adb_remount()
Ejemplo n.º 2
0
    def test_remount_fail(self):
        """
        Test remount fail.
        """
        str_ret = textwrap.dedent("""\
                                  error: device offline
                                  """)
        # return code is 0, but no "remount succeeded" message will return False.
        self.mock_obj.communicate.return_value = [str_ret, None]
        self.mock_popen.return_value = self.mock_obj
        ret = AdbWrapper.adb_remount()
        self.assertFalse(ret, 'The result should be False.')

        # return code is not 0 will raise exception
        with self.assertRaises(Exception) as cm:
            self.mock_obj.returncode = 1
            self.mock_obj.communicate.return_value = [str_ret, None]
            self.mock_popen.return_value = self.mock_obj
            ret = AdbWrapper.adb_remount()
Ejemplo n.º 3
0
 def test_remount(self):
     """
     Test remount.
     """
     str_ret = textwrap.dedent("""\
                               remount succeeded
                               """)
     self.mock_obj.communicate.return_value = [str_ret, None]
     self.mock_popen.return_value = self.mock_obj
     ret = AdbWrapper.adb_remount()
     self.assertTrue(ret, 'The result should be True.')
Ejemplo n.º 4
0
 def test_remount(self):
     """
     Test remount.
     """
     str_ret = textwrap.dedent("""\
                               remount succeeded
                               """)
     self.mock_obj.communicate.return_value = [str_ret, None]
     self.mock_popen.return_value = self.mock_obj
     ret = AdbWrapper.adb_remount()
     self.assertTrue(ret, 'The result should be True.')