Created
January 3, 2022 07:28
-
-
Save Goldziher/086b980e6b959374666987cc6c9c4d9c to your computer and use it in GitHub Desktop.
Example starlite test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starlette.status import HTTP_200_OK | |
from starlite import create_test_client | |
from my_app.main import health_check | |
def test_health_check(): | |
with create_test_client(route_handlers=[health_check]) as client: | |
response = client.get("/health-check") | |
assert response.status_code == HTTP_200_OK | |
assert response.text == "healthy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment