Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validation fix. Must raise exception when raise_ex is true and record…
Browse files Browse the repository at this point in the history
… class (#107)

doesn't match expectation.
tetron authored Apr 28, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 424ad78 commit 5b0b019
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion schema_salad/validate.py
Original file line number Diff line number Diff line change
@@ -250,7 +250,11 @@ def validate_ex(expected_schema, # type: Schema
else:
return False
if expected_schema.name != d:
return False
if raise_ex:
raise ValidationException(
u"Expected class '%s' but this is '%s'" % (expected_schema.name, d))
else:
return False
classmatch = d
break

0 comments on commit 5b0b019

Please sign in to comment.