(self)
| 118 | self.assertEqual("test", cache.get(("a", "1"))) |
| 119 | |
| 120 | def test_pred_lock_key(self): |
| 121 | cache = caching.PredsCache("test") |
| 122 | cache_key = [("a", "1"), ("a", "2")] |
| 123 | |
| 124 | self.assertIsNone(cache.pred_lock_key(cache_key)) |
| 125 | |
| 126 | cache.get_pred_lock(cache_key) |
| 127 | expected_cache_key = frozenset(cache_key) |
| 128 | self.assertEqual(expected_cache_key, cache.pred_lock_key(cache_key)) |
| 129 | |
| 130 | sub_cache_key = [("a", "1")] |
| 131 | self.assertEqual(expected_cache_key, cache.pred_lock_key(sub_cache_key)) |
| 132 | |
| 133 | mismatch_cache_key = [("b", "1")] |
| 134 | self.assertIsNone(cache.pred_lock_key(mismatch_cache_key)) |
| 135 | |
| 136 | def test_pred_lock_key_no_concurrent_predictions(self): |
| 137 | cache = caching.PredsCache("test", False) |
nothing calls this directly
no test coverage detected