(self)
| 257 | |
| 258 | @pytest.mark.asyncio |
| 259 | async def test_validate(self): |
| 260 | registry = AsyncHookRegistry() |
| 261 | with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f: |
| 262 | json.dump({ |
| 263 | "hooks": { |
| 264 | "PreToolUse": [ |
| 265 | {"type": "command"} |
| 266 | ] |
| 267 | } |
| 268 | }, f) |
| 269 | f.flush() |
| 270 | manager = HookConfigManager(registry, f.name) |
| 271 | errors = await manager.validate() |
| 272 | |
| 273 | os.unlink(f.name) |
| 274 | assert len(errors) == 1 |
| 275 | |
| 276 | @pytest.mark.asyncio |
| 277 | async def test_validate_missing_file(self): |
nothing calls this directly
no test coverage detected