Files
trading-journal/backend/tests/test_main.py

23 lines
494 B
Python
Raw Normal View History

2025-09-11 18:24:36 +00:00
import pytest
from fastapi.testclient import TestClient
from app import app
@pytest.fixture
def client():
with TestClient(app) as client:
yield client
def test_home_route(client):
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"message": "Hello"}
def test_about_route(client):
response = client.get("/about")
assert response.status_code == 200
assert response.json() == {"message": "This is the about page."}