()
| 195 | |
| 196 | @staticmethod |
| 197 | def test_cache_ui_element_restore() -> None: |
| 198 | # Create a UIElement and convert it to a stub |
| 199 | original_dropdown = dropdown(options=[1, 2, 3]) |
| 200 | stub = UIElementStub(original_dropdown) |
| 201 | |
| 202 | cache = Cache( |
| 203 | defs={}, |
| 204 | hash="123", |
| 205 | cache_type="Pure", |
| 206 | stateful_refs=set(), |
| 207 | hit=True, |
| 208 | meta={"return": stub}, |
| 209 | ) |
| 210 | scope = {} |
| 211 | cache.restore(scope) |
| 212 | |
| 213 | # After restoration, should have a new UIElement instance with same properties |
| 214 | restored = cache.meta["return"] |
| 215 | assert isinstance(restored, type(original_dropdown)) |
| 216 | assert restored is not original_dropdown # Different instance |
| 217 | assert restored.options == original_dropdown.options |
| 218 | assert restored.value == original_dropdown.value |
| 219 | |
| 220 | @staticmethod |
| 221 | def test_cache_nested_ui_element_restore() -> None: |
nothing calls this directly
no test coverage detected