MCPcopy Create free account
hub / github.com/PAIR-code/lit / test_get_pred_lock

Method test_get_pred_lock

lit_nlp/lib/caching_test.py:165–176  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

163 self.assertIsNone(cache.delete_pred_lock(cache_key))
164
165 def test_get_pred_lock(self):
166 cache = caching.PredsCache("test")
167 cache_key = [("a", "1"), ("a", "2")]
168
169 lock = cache.get_pred_lock(cache_key)
170 self.assertIsNotNone(lock)
171
172 sub_cache_key = [("a", "2")]
173 self.assertEqual(lock, cache.get_pred_lock(sub_cache_key))
174
175 mismatch_cache_key = [("b", "2")]
176 self.assertNotEqual(lock, cache.get_pred_lock(mismatch_cache_key))
177
178
179if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

get_pred_lockMethod · 0.95

Tested by

no test coverage detected