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

Function test_http_basic_auth

python/pyarrow/tests/test_flight.py:1619–1629  ·  view source on GitHub ↗

Test a Python implementation of HTTP basic authentication.

()

Source from the content-addressed store, hash-verified

1617@pytest.mark.skipif(os.name == 'nt',
1618 reason="ARROW-10013: gRPC on Windows corrupts peer()")
1619def test_http_basic_auth():
1620 """Test a Python implementation of HTTP basic authentication."""
1621 with EchoStreamFlightServer(auth_handler=basic_auth_handler) as server, \
1622 FlightClient(('localhost', server.port)) as client:
1623 action = flight.Action("who-am-i", b"")
1624 client.authenticate(HttpBasicClientAuthHandler('test', 'p4ssw0rd'))
1625 results = client.do_action(action)
1626 identity = next(results)
1627 assert identity.body.to_pybytes() == b'test'
1628 peer_address = next(results)
1629 assert peer_address.body.to_pybytes() != b''
1630
1631
1632def 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