Skip to content

Commit

Permalink
Add test to route /
Browse files Browse the repository at this point in the history
  • Loading branch information
BraunRudolf committed Oct 9, 2024
1 parent 90a3102 commit 8cdb1a3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions backend-app/tests/unit/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,22 @@ async def test_get_current_admin_not_active_not_admin(

assert exc_info.value.status_code == 400
assert exc_info.value.detail == "Inactive user"


def test_api_helth_check(client):
# GET request
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"Status": "Something Different"}


def test_health_check_post(client):
# POST request to a GET-only route
response = client.post("/")
assert response.status_code == 405 # Method Not Allowed


def test_health_check_wrong_url(client):
# Wrong URL
response = client.get("/wrong-url")
assert response.status_code == 404 # Not Found

0 comments on commit 8cdb1a3

Please sign in to comment.