testing/mozbase/mozdevice/tests/sut_fileExists.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 from sut import MockAgent
     2 import mozdevice
     3 import unittest
     5 class FileExistsTest(unittest.TestCase):
     7     commands = [('isdir /', 'TRUE'),
     8                 ('cd /', ''),
     9                 ('ls', 'init')]
    11     def test_onRoot(self):
    12         root_commands = [('isdir /', 'TRUE')]
    13         a = MockAgent(self, commands=root_commands)
    14         d = mozdevice.DroidSUT("127.0.0.1", port=a.port)
    15         self.assertTrue(d.fileExists('/'))
    17     def test_onNonexistent(self):
    18         a = MockAgent(self, commands=self.commands)
    19         d = mozdevice.DroidSUT("127.0.0.1", port=a.port)
    20         self.assertFalse(d.fileExists('/doesNotExist'))
    22     def test_onRegularFile(self):
    23         a = MockAgent(self, commands=self.commands)
    24         d = mozdevice.DroidSUT("127.0.0.1", port=a.port)
    25         self.assertTrue(d.fileExists('/init'))
    27 if __name__ == '__main__':
    28     unittest.main()

mercurial