| 137 | |
| 138 | @staticmethod |
| 139 | def test_cache_ui_element_update() -> None: |
| 140 | cache = Cache( |
| 141 | defs={}, |
| 142 | hash="123", |
| 143 | cache_type="Pure", |
| 144 | stateful_refs=set(), |
| 145 | hit=True, |
| 146 | meta={}, |
| 147 | ) |
| 148 | scope = {} |
| 149 | ret = dropdown(options=[1, 2, 3]) |
| 150 | cache.update(scope, {"return": ret}) |
| 151 | |
| 152 | stub = cache.meta["return"] |
| 153 | |
| 154 | assert isinstance(stub, UIElementStub) |
| 155 | |
| 156 | assert stub.load().options == ret.options |
| 157 | assert stub.load().value == ret.value |
| 158 | |
| 159 | @staticmethod |
| 160 | def test_cache_basic_restore() -> None: |