(self)
| 211 | class 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): |
nothing calls this directly
no test coverage detected