feat: add SQLiteUserRepository with tests

This commit is contained in:
Johan Lundberg 2026-02-13 13:27:02 +01:00
parent 6c4ba79eed
commit d941209f1e
No known key found for this signature in database
GPG key ID: A6C152738D03C7D1
3 changed files with 356 additions and 0 deletions

View file

@ -0,0 +1,20 @@
from pathlib import Path
import aiosqlite
import pytest
from fastapi_oidc_op.store.sqlite.migrations import run_migrations
MIGRATIONS_DIR = (
Path(__file__).resolve().parent.parent.parent / "src" / "fastapi_oidc_op" / "store" / "sqlite" / "migrations"
)
@pytest.fixture
async def db():
conn = await aiosqlite.connect(":memory:")
conn.row_factory = aiosqlite.Row
await conn.execute("PRAGMA foreign_keys=ON")
await run_migrations(conn, MIGRATIONS_DIR)
yield conn
await conn.close()