Skip to content

Commit

Permalink
Add a unit test
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Dec 5, 2024
1 parent 4ce1b1a commit 7d84d90
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions acapy_agent/protocols/issue_credential/v2_0/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7d84d90

Please sign in to comment.