| OLD | NEW |
| 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 testing_utils import testing | 8 from testing_utils import testing |
| 9 | 9 |
| 10 from lib import cache | 10 from libs import cache |
| 11 from lib import cache_decorator | 11 from libs import cache_decorator |
| 12 | 12 |
| 13 | 13 |
| 14 class _DummyCache(cache.Cache): | 14 class _DummyCache(cache.Cache): |
| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return self.url + '/' + path | 119 return self.url + '/' + path |
| 120 | 120 |
| 121 a1 = A('http://test', 3) | 121 a1 = A('http://test', 3) |
| 122 self.assertEqual('http://test/p1', a1.Func('p1')) | 122 self.assertEqual('http://test/p1', a1.Func('p1')) |
| 123 self.assertEqual('http://test/p1', a1.Func('p1')) | 123 self.assertEqual('http://test/p1', a1.Func('p1')) |
| 124 self.assertEqual(1, a1.runs) | 124 self.assertEqual(1, a1.runs) |
| 125 | 125 |
| 126 a2 = A('http://test', 5) | 126 a2 = A('http://test', 5) |
| 127 self.assertEqual('http://test/p1', a2.Func('p1')) | 127 self.assertEqual('http://test/p1', a2.Func('p1')) |
| 128 self.assertEqual(0, a2.runs) | 128 self.assertEqual(0, a2.runs) |
| OLD | NEW |