mirror of https://github.com/encode/starlette.git
13 lines
341 B
Python
13 lines
341 B
Python
from starlette import asgi_application, Response, TestClient
|
|
|
|
|
|
def test_text_response():
|
|
@asgi_application
|
|
def app(request):
|
|
return Response("hello, world", media_type="text/plain")
|
|
|
|
client = TestClient(app)
|
|
response = client.get("/")
|
|
assert response.status_code == 200
|
|
assert response.text == "hello, world"
|