diff --git a/acapy_agent/anoncreds/tests/test_holder.py b/acapy_agent/anoncreds/tests/test_holder.py index 34d23ef75f..2859eb43f3 100644 --- a/acapy_agent/anoncreds/tests/test_holder.py +++ b/acapy_agent/anoncreds/tests/test_holder.py @@ -55,11 +55,6 @@ def __init__(self, bad_schema=False, bad_cred_def=False): self.schema_id = "Sc886XPwD1gDcHwmmLDeR2:2:degree schema:45.101.94" self.cred_def_id = "Sc886XPwD1gDcHwmmLDeR2:3:CL:229975:faber.agent.degree_schema" - if bad_schema: - self.schema_id = "bad-schema-id" - if bad_cred_def: - self.cred_def_id = "bad-cred-def-id" - schema_id = "Sc886XPwD1gDcHwmmLDeR2:2:degree schema:45.101.94" cred_def_id = "Sc886XPwD1gDcHwmmLDeR2:3:CL:229975:faber.agent.degree_schema" rev_reg_id = None @@ -72,15 +67,10 @@ def to_dict(self): class MockCredReceivedW3C: - def __init__(self, bad_schema=False, bad_cred_def=False): + def __init__(self): self.schema_id = "Sc886XPwD1gDcHwmmLDeR2:2:degree schema:45.101.94" self.cred_def_id = "Sc886XPwD1gDcHwmmLDeR2:3:CL:229975:faber.agent.degree_schema" - if bad_schema: - self.schema_id = "bad-schema-id" - if bad_cred_def: - self.cred_def_id = "bad-cred-def-id" - def to_json_buffer(self): return b"credential" @@ -89,9 +79,7 @@ def to_dict(self): class MockCredential: - def __init__(self, bad_schema=False, bad_cred_def=False): - self.bad_schema = bad_schema - self.bad_cred_def = bad_cred_def + def __init__(self): self.rev_reg_id = "rev-reg-id" self.rev_reg_index = 0 @@ -101,21 +89,17 @@ def to_dict(self): return MOCK_CRED def process(self, *args, **kwargs): - return MockCredReceived(self.bad_schema, self.bad_cred_def) + return MockCredReceived() class MockW3Credential: - def __init__(self, bad_schema=False, bad_cred_def=False): - self.bad_schema = bad_schema - self.bad_cred_def = bad_cred_def - cred = mock.AsyncMock(auto_spec=W3cCredential) def to_dict(self): return MOCK_W3C_CRED def process(self, *args, **kwargs): - return MockCredReceivedW3C(self.bad_schema, self.bad_cred_def) + return MockCredReceivedW3C() class MockMasterSecret: @@ -285,8 +269,6 @@ async def test_store_credential_fails_to_load_raises_x(self, mock_master_secret) side_effect=[ MockCredential(), MockCredential(), - MockCredential(bad_schema=True), - MockCredential(bad_cred_def=True), ], ) async def test_store_credential(self, mock_load, mock_master_secret): @@ -321,20 +303,6 @@ async def test_store_credential(self, mock_load, mock_master_secret): {"cred-req-meta": "cred-req-meta"}, ) - # Test bad id's - with self.assertRaises(AnonCredsHolderError): - await self.holder.store_credential( - MOCK_CRED_DEF, - MOCK_PRES, - {"cred-req-meta": "cred-req-meta"}, - ) - with self.assertRaises(AnonCredsHolderError): - await self.holder.store_credential( - MOCK_CRED_DEF, - MOCK_CRED, - {"cred-req-meta": "cred-req-meta"}, - ) - @mock.patch.object(AnonCredsHolder, "get_master_secret", return_value="master-secret") @mock.patch.object( W3cCredential, diff --git a/acapy_agent/protocols/issue_credential/v2_0/formats/anoncreds/tests/test_handler.py b/acapy_agent/protocols/issue_credential/v2_0/formats/anoncreds/tests/test_handler.py index f795929e8b..07f2d948c4 100644 --- a/acapy_agent/protocols/issue_credential/v2_0/formats/anoncreds/tests/test_handler.py +++ b/acapy_agent/protocols/issue_credential/v2_0/formats/anoncreds/tests/test_handler.py @@ -132,7 +132,7 @@ "nonce": "1234567890", } ANONCREDS_CRED_REQ = { - "prover_did": TEST_DID, + "entropy": TEST_DID, "cred_def_id": CRED_DEF_ID, "blinded_ms": { "u": "12345",