Updated usage example

This commit is contained in:
mvaradi 2020-10-29 13:43:33 +00:00
parent 47f052bb9c
commit 97eab72b78

View file

@ -40,12 +40,17 @@ validator = Validator("funpdbe_resource_name") # Same as in the JSON
validator.load_schema("data/funpdbe_schema.json") validator.load_schema("data/funpdbe_schema.json")
validator.load_json("data/funpdbe_data.json") validator.load_json("data/funpdbe_data.json")
if validator.basic_checks() and validator.validate_against_schema(): if validator.basic_checks() and validator.validate_against_schema():
# Passed data validations # Passed data validations
print('Passed schema validation')
residue_indexes = ResidueIndexes(validator.json_data) residue_indexes = ResidueIndexes(validator.json_data)
if residue_indexes.check_every_residue(): if residue_indexes.check_every_residue():
# Passed the index validation # Passed the index validation
return True print('Passed index validation')
else:
print('Failed schema validation')
print(validator.error_log)
``` ```
### Running the tests ### Running the tests