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:2101–2110  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2099
2100
2101def test_server_middleware_same_thread():
2102 """Ensure that server middleware run on the same thread as the RPC."""
2103 with HeaderFlightServer(middleware={
2104 "test": HeaderServerMiddlewareFactory(),
2105 }) as server, \
2106 FlightClient(('localhost', server.port)) as client:
2107 results = list(client.do_action(flight.Action(b"test", b"")))
2108 assert len(results) == 1
2109 value = results[0].body.to_pybytes()
2110 assert b"right value" == value
2111
2112
2113def 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