MCPcopy Create free account
hub / github.com/apache/arrow / test_server_middleware_same_thread

Function test_server_middleware_same_thread

python/pyarrow/tests/test_flight.py:2139–2148  ·  view source on GitHub ↗

Ensure that server middleware run on the same thread as the RPC.

()

Source from the content-addressed store, hash-verified

2137
2138
2139def test_server_middleware_same_thread():
2140 """Ensure that server middleware run on the same thread as the RPC."""
2141 with HeaderFlightServer(middleware={
2142 "test": HeaderServerMiddlewareFactory(),
2143 }) as server, \
2144 FlightClient(('localhost', server.port)) as client:
2145 results = list(client.do_action(flight.Action(b"test", b"")))
2146 assert len(results) == 1
2147 value = results[0].body.to_pybytes()
2148 assert b"right value" == value
2149
2150
2151def test_middleware_reject():

Callers

nothing calls this directly

Calls 6

FlightClientClass · 0.90
HeaderFlightServerClass · 0.85
listFunction · 0.85
lenFunction · 0.85
do_actionMethod · 0.45

Tested by

no test coverage detected