Exemplo n.º 1
0
def test_claims_deser():
    pre = Claims(name={"essential": True}, nickname=None,
                   email={"essential": True},
                   email_verified={"essential": True}, picture=None)

    claims = claims_deser(pre.to_json(), format="json")
    assert _eq(claims.keys(), ['name', 'nickname', 'email', 'email_verified',
                               'picture'])

    claims = claims_deser(pre.to_dict(), format="dict")
    assert _eq(claims.keys(), ['name', 'nickname', 'email', 'email_verified',
                           'picture'])
Exemplo n.º 2
0
def test_claims_deser_dict():
    pre = Claims(name={"essential": True}, nickname=None,
                 email={"essential": True},
                 email_verified={"essential": True}, picture=None)

    claims = claims_deser(pre.to_json(), sformat="json")
    assert _eq(claims.keys(), ['name', 'nickname', 'email', 'email_verified',
                               'picture'])

    claims = claims_deser(pre.to_dict(), sformat="dict")
    assert _eq(claims.keys(), ['name', 'nickname', 'email', 'email_verified',
                               'picture'])
Exemplo n.º 3
0
def test_claims_deser_dict():
    pre = Claims(
        name={"essential": True},
        nickname=None,
        email={"essential": True},
        email_verified={"essential": True},
        picture=None,
    )

    claims = claims_deser(pre.to_json(), sformat="json")
    assert _eq(claims.keys(),
               ["name", "nickname", "email", "email_verified", "picture"])

    claims = claims_deser(pre.to_dict(), sformat="dict")
    assert _eq(claims.keys(),
               ["name", "nickname", "email", "email_verified", "picture"])