summaryrefslogtreecommitdiff
path: root/jsonschema/tests/test_jsonschema_test_suite.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-08-18 09:23:00 +0100
committerJulian Berman <Julian@GrayVines.com>2021-08-18 09:23:00 +0100
commitd104bdbe2ce3f283e4e2bbf2a5fe7f6f7d6f7280 (patch)
tree9275f20a02d7c91f2a8cb509af90040fa2a624b9 /jsonschema/tests/test_jsonschema_test_suite.py
parent7f677965d26846e20e2e417f6201bb7e2cde554e (diff)
downloadjsonschema-d104bdbe2ce3f283e4e2bbf2a5fe7f6f7d6f7280.tar.gz
May as well add support for Draft 2019 as well.
recursiveRef is broken in the same way dynamicRef is.
Diffstat (limited to 'jsonschema/tests/test_jsonschema_test_suite.py')
-rw-r--r--jsonschema/tests/test_jsonschema_test_suite.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/jsonschema/tests/test_jsonschema_test_suite.py b/jsonschema/tests/test_jsonschema_test_suite.py
index c0ddddd..22dab75 100644
--- a/jsonschema/tests/test_jsonschema_test_suite.py
+++ b/jsonschema/tests/test_jsonschema_test_suite.py
@@ -13,11 +13,13 @@ from jsonschema import (
Draft4Validator,
Draft6Validator,
Draft7Validator,
+ Draft201909Validator,
Draft202012Validator,
draft3_format_checker,
draft4_format_checker,
draft6_format_checker,
draft7_format_checker,
+ draft201909_format_checker,
draft202012_format_checker,
)
from jsonschema.tests._helpers import bug
@@ -28,6 +30,7 @@ DRAFT3 = SUITE.version(name="draft3")
DRAFT4 = SUITE.version(name="draft4")
DRAFT6 = SUITE.version(name="draft6")
DRAFT7 = SUITE.version(name="draft7")
+DRAFT201909 = SUITE.version(name="draft2019-09")
DRAFT202012 = SUITE.version(name="draft2020-12")
@@ -403,6 +406,41 @@ TestDraft7 = DRAFT7.to_unittest_testcase(
)
+TestDraft201909 = DRAFT201909.to_unittest_testcase(
+ DRAFT201909.tests(),
+ DRAFT201909.optional_tests_of(name="bignum"),
+ DRAFT201909.optional_tests_of(name="float-overflow"),
+ DRAFT201909.optional_tests_of(name="non-bmp-regex"),
+ DRAFT201909.optional_tests_of(name="refOfUnknownKeyword"),
+ Validator=Draft201909Validator,
+ skip=lambda test: (
+ skip(
+ message="unevaluatedItems is different in 2019-09 (needs work).",
+ subject="unevaluatedItems",
+ )(test)
+ or skip(
+ message="dynamicRef support isn't working yet.",
+ subject="recursiveRef",
+ )(test)
+ ),
+)
+
+
+TestDraft201909Format = DRAFT201909.to_unittest_testcase(
+ DRAFT201909.format_tests(),
+ Validator=Draft201909Validator,
+ format_checker=draft201909_format_checker,
+ skip=lambda test: (
+ complex_email_validation(test)
+ or missing_date_fromisoformat(test)
+ or allowed_leading_zeros(test)
+ or leap_second(test)
+ or missing_format(draft201909_format_checker)(test)
+ or complex_email_validation(test)
+ ),
+)
+
+
TestDraft202012 = DRAFT202012.to_unittest_testcase(
DRAFT202012.tests(),
DRAFT202012.optional_tests_of(name="bignum"),