-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5881457
commit fcd8b62
Showing
5 changed files
with
273 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ __pycache__/ | |
build/ | ||
.python-version | ||
logs/ | ||
|
||
# Test | ||
.coverage |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
from fastapi import FastAPI | ||
from fastapi.testclient import TestClient | ||
from src.health.controllers.health_controller import HealthController | ||
from src.health.services.health_service import HealthService | ||
|
||
|
||
@pytest.fixture | ||
def app() -> FastAPI: | ||
app = FastAPI() | ||
health_service = HealthService() | ||
health_controller = HealthController(health_service) | ||
app.include_router(health_controller.get_router(), prefix="/api/v1/health") | ||
return app | ||
|
||
|
||
@pytest.fixture | ||
def client(app: FastAPI) -> TestClient: | ||
"""Create a TestClient for the app""" | ||
return TestClient(app) | ||
|
||
|
||
def test_health_check(client: TestClient): | ||
"""Test the health check endpoint for a successful response.""" | ||
response = client.get("/api/v1/health") | ||
|
||
assert response.status_code == 200 |