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

Function test_http_basic_auth

python/pyarrow/tests/test_flight.py:1581–1591  ·  view source on GitHub ↗

Test a Python implementation of HTTP basic authentication.

()

Source from the content-addressed store, hash-verified

1579@pytest.mark.skipif(os.name == 'nt',
1580 reason="ARROW-10013: gRPC on Windows corrupts peer()")
1581def test_http_basic_auth():
1582 """Test a Python implementation of HTTP basic authentication."""
1583 with EchoStreamFlightServer(auth_handler=basic_auth_handler) as server, \
1584 FlightClient(('localhost', server.port)) as client:
1585 action = flight.Action("who-am-i", b"")
1586 client.authenticate(HttpBasicClientAuthHandler('test', 'p4ssw0rd'))
1587 results = client.do_action(action)
1588 identity = next(results)
1589 assert identity.body.to_pybytes() == b'test'
1590 peer_address = next(results)
1591 assert peer_address.body.to_pybytes() != b''
1592
1593
1594def test_http_basic_auth_invalid_password():

Callers

nothing calls this directly

Calls 5

FlightClientClass · 0.90
authenticateMethod · 0.45
do_actionMethod · 0.45

Tested by

no test coverage detected