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

Function test_generic_options

python/pyarrow/tests/test_flight.py:2400–2420  ·  view source on GitHub ↗

Test setting generic client options.

()

Source from the content-addressed store, hash-verified

2398
2399@pytest.mark.requires_testing_data
2400def test_generic_options():
2401 """Test setting generic client options."""
2402 certs = example_tls_certs()
2403
2404 with ConstantFlightServer(tls_certificates=certs["certificates"]) as s:
2405 # Try setting a string argument that will make requests fail
2406 options = [("grpc.ssl_target_name_override", "fakehostname")]
2407 client = flight.connect(('localhost', s.port),
2408 tls_root_certs=certs["root_cert"],
2409 generic_options=options)
2410 with pytest.raises(flight.FlightUnavailableError):
2411 client.do_get(flight.Ticket(b'ints'))
2412 client.close()
2413 # Try setting an int argument that will make requests fail
2414 options = [("grpc.max_receive_message_length", 32)]
2415 client = flight.connect(('localhost', s.port),
2416 tls_root_certs=certs["root_cert"],
2417 generic_options=options)
2418 with pytest.raises((pa.ArrowInvalid, flight.FlightCancelledError)):
2419 client.do_get(flight.Ticket(b'ints'))
2420 client.close()
2421
2422
2423class 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