feat(v0.2.0): complete data pipeline with loaders, database, and validation

This commit is contained in:
0x_n3m0_
2026-01-05 11:54:04 +02:00
parent b5e7043df6
commit 0079127ade
7 changed files with 792 additions and 124 deletions

View File

@@ -41,23 +41,27 @@ def test_init_database(temp_db):
def test_get_db_session(temp_db):
"""Test database session context manager."""
from sqlalchemy import text
init_database(create_tables=True)
with get_db_session() as session:
assert session is not None
# Session should be usable
result = session.execute("SELECT 1").scalar()
result = session.execute(text("SELECT 1")).scalar()
assert result == 1
def test_session_rollback_on_error(temp_db):
"""Test that session rolls back on error."""
from sqlalchemy import text
init_database(create_tables=True)
try:
with get_db_session() as session:
# Cause an error
session.execute("SELECT * FROM nonexistent_table")
session.execute(text("SELECT * FROM nonexistent_table"))
except Exception:
pass # Expected