MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / test_params_distinction

Method test_params_distinction

test/test_cache.py:79–92  ·  view source on GitHub ↗

Test that cache distinguishes between different engine parameters

(self)

Source from the content-addressed store, hash-verified

77 self.assertEqual(cache2.get("hello"), "你好 2")
78
79 def test_params_distinction(self):
80 """Test that cache distinguishes between different engine parameters"""
81 params1 = {"param": "value1"}
82 params2 = {"param": "value2"}
83 cache1 = cache.TranslationCache("test_engine", params1)
84 cache2 = cache.TranslationCache("test_engine", params2)
85
86 # Set same text with different parameters
87 cache1.set("hello", "你好 1")
88 cache2.set("hello", "你好 2")
89
90 # Verify each parameter set gets its own translation
91 self.assertEqual(cache1.get("hello"), "你好 1")
92 self.assertEqual(cache2.get("hello"), "你好 2")
93
94 def test_consistent_param_serialization(self):
95 """Test that dictionary parameters are consistently serialized regardless of key order"""

Callers

nothing calls this directly

Calls 2

setMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected