MCPcopy
hub / github.com/encode/starlette / test_user_interface

Function test_user_interface

tests/test_authentication.py:212–220  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

210
211
212def test_user_interface(test_client_factory: TestClientFactory) -> None:
213 with test_client_factory(app) as client:
214 response = client.get("/")
215 assert response.status_code == 200
216 assert response.json() == {"authenticated": False, "user": ""}
217
218 response = client.get("/", auth=("tomchristie", "example"))
219 assert response.status_code == 200
220 assert response.json() == {"authenticated": True, "user": "tomchristie"}
221
222
223def test_authentication_required(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 3

test_client_factoryFunction · 0.85
jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected