Test a Python implementation of HTTP basic authentication.
()
| 1579 | @pytest.mark.skipif(os.name == 'nt', |
| 1580 | reason="ARROW-10013: gRPC on Windows corrupts peer()") |
| 1581 | def 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 | |
| 1594 | def test_http_basic_auth_invalid_password(): |
nothing calls this directly
no test coverage detected