Coverage for src/tests/api/v1/auth/endpoints/test_validate.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2024-01-01 00:00 +0000

1"""Module for testing the v1/auth/validation endpoint.""" 

2 

3import pytest 

4 

5from fastapi.testclient import TestClient 

6 

7 

8pytestmark = [pytest.mark.api, pytest.mark.db] 

9 

10 

11def test_without_tokens(client: TestClient): 

12 """Test the validation api without tokens.""" 

13 response = client.get("/api/v1/auth/validate") 

14 assert response.status_code == 401 

15 

16 

17def test_with_valid_tokens(secure_client: TestClient): 

18 """Test the validation api without tokens.""" 

19 response = secure_client.get("/api/v1/auth/validate") 

20 assert response.status_code == 200