from pathlib import Path


MODELS_DIR = Path(__file__).resolve().parents[1] / "src" / "aceiot_cim_rdf" / "cim_pydantic" / "models"


def test_profile_modules_contain_model_definitions():
    profile_modules = [
        path
        for path in MODELS_DIR.glob("*.py")
        if path.name not in {"__init__.py", "all.py"}
    ]

    assert profile_modules
    contents = [path.read_text() for path in profile_modules]

    assert all("from .all import" not in content for content in contents)
    assert sum("class " in content for content in contents) > 1


def test_all_module_is_only_compatibility_aggregate():
    content = (MODELS_DIR / "all.py").read_text()

    assert "Compatibility aggregate" in content
    assert "class " not in content
