Test setting generic client options.
()
| 2398 | |
| 2399 | @pytest.mark.requires_testing_data |
| 2400 | def 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 | |
| 2423 | class CancelFlightServer(FlightServerBase): |
nothing calls this directly
no test coverage detected