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