Skip to content

Commit

Permalink
Create api_client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DoganK01 authored Nov 23, 2024
1 parent 4fa4de0 commit 9b1b95f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/fixtures/api_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Fixtures for FastAPI test client."""

import pytest
from fastapi.testclient import TestClient

from files_api.main import create_app
from files_api.settings import Settings
from tests.consts import TEST_BUCKET_NAME


# pylint: disable=unused-argument
@pytest.fixture
def client(mocked_aws, mocked_openai) -> TestClient:
"""Pytest fixture to provide a FastAPI test client."""
settings: Settings = Settings(s3_bucket_name=TEST_BUCKET_NAME)
app = create_app(settings=settings)
with TestClient(app) as client:
yield client

0 comments on commit 9b1b95f

Please sign in to comment.