Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit a3c9133

Browse files
Implements Integration Tests (#37)
1 parent 25d9487 commit a3c9133

File tree

6 files changed

+25
-2
lines changed

6 files changed

+25
-2
lines changed

conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import pytest
2+
from fastapi.testclient import TestClient
3+
from typing import Iterator
4+
from app import app
5+
6+
7+
@pytest.fixture
8+
def client() -> Iterator[TestClient]:
9+
with TestClient(app) as client:
10+
yield client

dev.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ WORKDIR /app
44

55
VOLUME ["/app"]
66

7-
COPY requirements.txt .
7+
COPY requirements*.txt .
88

9-
RUN pip3 install --no-cache-dir -r requirements.txt
9+
RUN pip3 install --no-cache-dir -r requirements-dev.txt
1010

1111
COPY / .
1212

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-r requirements.txt
2+
httpx==0.25.0
3+
pytest==8.1.1

run-tests

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker exec -it refinery-gateway-proxy sh -c "cd /app && python3 -m pytest -v"

tests/__init__.py

Whitespace-only changes.

tests/test_app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from fastapi.testclient import TestClient
2+
3+
4+
def test_healthcheck(client: TestClient):
5+
response = client.get("/healthcheck")
6+
assert response.status_code == 200
7+
assert response.text == "OK"

0 commit comments

Comments
 (0)