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

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

Issue 14273041: Doc server manifest page generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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/compiled_file_system_source_test.py
diff --git a/chrome/common/extensions/docs/server2/compiled_file_system_source_test.py b/chrome/common/extensions/docs/server2/compiled_file_system_source_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..44606aa51189f5d927a201a9ecefc602b34849a5
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/compiled_file_system_source_test.py
@@ -0,0 +1,27 @@
+#!/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 unittest
+
+from compiled_file_system_source import CompiledFileSystemSource as CFSSource
+
+class CompiledFileSystemSourceTest(unittest.TestCase):
+ def testGet(self):
+ class MockCFS:
+ def GetFromFile(self, key):
+ fs = {
+ 'key/one': 'contents-one',
+ 'key/two/three': 'contents-two'
+ }
+
+ return fs.get(key)
+
+ source = CFSSource(MockCFS(), 'key', lambda key: key.lower())
+
+ self.assertEqual('contents-one', source.get('ONE'))
+ self.assertEqual('contents-two', source.get('TwO/three'))
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698