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

Function test_tls_fails

python/pyarrow/tests/test_flight.py:1736–1747  ·  view source on GitHub ↗

Make sure clients cannot connect when cert verification fails.

()

Source from the content-addressed store, hash-verified

1734@pytest.mark.slow
1735@pytest.mark.requires_testing_data
1736def test_tls_fails():
1737 """Make sure clients cannot connect when cert verification fails."""
1738 certs = example_tls_certs()
1739
1740 # Ensure client doesn't connect when certificate verification
1741 # fails (this is a slow test since gRPC does retry a few times)
1742 with ConstantFlightServer(tls_certificates=certs["certificates"]) as s, \
1743 FlightClient("grpc+tls://localhost:" + str(s.port)) as client:
1744 # gRPC error messages change based on version, so don't look
1745 # for a particular error
1746 with pytest.raises(flight.FlightUnavailableError):
1747 client.do_get(flight.Ticket(b'ints')).read_all()
1748
1749
1750@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