mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
25 lines
526 B
Python
25 lines
526 B
Python
from os import environ
|
|
|
|
import pytest
|
|
from fastapi import FastAPI
|
|
from httpx import AsyncClient
|
|
|
|
environ["ARGOS_APP_ENV"] = "test"
|
|
|
|
|
|
@pytest.fixture
|
|
def app() -> FastAPI:
|
|
from argos.server.main import get_application # local import for testing purpose
|
|
|
|
return get_application()
|
|
|
|
|
|
@pytest.fixture
|
|
def authorized_client(
|
|
client: AsyncClient, token: str, authorization_prefix: str
|
|
) -> AsyncClient:
|
|
client.headers = {
|
|
"Authorization": f"Bearer {token}",
|
|
**client.headers,
|
|
}
|
|
return client
|