Test an auth mechanism that uses a handshake.
()
| 1641 | |
| 1642 | |
| 1643 | def test_token_auth(): |
| 1644 | """Test an auth mechanism that uses a handshake.""" |
| 1645 | with EchoStreamFlightServer(auth_handler=token_auth_handler) as server, \ |
| 1646 | FlightClient(('localhost', server.port)) as client: |
| 1647 | action = flight.Action("who-am-i", b"") |
| 1648 | client.authenticate(TokenClientAuthHandler('test', 'p4ssw0rd')) |
| 1649 | identity = next(client.do_action(action)) |
| 1650 | assert identity.body.to_pybytes() == b'test' |
| 1651 | |
| 1652 | |
| 1653 | def test_token_auth_invalid(): |
nothing calls this directly
no test coverage detected