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

Function test_generic_options

python/pyarrow/tests/test_flight.py:2362–2382  ·  view source on GitHub ↗

Test setting generic client options.

()

Source from the content-addressed store, hash-verified

2360
2361@pytest.mark.requires_testing_data
2362def test_generic_options():
2363 """Test setting generic client options."""
2364 certs = example_tls_certs()
2365
2366 with ConstantFlightServer(tls_certificates=certs["certificates"]) as s:
2367 # Try setting a string argument that will make requests fail
2368 options = [("grpc.ssl_target_name_override", "fakehostname")]
2369 client = flight.connect(('localhost', s.port),
2370 tls_root_certs=certs["root_cert"],
2371 generic_options=options)
2372 with pytest.raises(flight.FlightUnavailableError):
2373 client.do_get(flight.Ticket(b'ints'))
2374 client.close()
2375 # Try setting an int argument that will make requests fail
2376 options = [("grpc.max_receive_message_length", 32)]
2377 client = flight.connect(('localhost', s.port),
2378 tls_root_certs=certs["root_cert"],
2379 generic_options=options)
2380 with pytest.raises((pa.ArrowInvalid, flight.FlightCancelledError)):
2381 client.do_get(flight.Ticket(b'ints'))
2382 client.close()
2383
2384
2385class CancelFlightServer(FlightServerBase):

Callers

nothing calls this directly

Calls 4

example_tls_certsFunction · 0.85
do_getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected