File size: 453 Bytes
85f36c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from fastapi.testclient import TestClient

from app.main import app

client = TestClient(app)


def test_health() -> None:
    response = client.get("/api/health")
    assert response.status_code == 200
    assert response.json()["ok"] is True


def test_home_and_sample() -> None:
    assert client.get("/").status_code == 200
    sample = client.get("/api/sample")
    assert sample.status_code == 200
    assert "half-cent" in sample.json()["issue"]