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

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

Issue 521693003: Docserver: Add @Cache annotation to CompiledFileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small clarification + rebase Created 6 years, 3 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
« no previous file with comments | « chrome/common/extensions/docs/server2/sidenav_data_source.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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 json 6 import json
7 import unittest 7 import unittest
8 import copy 8 import copy
9 9
10 from extensions_paths import JSON_TEMPLATES 10 from extensions_paths import JSON_TEMPLATES
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 def testCron(self): 142 def testCron(self):
143 file_system = TestFileSystem({ 143 file_system = TestFileSystem({
144 'chrome_sidenav.json': '[{ "title": "H1" }]' 144 'chrome_sidenav.json': '[{ "title": "H1" }]'
145 }, relative_to=JSON_TEMPLATES) 145 }, relative_to=JSON_TEMPLATES)
146 146
147 # Ensure Cron doesn't rely on request. 147 # Ensure Cron doesn't rely on request.
148 sidenav_data_source = SidenavDataSource( 148 sidenav_data_source = SidenavDataSource(
149 ServerInstance.ForTest(file_system), request=None) 149 ServerInstance.ForTest(file_system), request=None)
150 sidenav_data_source.Cron().Get() 150 sidenav_data_source.Cron().Get()
151 151
152 # If Cron fails, chrome_sidenav.json will not be cached, and the _cache_data 152 # If Cron fails, chrome_sidenav.json will not be cached, and the cache_data
153 # access will fail. 153 # access will fail.
154 # TODO(jshumway): Make a non hack version of this check. 154 # TODO(jshumway): Make a non hack version of this check.
155 sidenav_data_source._cache._file_object_store.Get( 155 sidenav_data_source._cache._file_object_store.Get(
156 '%schrome_sidenav.json' % JSON_TEMPLATES).Get()._cache_data 156 '%schrome_sidenav.json' % JSON_TEMPLATES).Get().cache_data
157 157
158 158
159 if __name__ == '__main__': 159 if __name__ == '__main__':
160 unittest.main() 160 unittest.main()
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/sidenav_data_source.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698