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