当前位置: 首页>>代码示例>>Python>>正文


Python FakeSerializer.usr方法代码示例

本文整理汇总了Python中relengapi.blueprints.tokenauth.util.FakeSerializer.usr方法的典型用法代码示例。如果您正苦于以下问题:Python FakeSerializer.usr方法的具体用法?Python FakeSerializer.usr怎么用?Python FakeSerializer.usr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在relengapi.blueprints.tokenauth.util.FakeSerializer的用法示例。


在下文中一共展示了FakeSerializer.usr方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: assert_usr_token

# 需要导入模块: from relengapi.blueprints.tokenauth.util import FakeSerializer [as 别名]
# 或者: from relengapi.blueprints.tokenauth.util.FakeSerializer import usr [as 别名]
def assert_usr_token(data, **attrs):
    token = _get_token(data)
    attrs['typ'] = 'usr'
    attrs['id'] = id = token.id
    attrs['token'] = FakeSerializer.usr(id)
    attrs['disabled'] = False
    _eq_token(token, attrs)
开发者ID:b10n1k,项目名称:build-relengapi,代码行数:9,代码来源:test_tokenauth.py

示例2: test_query_usr_token_success_all

# 需要导入模块: from relengapi.blueprints.tokenauth.util import FakeSerializer [as 别名]
# 或者: from relengapi.blueprints.tokenauth.util.FakeSerializer import usr [as 别名]
def test_query_usr_token_success_all(client):
    """Querying a user token with base.tokens.usr.view.all returns the token."""
    res = client.post_json('/tokenauth/tokens/query',
                           FakeSerializer.usr(2))
    eq_(json.loads(res.data), {'result': usr_json})
开发者ID:b10n1k,项目名称:build-relengapi,代码行数:7,代码来源:test_tokenauth.py

示例3: test_query_usr_token_forbidden_not_mine

# 需要导入模块: from relengapi.blueprints.tokenauth.util import FakeSerializer [as 别名]
# 或者: from relengapi.blueprints.tokenauth.util.FakeSerializer import usr [as 别名]
def test_query_usr_token_forbidden_not_mine(client):
    """Querying a user token with base.tokens.usr.view.my gives 403
    if the token email doesn't match the request email"""
    res = client.post_json('/tokenauth/tokens/query',
                           FakeSerializer.usr(2))
    eq_(res.status_code, 403)
开发者ID:b10n1k,项目名称:build-relengapi,代码行数:8,代码来源:test_tokenauth.py

示例4: test_query_usr_token_forbidden

# 需要导入模块: from relengapi.blueprints.tokenauth.util import FakeSerializer [as 别名]
# 或者: from relengapi.blueprints.tokenauth.util.FakeSerializer import usr [as 别名]
def test_query_usr_token_forbidden(client):
    """Querying a user token without permission results in a 403"""
    res = client.post_json('/tokenauth/tokens/query',
                           FakeSerializer.usr(2))
    eq_(res.status_code, 403)
开发者ID:b10n1k,项目名称:build-relengapi,代码行数:7,代码来源:test_tokenauth.py

示例5: test_query_usr_token_success_mine

# 需要导入模块: from relengapi.blueprints.tokenauth.util import FakeSerializer [as 别名]
# 或者: from relengapi.blueprints.tokenauth.util.FakeSerializer import usr [as 别名]
def test_query_usr_token_success_mine(client):
    """Querying a user token with base.tokens.usr.view.my returns the
    token if the emails match"""
    res = client.post_json('/tokenauth/tokens/query',
                           FakeSerializer.usr(2))
    assert_result(res.data, usr_json)
开发者ID:azizadnan,项目名称:build-relengapi,代码行数:8,代码来源:test_tokenauth.py


注:本文中的relengapi.blueprints.tokenauth.util.FakeSerializer.usr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。