MCPcopy
hub / github.com/encode/uvicorn / test_run

Function test_run

tests/test_ssl.py:23–42  ·  tests/test_ssl.py::test_run
(
    tls_ca_ssl_context,
    tls_certificate_server_cert_path,
    tls_certificate_private_key_path,
    tls_ca_certificate_pem_path,
    unused_tcp_port: int,
)

Source from the content-addressed store, hash-verified

21
22@pytest.mark.anyio
23async def test_run(
24 tls_ca_ssl_context,
25 tls_certificate_server_cert_path,
26 tls_certificate_private_key_path,
27 tls_ca_certificate_pem_path,
28 unused_tcp_port: int,
29):
30 config = Config(
31 app=app,
32 loop=class="st">"asyncio",
33 limit_max_requests=1,
34 ssl_keyfile=tls_certificate_private_key_path,
35 ssl_certfile=tls_certificate_server_cert_path,
36 ssl_ca_certs=tls_ca_certificate_pem_path,
37 port=unused_tcp_port,
38 )
39 async with run_server(config):
40 async with httpx.AsyncClient(verify=tls_ca_ssl_context) as client:
41 response = await client.get(fclass="st">"https://127.0.0.1:{unused_tcp_port}")
42 assert response.status_code == 204
43
44
45@pytest.mark.anyio

Callers

nothing calls this directly

Calls 2

ConfigClass · 0.90
run_serverFunction · 0.90

Tested by

no test coverage detected