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

Side by Side Diff: chrome/common/extensions/docs/server2/example_zipper_test.py

Issue 13470005: Refactor the devserver to make it easier to control caching (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cduvall, rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import sys 7 import sys
8 import unittest 8 import unittest
9 9
10 from compiled_file_system import CompiledFileSystem 10 from compiled_file_system import CompiledFileSystem
11 from example_zipper import ExampleZipper 11 from example_zipper import ExampleZipper
12 from in_memory_object_store import InMemoryObjectStore
13 from local_file_system import LocalFileSystem 12 from local_file_system import LocalFileSystem
14 from memcache_file_system import MemcacheFileSystem 13 from caching_file_system import CachingFileSystem
15 14
16 class ExampleZipperTest(unittest.TestCase): 15 class ExampleZipperTest(unittest.TestCase):
17 def setUp(self): 16 def setUp(self):
18 object_store = InMemoryObjectStore('') 17 self._file_system = CachingFileSystem(
19 self._file_system = MemcacheFileSystem( 18 LocalFileSystem(os.path.join(sys.path[0], 'test_data')))
20 LocalFileSystem(os.path.join(sys.path[0], 'test_data')),
21 object_store)
22 self._example_zipper = ExampleZipper( 19 self._example_zipper = ExampleZipper(
23 self._file_system, 20 self._file_system,
24 CompiledFileSystem.Factory(self._file_system, object_store), 21 CompiledFileSystem.Factory(self._file_system),
25 'example_zipper') 22 'example_zipper')
26 23
27 def testCreateZip(self): 24 def testCreateZip(self):
28 # Cache manifest.json as unicode and make sure ExampleZipper doesn't error. 25 # Cache manifest.json as unicode and make sure ExampleZipper doesn't error.
29 self._file_system.ReadSingle('example_zipper/basic/manifest.json') 26 self._file_system.ReadSingle('example_zipper/basic/manifest.json')
30 self.assertTrue(len(self._example_zipper.Create('basic')) > 0) 27 self.assertTrue(len(self._example_zipper.Create('basic')) > 0)
31 28
32 if __name__ == '__main__': 29 if __name__ == '__main__':
33 unittest.main() 30 unittest.main()
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/example_zipper.py ('k') | chrome/common/extensions/docs/server2/github_file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698