def test_response_types_to_grant_types(): req_args = ['code'] assert set( response_types_to_grant_types(req_args)) == {'authorization_code'} req_args = ['code', 'code id_token'] assert set(response_types_to_grant_types(req_args)) == { 'authorization_code', 'implicit' } req_args = ['code', 'id_token code', 'code token id_token'] assert set(response_types_to_grant_types(req_args)) == { 'authorization_code', 'implicit' } with pytest.raises(ValueError): response_types_to_grant_types(['foobar openid'])
def test_response_types_to_grant_types(): req_args = ['code'] assert set( response_types_to_grant_types(req_args)) == {'authorization_code'} req_args = ['code', 'code id_token'] assert set( response_types_to_grant_types(req_args)) == {'authorization_code', 'implicit'} req_args = ['code', 'id_token code', 'code token id_token'] assert set( response_types_to_grant_types(req_args)) == {'authorization_code', 'implicit'} req_args = ['code', 'id_token code', 'code token id_token'] kwargs = {'grant_types': ['refresh_token', 'authorization_code']} assert set( response_types_to_grant_types(req_args, **kwargs)) == {'authorization_code', 'implicit', 'refresh_token'} with pytest.raises(ValueError): response_types_to_grant_types(['foobar openid'])
def test_response_types_to_grant_types(): req_args = ["code"] assert set(response_types_to_grant_types(req_args)) == {"authorization_code"} req_args = ["code", "code id_token"] assert set(response_types_to_grant_types(req_args)) == { "authorization_code", "implicit", } req_args = ["code", "id_token code", "code token id_token"] assert set(response_types_to_grant_types(req_args)) == { "authorization_code", "implicit", } req_args = ["code", "id_token code", "code token id_token"] kwargs = {"grant_types": ["refresh_token", "authorization_code"]} assert set(response_types_to_grant_types(req_args, **kwargs)) == { "authorization_code", "implicit", "refresh_token", } with pytest.raises(ValueError): response_types_to_grant_types(["foobar openid"])