Added URL stats retrieval with tests

This commit is contained in:
2026-03-02 10:45:06 +02:00
parent d3778d1171
commit d5a530a30d
2 changed files with 29 additions and 2 deletions
+9 -1
View File
@@ -4,10 +4,18 @@ import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from app.main import app
from app.main import settings
import tempfile
import pytest
client = TestClient(app)
@pytest.fixture(autouse=True)
def use_temp_db():
with tempfile.NamedTemporaryFile() as tmp:
settings.database_url = tmp.name
yield
def test_home():
response = client.get("/")
assert response.status_code == 200