コード例 #1
0
ファイル: tokens_test.py プロジェクト: bkolobara/indico
def test_grant_get(mocker):
    mocker.patch.object(OAuthGrant, '_cache')
    client_id = str(uuid4())
    code = 'foobar'
    OAuthGrant.get(client_id, code)
    key = OAuthGrant.make_key(client_id, code)
    OAuthGrant._cache.get.assert_called_with(key)
コード例 #2
0
ファイル: tokens_test.py プロジェクト: vireshbackup/indico
def test_grant_get(mocker):
    mocker.patch.object(OAuthGrant, '_cache')
    client_id = str(uuid4())
    code = 'foobar'
    OAuthGrant.get(client_id, code)
    key = OAuthGrant.make_key(client_id, code)
    OAuthGrant._cache.get.assert_called_with(key)
コード例 #3
0
ファイル: tokens_test.py プロジェクト: bkolobara/indico
def test_grant_make_key():
    client_id = str(uuid4())
    code = 'foobar'
    key = '{}:{}'.format(client_id, code)
    assert OAuthGrant.make_key(client_id, code) == key
コード例 #4
0
ファイル: tokens_test.py プロジェクト: vireshbackup/indico
def test_grant_make_key():
    client_id = str(uuid4())
    code = 'foobar'
    key = '{}:{}'.format(client_id, code)
    assert OAuthGrant.make_key(client_id, code) == key
コード例 #5
0
ファイル: tokens_test.py プロジェクト: mkopcic/indico
def test_grant_make_key():
    client_id = str(uuid4())
    code = 'foobar'
    key = f'{client_id}:{code}'
    assert OAuthGrant.make_key(client_id, code) == key