make tests pass
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Elizabeth Hunt 2024-08-07 20:32:52 -07:00
parent c60dd310f9
commit b5f145ecf3
Signed by: simponic
GPG Key ID: 2909B9A7FF6213EE
1 changed files with 4 additions and 8 deletions

View File

@ -12,11 +12,7 @@ def test_healthcheck():
assert response.status_code == HTTPStatus.OK assert response.status_code == HTTPStatus.OK
assert response.text == "" assert response.text == ""
def test_main():
def test_read_main(): response = client.get("/")
# Example of testing logging using a context manager assert response.status_code == HTTPStatus.OK
with capture_logs() as cap_logs: assert response.text.startswith("<!DOCTYPE html>")
response = client.get("/")
assert {"event": "In root path", "log_level": "info"} in cap_logs
assert response.status_code == HTTPStatus.OK
assert response.json() == {"msg": "Hello World"}