refactor(auth): improve code structure and add user registration endpoint

refactor(main): update index route response and remove greeting service

refactor(decorators): streamline authentication decorators and remove unused ones

test(routes): update tests to reflect changes in main routes and error messages
This commit is contained in:
JSC
2025-06-28 20:47:45 +02:00
parent 85f420d2f7
commit 52c60db811
6 changed files with 180 additions and 247 deletions

View File

@@ -21,19 +21,7 @@ class TestMainRoutes:
"""Test the index route."""
response = client.get("/api/")
assert response.status_code == 200
assert response.get_json() == {"message": "Hello from backend!"}
def test_hello_route_without_name(self, client) -> None:
"""Test hello route without name parameter."""
response = client.get("/api/hello")
assert response.status_code == 200
assert response.get_json() == {"message": "Hello from backend!"}
def test_hello_route_with_name(self, client) -> None:
"""Test hello route with name parameter."""
response = client.get("/api/hello/Alice")
assert response.status_code == 200
assert response.get_json() == {"message": "Hello, Alice!"}
assert response.get_json() == {"message": "API is running", "status": "ok"}
def test_health_route(self, client) -> None:
"""Test health check route."""
@@ -46,4 +34,4 @@ class TestMainRoutes:
response = client.get("/api/protected")
assert response.status_code == 401
data = response.get_json()
assert data["error"] == "Authentication required"
assert data["error"] == "Authentication required (JWT or API token)"