Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: chrome/common/extensions/docs/server2/local_file_system_test.py

Issue 10704252: Extensions Docs Server: Internal file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/local_file_system_test.py
diff --git a/chrome/common/extensions/docs/server2/local_file_system_test.py b/chrome/common/extensions/docs/server2/local_file_system_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..13050bfa09e7d022ba0612af70339e98c4f8613b
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/local_file_system_test.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import unittest
+
+from local_file_system import LocalFileSystem
+
+class LocalFileSystemTest(unittest.TestCase):
+ def setUp(self):
+ self._file_system = LocalFileSystem(os.path.join('test_data',
+ 'file_system'))
+
+ def testReadFiles(self):
+ expected = {
+ 'test1.txt': 'test1\n',
+ 'test2.txt': 'test2\n',
+ 'test3.txt': 'test3\n',
+ }
+ self.assertEqual(
+ expected,
+ self._file_system.Read(['test1.txt', 'test2.txt', 'test3.txt']).Get())
+
+ def testListDir(self):
+ expected = ['dir/']
+ for i in range(7):
+ expected.append('file%d.html' % i)
+ self.assertEqual(expected,
+ sorted(self._file_system.Read(['list/']).Get()['list/']))
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698