Skip to content

Commit

Permalink
test(V1.2): disable tests due to unavailable distant endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lemoustachiste committed Oct 21, 2024
1 parent 70e7065 commit 28a3b29
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions tests/test_schema_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,35 @@ def test_v1_signed(self):
'../cert_schema/1.1/certificate-schema-v1-1.json')
self.assertTrue(valid)

def test_v1_2_signed(self):
with open('../examples/1.2/sample_signed_cert-1.2.json') as data_f:
certificate = json.load(data_f)
valid = validate_v1_2(certificate)
self.assertTrue(valid)

def test_v1_2_invalid(self):
with open('../examples/1.2/sample_invalid_cert-1.2.json') as data_f:
certificate = json.load(data_f)
try:
valid = validate_v1_2(certificate)
except BlockcertValidationError as bve:
self.assertTrue(True, 'Got validation error, as expected')
return
self.fail('Did not get expected validation error')

def test_v1_2_signed_multiple_signers(self):
with open('../examples/1.2/sample_signed_cert_multiple_signers-1.2.json') as data_f:
certificate = json.load(data_f)
valid = validate_v1_2(certificate)
self.assertTrue(valid)

def test_v1_2_unsigned(self):
with open('../examples/1.2/sample_unsigned_cert-1.2.json') as data_f:
data = json.load(data_f)
valid = validate_unsigned_v1_2(data['document'])
self.assertTrue(valid)
## comment V1.2 tests as they are currently failing due to unreachable URL. See https://github.com/1EdTech/openbadges-specification/issues/585
## TODO: re-enable if issue is fixed.
# def test_v1_2_signed(self):
# with open('../examples/1.2/sample_signed_cert-1.2.json') as data_f:
# certificate = json.load(data_f)
# valid = validate_v1_2(certificate)
# self.assertTrue(valid)
#
# def test_v1_2_invalid(self):
# with open('../examples/1.2/sample_invalid_cert-1.2.json') as data_f:
# certificate = json.load(data_f)
# try:
# valid = validate_v1_2(certificate)
# except BlockcertValidationError as bve:
# self.assertTrue(True, 'Got validation error, as expected')
# return
# self.fail('Did not get expected validation error')
#
# def test_v1_2_signed_multiple_signers(self):
# with open('../examples/1.2/sample_signed_cert_multiple_signers-1.2.json') as data_f:
# certificate = json.load(data_f)
# valid = validate_v1_2(certificate)
# self.assertTrue(valid)
#
# def test_v1_2_unsigned(self):
# with open('../examples/1.2/sample_unsigned_cert-1.2.json') as data_f:
# data = json.load(data_f)
# valid = validate_unsigned_v1_2(data['document'])
# self.assertTrue(valid)

def test_v2_alpha(self):
with open('../examples/2.0-alpha/sample_valid.json') as data_f:
Expand Down

0 comments on commit 28a3b29

Please sign in to comment.