"""Validate that path documentation READMEs exist and have required sections (REQ-97, 98, 99)."""

from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent


class TestDocsCoverage:
    def test_schemas_readme_exists(self):
        assert (ROOT / "schemas" / "README.md").is_file()

    def test_schemas_readme_has_required_sections(self):
        content = open(ROOT / "schemas" / "README.md").read()
        assert "How to Write a Schema" in content
        assert "How to Wire" in content
        assert "How to Test" in content
        assert "Existing Schemas" in content

    def test_pipelines_readme_exists(self):
        assert (ROOT / "pipelines" / "README.md").is_file()

    def test_pipelines_readme_has_required_sections(self):
        content = open(ROOT / "pipelines" / "README.md").read()
        assert "How to Write a Pipeline" in content
        assert "How to Wire" in content
        assert "How to Test" in content
        assert "Existing Pipelines" in content

    def test_adapters_readme_exists(self):
        assert (ROOT / "adapters" / "README.md").is_file()

    def test_adapters_readme_has_required_sections(self):
        content = open(ROOT / "adapters" / "README.md").read()
        assert "How to Write an Adapter" in content
        assert "How to Wire" in content
        assert "How to Test" in content
        assert "Existing Adapters" in content