Skip to content

Commit

Permalink
Merge 56ca4a2 into d4d376e
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Aug 6, 2021
2 parents d4d376e + 56ca4a2 commit 1debde5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
7 changes: 4 additions & 3 deletions schema/iiif_3_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@
}
]
},
"id": {},
"label": {},
"id": { "$ref": "#/types/id" },
"label": {"$ref": "#/types/lngString" },
"type": {
"type": "string",
"pattern": "^Manifest"
Expand Down Expand Up @@ -467,7 +467,8 @@
"$ref": "#/classes/annotationPage"
}
}
}
},
"required": ["id", "type", "label"]
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def run(self):
"zipp==1.2.0",
"configparser==4.0.2",
"pyld==1.0.5",
"pyrsistent==0.16.0"
"pyrsistent==0.16.0",
"decorator==4.4.2"
],
},
test_suite="tests",
Expand Down
13 changes: 12 additions & 1 deletion tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,20 @@ def test_lang_rights(self):
response = self.helperRunValidation(v, filename)
self.helperTestValidationErrors(filename, response, errorPaths)

def formatErrors(self, errorList):
response = ''
for error in errorList:
response += "Title: {}\n".format(error['title'])
response += "Path: {}\n".format(error['path'])
response += "Context: {}\n".format(error['path'])
response += "****************************\n"

return response

def helperTestValidationErrors(self, filename, response, errorPaths):
self.assertEqual(response['okay'], 0, 'Expected {} to fail validation but it past.'.format(filename))
self.assertEqual(len(response['errorList']), len(errorPaths), 'Expected {} validation errors but found {} for file {}\n{}'.format(len(errorPaths), len(response['errorList']), filename, response['errorList']))
self.assertEqual(len(response['errorList']), len(errorPaths), 'Expected {} validation errors but found {} for file {}\n{}'.format(len(errorPaths), len(response['errorList']), filename, self.formatErrors(response['errorList'])))


for error in response['errorList']:
foundPath = False
Expand Down

0 comments on commit 1debde5

Please sign in to comment.