TorbatYar/backend/services/experience/app/tests/test_dependency.py
Mortezakoohjani 203671a7bf feat(experience): ship Experience Platform phases 11.0-11.10
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>
2026-07-27 11:43:10 +03:30

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