marimo-on-fastapi / tests /test_main.py
pup-py's picture
TestClient
7605e10
raw
history blame contribute delete
509 Bytes
from fastapi.testclient import TestClient
from src.main import app
client = TestClient(app)
def test_get_root_redirects():
response = client.get("/", follow_redirects=True)
assert response.status_code == 200
response = client.get("/", follow_redirects=False)
assert response.status_code == 307
assert response.headers["location"] == "/home"
def test_get_home():
response = client.get("/home/")
assert response.status_code == 200
assert "marimo-filename" in response.text