diff options
author | Julian Berman <Julian@GrayVines.com> | 2018-09-29 08:54:43 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2018-09-30 09:37:25 -0400 |
commit | 7c16622e291b516ee23e85a05b89a1a5be97b46a (patch) | |
tree | 5367786f6d8ed5f2f5ed7f6ea1f12a933088ddc8 /jsonschema/tests/test_jsonschema_test_suite.py | |
parent | e0add0ee189d9aa97f8326a27da6a925e24a5cae (diff) | |
download | jsonschema-7c16622e291b516ee23e85a05b89a1a5be97b46a.tar.gz |
First step on Draft7 support.
Add everything that's the same in Draft6, which appears to just leave
out if/then/else.
Diffstat (limited to 'jsonschema/tests/test_jsonschema_test_suite.py')
-rw-r--r-- | jsonschema/tests/test_jsonschema_test_suite.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/jsonschema/tests/test_jsonschema_test_suite.py b/jsonschema/tests/test_jsonschema_test_suite.py index 110c5f4..e434f8a 100644 --- a/jsonschema/tests/test_jsonschema_test_suite.py +++ b/jsonschema/tests/test_jsonschema_test_suite.py @@ -12,9 +12,11 @@ from jsonschema import ( Draft3Validator, Draft4Validator, Draft6Validator, + Draft7Validator, draft3_format_checker, draft4_format_checker, draft6_format_checker, + draft7_format_checker, ) from jsonschema.tests._suite import Suite from jsonschema.validators import _DEPRECATED_DEFAULT_TYPES, create @@ -24,6 +26,7 @@ SUITE = Suite() DRAFT3 = SUITE.version(name="draft3") DRAFT4 = SUITE.version(name="draft4") DRAFT6 = SUITE.version(name="draft6") +DRAFT7 = SUITE.version(name="draft7") def skip_tests_containing_descriptions(**kwargs): @@ -139,6 +142,37 @@ TestDraft6 = DRAFT6.to_unittest_testcase( ) +TestDraft7 = DRAFT7.to_unittest_testcase( + DRAFT7.tests(), + DRAFT7.format_tests(), + DRAFT7.optional_tests_of(name="bignum"), + DRAFT7.optional_tests_of(name="zeroTerminatedFloats"), + Validator=Draft7Validator, + format_checker=draft7_format_checker, + skip=lambda test: ( + narrow_unicode_build(test) + or missing_format(draft7_format_checker)(test) + or skip_tests_containing_descriptions( + ref={ + "valid tree": "An actual bug, this needs fixing.", + }, + refRemote={ + "number is valid": "An actual bug, this needs fixing.", + "string is invalid": "An actual bug, this needs fixing.", + }, + )(test) + or skip_tests_containing_descriptions( + **{ + "date-time": { + "case-insensitive T and Z": + "Upstream bug in strict_rfc3339", + }, + } + )(test) + ), +) + + TestDraft3LegacyTypeCheck = DRAFT3.to_unittest_testcase( DRAFT3.tests_of(name="type"), name="TestDraft3LegacyTypeCheck", |