def testCron(self): file_system = TestFileSystem({ 'chrome_sidenav.json': '[{ "title": "H1" }]' }, relative_to=JSON_TEMPLATES) # Ensure Cron doesn't rely on request. sidenav_data_source = SidenavDataSource( ServerInstance.ForTest(file_system), request=None) sidenav_data_source.Cron().Get() # If Cron fails, chrome_sidenav.json will not be cached, and the _cache_data # access will fail. # TODO(jshumway): Make a non hack version of this check. sidenav_data_source._cache._file_object_store.Get( '%schrome_sidenav.json' % JSON_TEMPLATES).Get()._cache_data
def testCron(self): file_system = TestFileSystem({ 'apps_sidenav.json': '[{ "title": "H1" }]' , 'extensions_sidenav.json': '[{ "title": "H2" }]' }, relative_to='docs/templates/json') # Ensure Cron doesn't rely on request. sidenav_data_source = SidenavDataSource( ServerInstance.ForTest(file_system), request=None) sidenav_data_source.Cron().Get() # If Cron fails, apps_sidenav.json will not be cached, and the _cache_data # access will fail. # TODO(jshumway): Make a non hack version of this check. sidenav_data_source._cache._file_object_store.Get( 'docs/templates/json/apps_sidenav.json').Get()._cache_data