Skip to content

Commit

Permalink
Clean up tests after validation related improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
brettviren committed Sep 14, 2022
1 parent 9b6a75b commit 9d28f0c
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 149 deletions.
6 changes: 4 additions & 2 deletions moo/ovalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import moo.jsonschema

def validate(models, targets, context=None, throw=False, validator="jsonschema"):
from moo.jsonschema import ValidationError

def validate(models, targets, context=None, throw=True, validator="jsonschema"):
'''
Validate models against schema.
Expand Down Expand Up @@ -36,7 +38,7 @@ def validate(models, targets, context=None, throw=False, validator="jsonschema")
continue
try:
moo.jsonschema.validate(model, js, validator)
except moo.jsonschema.ValidationError:
except ValidationError:
res.append(False)
else:
res.append(True)
Expand Down
145 changes: 72 additions & 73 deletions ovalid.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions ovalid.org
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,5 @@ Models are loaded like schema
Finally, validation, assuming a matched sequence of target schema and models:

#+begin_src python
throw = True # False if you want [bool, array, results]
moo.ovalid.validate(models, targets, context, throw)
res = moo.ovalid.validate(models, targets, context, throw=False)
#+end_src
Loading

0 comments on commit 9d28f0c

Please sign in to comment.