Example #1
0
def test_grant_update():
    ar = AuthorizationResponse(code="code", state="state")

    grant = Grant()
    grant.update(ar)

    assert grant
    assert grant.code == "code"
Example #2
0
def test_grant_update():
    ar = AuthorizationResponse(code="code", state="state")

    grant = Grant()
    grant.update(ar)

    assert grant
    assert grant.code == "code"
Example #3
0
def test_grant_add_token():
    grant = Grant()
    grant.update(ACC_TOK_RESP)

    assert len(grant.tokens) == 1
    token = grant.tokens[0]

    assert token.access_token == "2YotnFZFEjr1zCsicMWpAA"
    assert token.token_type == "example"
    assert token.refresh_token == "tGzv3JOkF0XG5Qx2TlKWIA"
Example #4
0
def test_grant_add_token():
    grant = Grant()
    grant.update(ACC_TOK_RESP)

    assert len(grant.tokens) == 1
    token = grant.tokens[0]

    assert token.access_token == "2YotnFZFEjr1zCsicMWpAA"
    assert token.token_type == "example"
    assert token.refresh_token == "tGzv3JOkF0XG5Qx2TlKWIA"
Example #5
0
def test_grant_set_3():
    err = ErrorResponse(error="invalid_request")
    grant = Grant()
    grant.update(err)

    assert len(grant.tokens) == 0
Example #6
0
def test_grant_set_3():
    err = ErrorResponse(error="invalid_request")
    grant = Grant()
    grant.update(err)

    assert len(grant.tokens) == 0