testing/mozbase/mozdevice/tests/sut_list.py

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:25040f0e985f
1 #/usr/bin/env python
2 import mozdevice
3 import mozlog
4 import unittest
5 from sut import MockAgent
6
7
8 class TestListFiles(unittest.TestCase):
9 commands = [("isdir /mnt/sdcard", "TRUE"),
10 ("cd /mnt/sdcard", ""),
11 ("ls", "Android\nMusic\nPodcasts\nRingtones\nAlarms\n"
12 "Notifications\nPictures\nMovies\nDownload\nDCIM\n")]
13
14 def test_listFiles(self):
15 m = MockAgent(self, commands=self.commands)
16 d = mozdevice.DroidSUT("127.0.0.1", port=m.port, logLevel=mozlog.DEBUG)
17
18 expected = (self.commands[2][1].strip()).split("\n")
19 self.assertEqual(expected, d.listFiles("/mnt/sdcard"))
20
21 if __name__ == '__main__':
22 unittest.main()

mercurial