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

Function test_tls_fails

python/pyarrow/tests/test_flight.py:1774–1785  ·  view source on GitHub ↗

Make sure clients cannot connect when cert verification fails.

()

Source from the content-addressed store, hash-verified

1772@pytest.mark.slow
1773@pytest.mark.requires_testing_data
1774def test_tls_fails():
1775 """Make sure clients cannot connect when cert verification fails."""
1776 certs = example_tls_certs()
1777
1778 # Ensure client doesn't connect when certificate verification
1779 # fails (this is a slow test since gRPC does retry a few times)
1780 with ConstantFlightServer(tls_certificates=certs["certificates"]) as s, \
1781 FlightClient("grpc+tls://localhost:" + str(s.port)) as client:
1782 # gRPC error messages change based on version, so don't look
1783 # for a particular error
1784 with pytest.raises(flight.FlightUnavailableError):
1785 client.do_get(flight.Ticket(b'ints')).read_all()
1786
1787
1788@pytest.mark.requires_testing_data

Callers

nothing calls this directly

Calls 4

FlightClientClass · 0.90
example_tls_certsFunction · 0.85
do_getMethod · 0.45

Tested by

no test coverage detected