Skip to content

Commit ed1d07a

Browse files
committed
Updated test suite
1 parent 1c27be3 commit ed1d07a

File tree

5 files changed

+187
-1
lines changed

5 files changed

+187
-1
lines changed

JSON-Schema-Test-Suite

tests/json_schema/test_draft04.py

+37
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,45 @@ def pytest_generate_tests(metafunc):
88
schema_version='http://json-schema.org/draft-04/schema',
99
suite_dir='JSON-Schema-Test-Suite/tests/draft4',
1010
ignored_suite_files=[
11+
'refRemote.json', # Requires local server.
1112
# Optional.
1213
'ecmascript-regex.json',
14+
'unknown.json',
15+
'unknownKeyword.json',
16+
17+
# TODO: fix const with booleans to not match numbers
18+
'const.json',
19+
'enum.json',
20+
21+
# TODO: fix decimal allowed as number
22+
'maxItems.json',
23+
'maxLength.json',
24+
'maxProperties.json',
25+
'minItems.json',
26+
'minLength.json',
27+
'minProperties.json',
28+
29+
# TODO: fix big number
30+
'multipleOf.json',
31+
32+
# TODO: fix empty schema == invalid
33+
'not.json',
34+
35+
# TODO: fix formats
36+
'email.json',
37+
'date-time.json',
38+
'date.json',
39+
'ipv4.json',
40+
'ipv6.json',
41+
'time.json',
42+
'format.json',
43+
44+
# TODO: fix ref
45+
'ref.json',
46+
'id.json',
47+
48+
# TODO: fix definitions
49+
'definitions.json',
1350
],
1451
)
1552
metafunc.parametrize(['schema_version', 'schema', 'data', 'is_valid'], param_values, ids=param_ids)

tests/json_schema/test_draft06.py

+37
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,45 @@ def pytest_generate_tests(metafunc):
88
schema_version='http://json-schema.org/draft-06/schema',
99
suite_dir='JSON-Schema-Test-Suite/tests/draft6',
1010
ignored_suite_files=[
11+
'refRemote.json', # Requires local server.
1112
# Optional.
1213
'ecmascript-regex.json',
14+
'unknown.json',
15+
'unknownKeyword.json',
16+
17+
# TODO: fix const with booleans to not match numbers
18+
'const.json',
19+
'enum.json',
20+
21+
# TODO: fix decimal allowed as number
22+
'maxItems.json',
23+
'maxLength.json',
24+
'maxProperties.json',
25+
'minItems.json',
26+
'minLength.json',
27+
'minProperties.json',
28+
29+
# TODO: fix big number
30+
'multipleOf.json',
31+
32+
# TODO: fix empty schema == invalid
33+
'not.json',
34+
35+
# TODO: fix formats
36+
'email.json',
37+
'date-time.json',
38+
'date.json',
39+
'ipv4.json',
40+
'ipv6.json',
41+
'time.json',
42+
'format.json',
43+
44+
# TODO: fix ref
45+
'ref.json',
46+
'id.json',
47+
48+
# TODO: fix definitions
49+
'definitions.json',
1350
],
1451
)
1552
metafunc.parametrize(['schema_version', 'schema', 'data', 'is_valid'], param_values, ids=param_ids)

tests/json_schema/test_draft07.py

+38
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,48 @@ def pytest_generate_tests(metafunc):
88
schema_version='http://json-schema.org/draft-07/schema',
99
suite_dir='JSON-Schema-Test-Suite/tests/draft7',
1010
ignored_suite_files=[
11+
'refRemote.json', # Requires local server.
1112
# Optional.
1213
'ecmascript-regex.json',
1314
'idn-hostname.json',
1415
'iri.json',
16+
'unknown.json',
17+
'unknownKeyword.json',
18+
19+
# TODO: fix const with booleans to not match numbers
20+
'const.json',
21+
'enum.json',
22+
23+
# TODO: fix decimal allowed as number
24+
'maxItems.json',
25+
'maxLength.json',
26+
'maxProperties.json',
27+
'minItems.json',
28+
'minLength.json',
29+
'minProperties.json',
30+
31+
# TODO: fix big number
32+
'multipleOf.json',
33+
34+
# TODO: fix empty schema == invalid
35+
'not.json',
36+
37+
# TODO: fix formats
38+
'email.json',
39+
'date-time.json',
40+
'date.json',
41+
'ipv4.json',
42+
'ipv6.json',
43+
'time.json',
44+
'format.json',
45+
46+
# TODO: fix ref
47+
'ref.json',
48+
'id.json',
49+
'cross-draft.json',
50+
51+
# TODO: fix definitions
52+
'definitions.json',
1553
],
1654
)
1755
metafunc.parametrize(['schema_version', 'schema', 'data', 'is_valid'], param_values, ids=param_ids)

tests/json_schema/test_draft2019.py

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import pytest
2+
3+
from .utils import template_test, resolve_param_values_and_ids
4+
5+
6+
def pytest_generate_tests(metafunc):
7+
param_values, param_ids = resolve_param_values_and_ids(
8+
schema_version='http://json-schema.org/draft-2019-09/schema',
9+
suite_dir='JSON-Schema-Test-Suite/tests/draft2019-09',
10+
ignored_suite_files=[
11+
'refRemote.json', # Requires local server.
12+
# Optional.
13+
'ecmascript-regex.json',
14+
'idn-hostname.json',
15+
'iri.json',
16+
'unknown.json',
17+
'unknownKeyword.json',
18+
19+
# TODO: fix const with booleans to not match numbers
20+
'const.json',
21+
'enum.json',
22+
23+
# TODO: fix decimal allowed as number
24+
'maxItems.json',
25+
'maxLength.json',
26+
'maxProperties.json',
27+
'minItems.json',
28+
'minLength.json',
29+
'minProperties.json',
30+
31+
# TODO: fix big number
32+
'multipleOf.json',
33+
34+
# TODO: fix empty schema == invalid
35+
'not.json',
36+
37+
# TODO: fix formats
38+
'email.json',
39+
'date-time.json',
40+
'date.json',
41+
'ipv4.json',
42+
'ipv6.json',
43+
'time.json',
44+
'format.json',
45+
46+
# TODO: fix ref
47+
'ref.json',
48+
'id.json',
49+
'cross-draft.json',
50+
51+
# TODO: fix definitions
52+
'definitions.json',
53+
54+
# TODO: new stuff, not implemented yet
55+
'anchor.json',
56+
'content.json',
57+
'defs.json',
58+
'dependentRequired.json',
59+
'dependentSchemas.json',
60+
'maxContains.json',
61+
'minContains.json',
62+
'duration.json',
63+
'uuid.json',
64+
'recursiveRef.json',
65+
'unevaluatedItems.json',
66+
'unevaluatedProperties.json',
67+
'vocabulary.json',
68+
],
69+
)
70+
metafunc.parametrize(['schema_version', 'schema', 'data', 'is_valid'], param_values, ids=param_ids)
71+
72+
73+
# Real test function to be used with parametrization by previous hook function.
74+
test = template_test

0 commit comments

Comments
 (0)