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

Side by Side Diff: appengine/findit/libs/test/cache_decorator_test.py

Issue 2538373003: [Culprit-Finder] Merge lib/ to libs/. (Closed)
Patch Set: . Created 4 years 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import pickle 5 import pickle
6 import zlib 6 import zlib
7 7
8 from google.appengine.api import memcache 8 from google.appengine.api import memcache
9 from testing_utils import testing 9 from testing_utils import testing
10 10
11 from lib import cache_decorator 11 from libs import cache_decorator
12 12
13 13
14 class _DummyCacher(cache_decorator.Cacher): 14 class _DummyCacher(cache_decorator.Cacher):
15 def __init__(self, cached_data): 15 def __init__(self, cached_data):
16 self.cached_data = cached_data 16 self.cached_data = cached_data
17 17
18 def Get(self, key): 18 def Get(self, key):
19 return self.cached_data.get(key) 19 return self.cached_data.get(key)
20 20
21 def Set(self, key, data, expire_time=0): 21 def Set(self, key, data, expire_time=0):
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return self.url + '/' + path 154 return self.url + '/' + path
155 155
156 a1 = A('http://test', 3) 156 a1 = A('http://test', 3)
157 self.assertEqual('http://test/p1', a1.Func('p1')) 157 self.assertEqual('http://test/p1', a1.Func('p1'))
158 self.assertEqual('http://test/p1', a1.Func('p1')) 158 self.assertEqual('http://test/p1', a1.Func('p1'))
159 self.assertEqual(1, a1.runs) 159 self.assertEqual(1, a1.runs)
160 160
161 a2 = A('http://test', 5) 161 a2 = A('http://test', 5)
162 self.assertEqual('http://test/p1', a2.Func('p1')) 162 self.assertEqual('http://test/p1', a2.Func('p1'))
163 self.assertEqual(0, a2.runs) 163 self.assertEqual(0, a2.runs)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698