cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / local_file_system_test.py
blobff2908817b3d03d4ae228a87ffe2479e155ffdbe
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import os
7 import sys
8 import posixpath
9 import unittest
11 from extensions_paths import SERVER2
12 from local_file_system import LocalFileSystem
15 class LocalFileSystemTest(unittest.TestCase):
16 def setUp(self):
17 self._file_system = LocalFileSystem.Create(
18 SERVER2, 'test_data', 'file_system/')
20 def testReadFiles(self):
21 expected = {
22 'test1.txt': 'test1\n',
23 'test2.txt': 'test2\n',
24 'test3.txt': 'test3\n',
26 self.assertEqual(
27 expected,
28 self._file_system.Read(['test1.txt', 'test2.txt', 'test3.txt']).Get())
30 def testListDir(self):
31 expected = ['dir/']
32 for i in range(7):
33 expected.append('file%d.html' % i)
34 self.assertEqual(expected,
35 sorted(self._file_system.ReadSingle('list/').Get()))
38 if __name__ == '__main__':
39 unittest.main()