This is a big refactor of the backend to remove code duplication and simplify adding of extra checking rules. The main changes are:
ags.py and bgs.py replaced with validation.py and conversion.py
The code to convert now lives in the conversion module
The validation function has been simplified to be a wrapper that runs a series of "checker" functions over a file and then returns the full set of errors and metadata as a response.
checker.py contains checker functions, one for AGS, one for BGS. These take a file and return a dictionary with keys for errors, checker and any extra metadata. It will now be easy to add new sets of rules.
tests for the checkers look for the rules that have failed, making them more manageable than using the huge .json files
response schema replaces checker with checkers.
I have updated the unit tests to make sure that they all pass and are correct.
The integration tests pass, but only because they validate function uses the AGS checker by default. I need a session with @ximenesuk to work out how to update the API and front end to allow selection of the checker(s) to be used for validation.
This is a big refactor of the backend to remove code duplication and simplify adding of extra checking rules. The main changes are:
ags.py
andbgs.py
replaced withvalidation.py
andconversion.py
checker.py
contains checker functions, one for AGS, one for BGS. These take a file and return a dictionary with keys forerrors
,checker
and any extra metadata. It will now be easy to add new sets of rules.checker
withcheckers
.I have updated the unit tests to make sure that they all pass and are correct.
The integration tests pass, but only because they
validate
function uses the AGS checker by default. I need a session with @ximenesuk to work out how to update the API and front end to allow selection of the checker(s) to be used for validation.