MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / test_load

Method test_load

tests/test_hook_config.py:213–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

211class TestHookConfigManager:
212 @pytest.mark.asyncio
213 async def test_load(self):
214 registry = AsyncHookRegistry()
215 with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
216 json.dump({
217 "hooks": {
218 "PreToolUse": [
219 {"type": "command", "command": "echo test"}
220 ]
221 }
222 }, f)
223 f.flush()
224 manager = HookConfigManager(registry, f.name)
225 snapshot = await manager.load()
226
227 os.unlink(f.name)
228 assert not snapshot.is_empty
229 assert registry.hook_count == 1
230
231 @pytest.mark.asyncio
232 async def test_reload_if_changed(self):

Callers

nothing calls this directly

Calls 4

loadMethod · 0.95
AsyncHookRegistryClass · 0.90
HookConfigManagerClass · 0.90
flushMethod · 0.45

Tested by

no test coverage detected