def test_get_cache(self): self.assertEqual(memcache.get('some-cache'), None) self.assertEqual(PersistentCache.get_cache('some-cache'), None) PersistentCache.set_cache('some-cache', 'some data') self.assertEqual(memcache.get('some-cache'), 'some data') self.assertEqual(PersistentCache.get_cache('some-cache'), 'some data') memcache.delete('some-cache') self.assertEqual(memcache.get('some-cache'), None) self.assertEqual(PersistentCache.get_cache('some-cache'), 'some data')
def get(self): self.response.headers['Content-Type'] = 'application/json' dashboard = PersistentCache.get_cache('dashboard') if dashboard: self.response.out.write(dashboard) else: schedule_dashboard_update()
def get(self): self.response.headers['Content-Type'] = 'application/json' manifest = PersistentCache.get_cache('manifest') if manifest: self.response.out.write(manifest) else: schedule_manifest_update()
def get(self): self.response.headers["Content-Type"] = "application/json" dashboard = PersistentCache.get_cache("dashboard") if dashboard: self.response.out.write(dashboard) else: schedule_dashboard_update()
def get(self): self.response.headers["Content-Type"] = "application/json" manifest = PersistentCache.get_cache("manifest") if manifest: self.response.out.write(manifest) else: schedule_manifest_update()
def get(self): self.response.headers['Content-Type'] = 'application/json' test_id, branch_id, platform_id = _get_test_branch_platform_ids(self) runs = PersistentCache.get_cache(Test.cache_key(test_id, branch_id, platform_id)) if runs: self.response.out.write(runs) else: schedule_runs_update(test_id, branch_id, platform_id)
def get(self): self.response.headers['Content-Type'] = 'application/json' try: test_id = int(self.request.get('id', 0)) branch_id = int(self.request.get('branchid', 0)) platform_id = int(self.request.get('platformid', 0)) except TypeError: # FIXME: Output an error here test_id = 0 branch_id = 0 platform_id = 0 runs = PersistentCache.get_cache(Test.cache_key(test_id, branch_id, platform_id)) if runs: self.response.out.write(runs) else: schedule_runs_update(test_id, branch_id, platform_id)