Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / local_file_system_test.py
blob646d597283e2dd23b8c6ad04fffc286d51733171
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 unittest
10 from local_file_system import LocalFileSystem
12 class LocalFileSystemTest(unittest.TestCase):
13 def setUp(self):
14 self._file_system = LocalFileSystem(os.path.join(sys.path[0],
15 'test_data',
16 'file_system'))
18 def testReadFiles(self):
19 expected = {
20 'test1.txt': 'test1\n',
21 'test2.txt': 'test2\n',
22 'test3.txt': 'test3\n',
24 self.assertEqual(
25 expected,
26 self._file_system.Read(['test1.txt', 'test2.txt', 'test3.txt']).Get())
28 def testListDir(self):
29 expected = ['dir/']
30 for i in range(7):
31 expected.append('file%d.html' % i)
32 self.assertEqual(expected,
33 sorted(self._file_system.ReadSingle('list/').Get()))
35 if __name__ == '__main__':
36 unittest.main()