| 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()
|
|
|