Add the experience service with sites through analytics/AI hooks, migrations through 0011, and phase docs/manifests marking the track complete. Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
728 B
Python
20 lines
728 B
Python
"""Layering / dependency checks."""
|
|
from pathlib import Path
|
|
|
|
|
|
def test_api_modules_do_not_import_models_directly():
|
|
api_root = Path(__file__).resolve().parents[1] / "api" / "v1"
|
|
for path in api_root.glob("*.py"):
|
|
if path.name == "__init__.py":
|
|
continue
|
|
text = path.read_text(encoding="utf-8")
|
|
assert "from app.models" not in text, path.name
|
|
assert "import app.models" not in text, path.name
|
|
|
|
|
|
def test_repositories_do_not_import_services():
|
|
repo_root = Path(__file__).resolve().parents[1] / "repositories"
|
|
for path in repo_root.glob("*.py"):
|
|
text = path.read_text(encoding="utf-8")
|
|
assert "from app.services" not in text, path.name
|