def test_dump_load(): jb = make_jwks_bundle('', ['fo0', 'fo1', 'fo2', 'fo3'], None, KEYDEFS) bs = jb.dumps() receiver = JWKSBundle('') receiver.loads(bs) assert len(receiver.keys()) == 4 assert set(receiver.keys()) == {'fo0', 'fo1', 'fo2', 'fo3'}
def test_dumps_loads(): bundle = JWKSBundle(ISS, SIGN_KEYS) bundle['https://www.swamid.se'] = KEYJAR['https://www.swamid.se'] bundle['https://www.sunet.se'] = KEYJAR['https://www.sunet.se'] bundle['https://www.feide.no'] = KEYJAR['https://www.feide.no'] _str = bundle.dumps() bundle2 = JWKSBundle(ISS, SIGN_KEYS) bundle2.loads(_str) assert set(bundle.keys()) == set(bundle2.keys()) for iss, kj in bundle.items(): assert bundle2[iss] == kj