Marc Cataford
ee9a9d8dc3
* build(backend): more verbosity on test + error handling * fix(backend): raise HTTPException, not return on details fetch * fix(backend): get inserted ID instead of row tuple * test(backend): add tests for list + details routes
16 lines
363 B
Python
16 lines
363 B
Python
from fastapi.testclient import TestClient
|
|
import pytest
|
|
|
|
from rotini.main import app
|
|
from rotini.db import get_connection
|
|
|
|
|
|
@pytest.fixture(name="client")
|
|
def fixture_client():
|
|
return TestClient(app)
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def reset_database():
|
|
with get_connection() as conn, conn.cursor() as cursor:
|
|
cursor.execute("DELETE FROM files;")
|