Files
romm/backend/endpoints/tests/test_platform.py
Georges-Antoine Assi a53c0911d7 fix endpoint tests
2024-08-05 11:35:08 -04:00

23 lines
522 B
Python

import pytest
from fastapi.testclient import TestClient
from main import app
@pytest.fixture
def client():
with TestClient(app) as client:
yield client
def test_get_platforms(client, access_token, platform):
response = client.get("/api/platforms")
assert response.status_code == 403
response = client.get(
"/api/platforms", headers={"Authorization": f"Bearer {access_token}"}
)
assert response.status_code == 200
platforms = response.json()
assert len(platforms) == 1