Test an auth mechanism that uses a handshake.
()
| 1603 | |
| 1604 | |
| 1605 | def test_token_auth(): |
| 1606 | """Test an auth mechanism that uses a handshake.""" |
| 1607 | with EchoStreamFlightServer(auth_handler=token_auth_handler) as server, \ |
| 1608 | FlightClient(('localhost', server.port)) as client: |
| 1609 | action = flight.Action("who-am-i", b"") |
| 1610 | client.authenticate(TokenClientAuthHandler('test', 'p4ssw0rd')) |
| 1611 | identity = next(client.do_action(action)) |
| 1612 | assert identity.body.to_pybytes() == b'test' |
| 1613 | |
| 1614 | |
| 1615 | def test_token_auth_invalid(): |
nothing calls this directly
no test coverage detected