feat: add SQLAlchemy database layer with get_db dependency

This commit is contained in:
Oliver Hofmann
2026-04-27 09:34:44 +02:00
parent f6587b813e
commit ca2c9d4e18
2 changed files with 38 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
from sqlalchemy.orm import Session
from app.core.database import Base, get_db
def test_get_db_yields_session():
gen = get_db()
db = next(gen)
assert isinstance(db, Session)
try:
next(gen)
except StopIteration:
pass
def test_base_has_metadata():
assert Base.metadata is not None