Skip to content

Commit

Permalink
test(CredentialSubject): add null test
Browse files Browse the repository at this point in the history
  • Loading branch information
lemoustachiste committed Nov 7, 2024
1 parent 3434701 commit cd605bd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/v3_certificate_validation/test_unit_credential_subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
from cert_issuer.models.verifiable_credential import validate_credential_subject

class UnitValidationV3 (unittest.TestCase):
def test_null (self):
credential_subject = None

# TODO: ideally this would be stubbed to have better control over the test
# TODO: however urlretrieve and consumption is a bit convoluted to mock
credential_schema = {
"id": "https://www.blockcerts.org/samples/3.0/example-id-card-schema.json",
"type": "JsonSchema"
}

try:
validate_credential_subject(credential_subject, credential_schema)
except:
assert True
return

assert False

def test_conforms_to_schema (self):
credential_subject = {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
Expand Down

0 comments on commit cd605bd

Please sign in to comment.