| OLD | NEW |
| 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 Loading... |
| 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() |
| OLD | NEW |