update GitHub WorkFlow

This commit is contained in:
2025-01-04 17:11:47 +01:00
parent 94b25b2807
commit 436d012475
2 changed files with 34 additions and 4 deletions

29
tests/test_app.py Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright Hersel Giannella
import pytest
import httpx
BASE_URL = "http://127.0.0.1:5000"
@pytest.mark.asyncio
async def test_home_route():
"""
Testa la route principale del Blueprint `route_home`.
"""
async with httpx.AsyncClient(base_url=BASE_URL) as client:
response = await client.get("/")
assert response.status_code == 200
assert "Welcome" in response.text
@pytest.mark.asyncio
async def test_404_route():
"""
Verifica la gestione di una route inesistente.
"""
async with httpx.AsyncClient(base_url=BASE_URL) as client:
response = await client.get("/nonexistent")
assert response.status_code == 404