MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / test_persistence

Method test_persistence

tests/test_scene_store.py:124–135  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

122 assert names == ["alpha", "cron", "work"]
123
124 def test_persistence(self, tmp_path):
125 path = tmp_path / "scenes.json"
126 store1 = SceneStore(path=path)
127 store1.add(SceneConfig(name="intimate", primary="a/opus", hard_pin=True))
128 store1.add(SceneConfig(name="crew", primary="g/flash"))
129
130 # New store instance reads from same file
131 store2 = SceneStore(path=path)
132 assert store2.get("intimate") is not None
133 assert store2.get("intimate").hard_pin is True
134 assert store2.get("crew") is not None
135 assert len(store2.list()) == 2
136
137 def test_add_deduplicates_fallback(self, tmp_path):
138 store = self._make_store(tmp_path)

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
getMethod · 0.95
listMethod · 0.95
SceneStoreClass · 0.90
SceneConfigClass · 0.90

Tested by

no test coverage detected