def test_get_issuer_from_auth_delegation_returns_none_if_not_found( auth_deleg_proof, min_doc_owner_pub_key): doc = get_doc_with_keys(deleg_auth=auth_deleg_proof.values(), public_keys=[min_doc_owner_pub_key]) issuer_name = '#DoesNotExist' issuer_key = RegisterDocumentHelper.get_issuer_register_delegation_proof( issuer_name, doc, include_auth=True) assert not issuer_key
def test_can_get_issuer_from_auth_delegation(auth_deleg_proof, min_doc_owner_pub_key): doc = get_doc_with_keys(deleg_auth=auth_deleg_proof.values(), public_keys=[min_doc_owner_pub_key]) issuer_name = '#DelegAuthKey2' issuer_key = RegisterDocumentHelper.get_issuer_register_delegation_proof( issuer_name, doc, include_auth=True) assert issuer_key == auth_deleg_proof[issuer_name]
def test_get_issuer_from_auth_delegation_returns_none_if_in_auth_keys_but_auth_not_included( auth_deleg_proof, min_doc_owner_pub_key): doc = get_doc_with_keys(deleg_auth=auth_deleg_proof.values(), public_keys=[min_doc_owner_pub_key]) issuer_name = '#DelegAuthKey2' assert issuer_name in doc.auth_delegation_proof issuer_key = RegisterDocumentHelper.get_issuer_register_delegation_proof( issuer_name, doc, include_auth=False) assert not issuer_key