Exemplo n.º 1
0
def test_grant_set():
    ar = AuthorizationResponse(code="code", state="state")

    grant = Grant.from_code(ar)

    assert grant
    assert grant.code == "code"
Exemplo n.º 2
0
def test_grant_set():
    ar = AuthorizationResponse(code="code", state="state")

    grant = Grant.from_code(ar)

    assert grant
    assert grant.code == "code"
Exemplo n.º 3
0
def test_grant_resp():
    resp = AuthorizationResponse(code="code", state="state")
    grant = Grant()
    grant.add_code(resp)

    assert grant.code == "code"
    assert grant.grant_expiration_time != 0

    grant = Grant(1)
    grant.add_code(resp)
    time.sleep(2)

    assert grant.is_valid() is False

    grant = Grant.from_code(resp)
    assert grant.code == "code"
    assert grant.grant_expiration_time != 0
Exemplo n.º 4
0
def test_grant_resp():
    resp = AuthorizationResponse(code="code", state="state")
    grant = Grant()
    grant.add_code(resp)

    assert grant.code == "code"
    assert grant.grant_expiration_time != 0

    grant = Grant(1)
    grant.add_code(resp)
    time.sleep(2)

    assert grant.is_valid() is False

    grant = Grant.from_code(resp)
    assert grant.code == "code"
    assert grant.grant_expiration_time != 0