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

Method test_preds_cache

lit_nlp/lib/caching_test.py:109–118  ·  view source on GitHub ↗

Test with an exact match.

(self)

Source from the content-addressed store, hash-verified

107class PredsCacheTest(absltest.TestCase):
108
109 def test_preds_cache(self):
110 """Test with an exact match."""
111 cache = caching.PredsCache("test")
112 self.assertEqual("0", cache.info())
113 cache.put("test", None)
114 self.assertEqual("0", cache.info())
115 cache.put("test", ("a", "1"))
116 self.assertEqual("1", cache.info())
117 self.assertIsNone(None, cache.get(("a", "2")))
118 self.assertEqual("test", cache.get(("a", "1")))
119
120 def test_pred_lock_key(self):
121 cache = caching.PredsCache("test")

Callers

nothing calls this directly

Calls 3

infoMethod · 0.95
putMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected