diff --git a/acapy_agent/protocols/issue_credential/v2_0/tests/test_routes.py b/acapy_agent/protocols/issue_credential/v2_0/tests/test_routes.py index 9e3663d5ed..0c31b211e4 100644 --- a/acapy_agent/protocols/issue_credential/v2_0/tests/test_routes.py +++ b/acapy_agent/protocols/issue_credential/v2_0/tests/test_routes.py @@ -61,6 +61,31 @@ async def test_validate_cred_filter_schema(self): with self.assertRaises(test_module.ValidationError): schema.validate_fields({"veres-one": {"no": "support"}}) + async def test_validate_cred_filter_anoncreds_schema(self): + schema = test_module.V20CredFilterAnoncredsSchema() + schema.validate_fields({"anoncreds": {"issuer_id": TEST_DID}}) + schema.validate_fields( + {"anoncreds": {"issuer_id": TEST_DID, "schema_version": "1.0"}} + ) + schema.validate_fields( + { + "anoncreds": {"issuer_id": TEST_DID}, + "ld_proof": {"credential": {}, "options": {}}, + } + ) + schema.validate_fields( + { + "anoncreds": {}, + "ld_proof": {"credential": {}, "options": {}}, + } + ) + with self.assertRaises(test_module.ValidationError): + schema.validate_fields({}) + with self.assertRaises(test_module.ValidationError): + schema.validate_fields(["hopeless", "stop"]) + with self.assertRaises(test_module.ValidationError): + schema.validate_fields({"veres-one": {"no": "support"}}) + async def test_validate_create_schema(self): schema = test_module.V20IssueCredSchemaCore() schema.validate(