diff options
author | Glenn Maynard <glenn@zewt.org> | 2012-06-07 16:10:15 +0000 |
---|---|---|
committer | Glenn Maynard <glenn@zewt.org> | 2012-06-07 16:10:15 +0000 |
commit | 5b0e318ad44fb3b79e6ced3c022721655b778f31 (patch) | |
tree | 912ae40e74e38ca80784a93adb7bee872e86c31f /tests.py | |
parent | 770c0a0f2878ef64d402ca99951b5f27b5e53439 (diff) | |
download | jsonschema-5b0e318ad44fb3b79e6ced3c022721655b778f31.tar.gz |
Test .errors propagation for SchemaError.
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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): |