Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 Push1TestCase(DeviceManagerTestCase):
12 def runTest(self):
13 """This tests copying a directory structure to the device.
14 """
15 dvroot = self.dm.getDeviceRoot()
16 dvpath = posixpath.join(dvroot, 'infratest')
17 self.dm.removeDir(dvpath)
18 self.dm.mkDir(dvpath)
20 p1 = os.path.join('test-files', 'push1')
21 # Set up local stuff
22 try:
23 os.rmdir(p1)
24 except:
25 pass
27 if not os.path.exists(p1):
28 os.makedirs(os.path.join(p1, 'sub.1', 'sub.2'))
29 if not os.path.exists(os.path.join(p1, 'sub.1', 'sub.2', 'testfile')):
30 file(os.path.join(p1, 'sub.1', 'sub.2', 'testfile'), 'w').close()
32 self.dm.pushDir(p1, posixpath.join(dvpath, 'push1'))
34 self.assertTrue(
35 self.dm.dirExists(posixpath.join(dvpath, 'push1', 'sub.1')))
36 self.assertTrue(self.dm.dirExists(
37 posixpath.join(dvpath, 'push1', 'sub.1', 'sub.2')))