testing/mozbase/mozdevice/tests/sut_unpackfile.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mozbase/mozdevice/tests/sut_unpackfile.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +import mozdevice
     1.7 +import mozlog
     1.8 +import unittest
     1.9 +from sut import MockAgent
    1.10 +
    1.11 +
    1.12 +class TestUnpack(unittest.TestCase):
    1.13 +
    1.14 +    def test_unpackFile(self):
    1.15 +
    1.16 +        commands = [("isdir /mnt/sdcard/tests", "TRUE"),
    1.17 +                    ("unzp /data/test/sample.zip /data/test/",
    1.18 +                     "Checksum:          653400271\n"
    1.19 +                     "1 of 1 successfully extracted\n")]
    1.20 +        m = MockAgent(self, commands=commands)
    1.21 +        d = mozdevice.DroidSUT("127.0.0.1", port=m.port, logLevel=mozlog.DEBUG)
    1.22 +        # No error being thrown imples all is well
    1.23 +        self.assertEqual(None, d.unpackFile("/data/test/sample.zip",
    1.24 +                                            "/data/test/"))
    1.25 +
    1.26 +if __name__ == '__main__':
    1.27 +    unittest.main()

mercurial