File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,8 @@ they should be valid or invalid.
52
52
Coverage
53
53
--------
54
54
55
- Currently, draft 3 should have essentially full coverage for the core schema.
56
-
57
- The beginnings of draft 4 are underway.
55
+ Draft 3 and 4 should have full coverage. If you see anything missing or think
56
+ there is a useful test missing, please send a pull request or open an issue.
58
57
59
58
Who Uses the Test Suite
60
59
-----------------------
@@ -68,6 +67,7 @@ This suite is being used by:
68
67
* [ jsonschema (javascript)] ( https://github.com/tdegrunt/jsonschema )
69
68
* [ JaySchema (javascript)] ( https://github.com/natesilva/jayschema )
70
69
* [ jesse (Erlang)] ( https://github.com/klarna/jesse )
70
+ * [ json-schema (PHP)] ( https://github.com/justinrainbow/json-schema )
71
71
72
72
If you use it as well, please fork and send a pull request adding yourself to
73
73
the list :).
Original file line number Diff line number Diff line change 32
32
import jsonschema
33
33
except ImportError :
34
34
jsonschema = None
35
+ else :
36
+ validators = getattr (
37
+ jsonschema .validators , "validators" , jsonschema .validators
38
+ )
35
39
36
40
37
41
ROOT_DIR = os .path .join (
@@ -138,8 +142,8 @@ class SanityTests(unittest.TestCase):
138
142
@unittest .skipIf (jsonschema is None , "Validation library not present!" )
139
143
def test_all_schemas_are_valid (self ):
140
144
for schema in os .listdir (SUITE_ROOT_DIR ):
141
- schema_validator = jsonschema . validators .get (schema )
142
- if schema_validator :
145
+ schema_validator = validators .get (schema )
146
+ if schema_validator is not None :
143
147
test_files = collect (os .path .join (SUITE_ROOT_DIR , schema ))
144
148
for case in cases (test_files ):
145
149
try :
Original file line number Diff line number Diff line change 28
28
"description" : " an invalid date-time string" ,
29
29
"data" : " 06/19/1963 08:30:06 PST" ,
30
30
"valid" : false
31
+ },
32
+ {
33
+ "description" : " only RFC3339 not all of ISO 8601 are valid" ,
34
+ "data" : " 2013-350T01:01:01" ,
35
+ "valid" : false
31
36
}
32
37
]
33
38
},
Original file line number Diff line number Diff line change 12
12
"description" : " an invalid date-time string" ,
13
13
"data" : " 06/19/1963 08:30:06 PST" ,
14
14
"valid" : false
15
+ },
16
+ {
17
+ "description" : " only RFC3339 not all of ISO 8601 are valid" ,
18
+ "data" : " 2013-350T01:01:01" ,
19
+ "valid" : false
15
20
}
16
21
]
17
22
},
You can’t perform that action at this time.
0 commit comments