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..8691862f0d 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,29 @@ 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.V20CredFilterSchema() + 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}, + } + ) + schema.validate_fields( + { + "anoncreds": {}, + } + ) + 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(