testing/mozbase/mozdevice/tests/sut_remove.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mozbase/mozdevice/tests/sut_remove.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +#/usr/bin/env python
     1.5 +import mozdevice
     1.6 +import mozlog
     1.7 +import unittest
     1.8 +from sut import MockAgent
     1.9 +
    1.10 +
    1.11 +class TestRemove(unittest.TestCase):
    1.12 +
    1.13 +    def test_removeDir(self):
    1.14 +        commands = [("isdir /mnt/sdcard/test", "TRUE"),
    1.15 +                    ("rmdr /mnt/sdcard/test", "Deleting file(s) from "
    1.16 +                                            "/storage/emulated/legacy/Moztest\n"
    1.17 +                                            "        <empty>\n"
    1.18 +                                            "Deleting directory "
    1.19 +                                            "/storage/emulated/legacy/Moztest\n")]
    1.20 +
    1.21 +        m = MockAgent(self, commands=commands)
    1.22 +        d = mozdevice.DroidSUT("127.0.0.1", port=m.port, logLevel=mozlog.DEBUG)
    1.23 +        # No error implies we're all good
    1.24 +        self.assertEqual(None, d.removeDir("/mnt/sdcard/test"))
    1.25 +
    1.26 +if __name__ == '__main__':
    1.27 +    unittest.main()

mercurial