當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。