summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
authorGlenn Maynard <glenn@zewt.org>2012-06-07 16:10:15 +0000
committerGlenn Maynard <glenn@zewt.org>2012-06-07 16:10:15 +0000
commit5b0e318ad44fb3b79e6ced3c022721655b778f31 (patch)
tree912ae40e74e38ca80784a93adb7bee872e86c31f /tests.py
parent770c0a0f2878ef64d402ca99951b5f27b5e53439 (diff)
downloadjsonschema-5b0e318ad44fb3b79e6ced3c022721655b778f31.tar.gz
Test .errors propagation for SchemaError.
Diffstat (limited to 'tests.py')
-rw-r--r--tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index b43783d..7868b04 100644
--- a/tests.py
+++ b/tests.py
@@ -642,6 +642,13 @@ class TestValidate(ParameterizedTestCase, unittest.TestCase):
validate("foo", {"type" : "string"}, string_types=(unicode,))
self.assertEqual(len(w), 1)
+ def test_schema_error_errors(self):
+ try:
+ validate({}, { "properties": { "additionalProperties": False } }, stop_on_error=False)
+ except SchemaError as e:
+ self.assertGreater(len(e.errors), 0)
+ else:
+ raise AssertionError("Expected SchemaError, got nothing")
class TestIgnorePropertiesForIrrelevantTypes(unittest.TestCase):
def test_minimum(self):