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

Function test_get_local_addr

tests/protocols/test_utils.py:67–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65
66
67def test_get_local_addr():
68 transport = MockTransport({"sockname": "path/to/unix-domain-socket"})
69 assert get_local_addr(transport) == ("path/to/unix-domain-socket", None)
70
71 transport = MockTransport({"sockname": ("123.45.6.7", 123)})
72 assert get_local_addr(transport) == ("123.45.6.7", 123)
73
74 transport = MockTransport({})
75 assert get_local_addr(transport) is None
76
77
78def test_get_remote_addr():

Callers

nothing calls this directly

Calls 2

get_local_addrFunction · 0.90
MockTransportClass · 0.70

Tested by

no test coverage detected