def test_grant_update(): ar = AuthorizationResponse(code="code", state="state") grant = Grant() grant.update(ar) assert grant assert grant.code == "code"
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"
def test_grant_set_3(): err = ErrorResponse(error="invalid_request") grant = Grant() grant.update(err) assert len(grant.tokens) == 0