MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / test_cache_overwrite

Method test_cache_overwrite

test/test_cache.py:30–42  ·  view source on GitHub ↗

Test that cache entries can be overwritten

(self)

Source from the content-addressed store, hash-verified

28 self.assertEqual(result, "你好")
29
30 def test_cache_overwrite(self):
31 """Test that cache entries can be overwritten"""
32 cache_instance = cache.TranslationCache("test_engine")
33
34 # Set initial translation
35 cache_instance.set("hello", "你好")
36
37 # Overwrite with new translation
38 cache_instance.set("hello", "您好")
39
40 # Verify the new translation is returned
41 result = cache_instance.get("hello")
42 self.assertEqual(result, "您好")
43
44 def test_non_string_params(self):
45 """Test that non-string parameters are automatically converted to JSON"""

Callers

nothing calls this directly

Calls 2

setMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected