testing/mozbase/mozdevice/sut_tests/test_push2.py

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 import os
     6 import posixpath
     8 from dmunit import DeviceManagerTestCase
    10 class Push2TestCase(DeviceManagerTestCase):
    12     def runTest(self):
    13         """This tests copying a directory structure with files to the device.
    14         """
    15         testroot = posixpath.join(self.dm.getDeviceRoot(), 'infratest')
    16         self.dm.removeDir(testroot)
    17         self.dm.mkDir(testroot)
    18         path = posixpath.join(testroot, 'push2')
    19         self.dm.pushDir(os.path.join('test-files', 'push2'), path)
    21         # Let's walk the tree and make sure everything is there
    22         # though it's kind of cheesy, we'll use the validate file to compare
    23         # hashes - we use the client side hashing when testing the cat command
    24         # specifically, so that makes this a little less cheesy, I guess.
    25         self.assertTrue(
    26             self.dm.dirExists(posixpath.join(testroot, 'push2', 'sub1')))
    27         self.assertTrue(self.dm.validateFile(
    28             posixpath.join(testroot, 'push2', 'sub1', 'file1.txt'),
    29             os.path.join('test-files', 'push2', 'sub1', 'file1.txt')))
    30         self.assertTrue(self.dm.validateFile(
    31             posixpath.join(testroot, 'push2', 'sub1', 'sub1.1', 'file2.txt'),
    32             os.path.join('test-files', 'push2', 'sub1', 'sub1.1', 'file2.txt')))
    33         self.assertTrue(self.dm.validateFile(
    34             posixpath.join(testroot, 'push2', 'sub2', 'file3.txt'),
    35             os.path.join('test-files', 'push2', 'sub2', 'file3.txt')))
    36         self.assertTrue(self.dm.validateFile(
    37             posixpath.join(testroot, 'push2', 'file4.bin'),
    38             os.path.join('test-files', 'push2', 'file4.bin')))

mercurial