def test_oauth_scheme(self, mock_exchange_token, auth_config_with_exchanged):
    """Test with an OAuth auth scheme."""
    mock_exchange_token.return_value = AuthCredential(
        auth_type=AuthCredentialTypes.OAUTH2,
        oauth2=OAuth2Auth(access_token="exchanged_token"),
    )

    handler = AuthHandler(auth_config_with_exchanged)
    state = MockState()

    handler.parse_and_store_auth_response(state)

    credential_key = auth_config_with_exchanged.get_credential_key()
    assert state["temp:" + credential_key] == mock_exchange_token.return_value
    assert mock_exchange_token.called
Test with an OAuth auth scheme.
tests/unittests/auth/test_auth_handler.py