Publish curated MobilityOps source snapshot

This commit is contained in:
Jens committed 2026-09-29 22:03:33 +02:00
commit 7adc072f5e
317 files changed
+48851

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
import pytest
from fastapi.testclient import TestClient
from app.core.db import Base, SessionLocal, engine
from app.main import app
from app.seed_loader import reset_and_seed
@pytest.fixture(scope="session", autouse=True)
def _seeded_database():
Base.metadata.create_all(engine)
db = SessionLocal()
try:
reset_and_seed(db)
finally:
db.close()
yield
@pytest.fixture
def client() -> TestClient:
return TestClient(app)
def login(client: TestClient, role: str) -> TestClient:
response = client.post("/api/v1/demo/login", json={"role": role})
assert response.status_code == 200
return client
@pytest.fixture
def ops_client(client: TestClient) -> TestClient:
return login(client, "operations_manager")
@pytest.fixture
def employee_client(client: TestClient) -> TestClient:
return login(client, "rental_employee")