MCPcopy
hub / github.com/marimo-team/marimo / test_cache_recursive_restore

Method test_cache_recursive_restore

tests/_save/test_cache.py:174–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173 @staticmethod
174 def test_cache_recursive_restore() -> None:
175 # Create a self-referential list
176 ret = []
177 ret.append(ret)
178
179 cache = Cache(
180 defs={},
181 hash="123",
182 cache_type="Pure",
183 stateful_refs=set(),
184 hit=True,
185 meta={"return": ret},
186 )
187 scope = {}
188 cache.restore(scope)
189
190 # After restoration, should maintain the self-reference
191 restored = cache.meta["return"]
192 assert isinstance(restored, list)
193 assert len(restored) == 1
194 assert restored[0] is restored # Self-reference maintained
195
196 @staticmethod
197 def test_cache_ui_element_restore() -> None:

Callers

nothing calls this directly

Calls 3

restoreMethod · 0.95
CacheClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected