File tree 12 files changed +235
-6
lines changed
draft-next/optional/format
draft2019-09/optional/format
draft2020-12/optional/format 12 files changed +235
-6
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,11 @@ import warnings
14
14
try :
15
15
import jsonschema .validators
16
16
except ImportError :
17
- jsonschema = None
17
+ jsonschema = Unresolvable = None
18
18
VALIDATORS = {}
19
19
else :
20
+ from referencing .exceptions import Unresolvable
21
+
20
22
VALIDATORS = {
21
23
"draft3" : jsonschema .validators .Draft3Validator ,
22
24
"draft4" : jsonschema .validators .Draft4Validator ,
@@ -587,7 +589,7 @@ class SanityTests(unittest.TestCase):
587
589
with self .subTest (case = case , version = version .name ):
588
590
try :
589
591
Validator (case ["schema" ]).is_valid (12 )
590
- except jsonschema . exceptions . RefResolutionError :
592
+ except Unresolvable :
591
593
pass
592
594
593
595
@unittest .skipIf (jsonschema is None , "Validation library not present!" )
@@ -615,9 +617,6 @@ class SanityTests(unittest.TestCase):
615
617
with self .subTest (path = path ):
616
618
try :
617
619
validator .validate (cases )
618
- except jsonschema .exceptions .RefResolutionError :
619
- # python-jsonschema/jsonschema#884
620
- pass
621
620
except jsonschema .ValidationError as error :
622
621
self .fail (str (error ))
623
622
Original file line number Diff line number Diff line change 95
95
"description" : " exceeds maximum label length" ,
96
96
"data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
97
97
"valid" : false
98
+ },
99
+ {
100
+ "description" : " single label" ,
101
+ "data" : " hostname" ,
102
+ "valid" : true
103
+ },
104
+ {
105
+ "description" : " single label with hyphen" ,
106
+ "data" : " host-name" ,
107
+ "valid" : true
108
+ },
109
+ {
110
+ "description" : " single label with digits" ,
111
+ "data" : " h0stn4me" ,
112
+ "valid" : true
113
+ },
114
+ {
115
+ "description" : " single label starting with digit" ,
116
+ "data" : " 1host" ,
117
+ "valid" : true
118
+ },
119
+ {
120
+ "description" : " single label ending with digit" ,
121
+ "data" : " hostnam3" ,
122
+ "valid" : true
98
123
}
99
124
]
100
125
}
Original file line number Diff line number Diff line change 301
301
"comment" : " https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement" ,
302
302
"data" : " \u0628\u064a\u200c\u0628\u064a " ,
303
303
"valid" : true
304
+ },
305
+ {
306
+ "description" : " single label" ,
307
+ "data" : " hostname" ,
308
+ "valid" : true
309
+ },
310
+ {
311
+ "description" : " single label with hyphen" ,
312
+ "data" : " host-name" ,
313
+ "valid" : true
314
+ },
315
+ {
316
+ "description" : " single label with digits" ,
317
+ "data" : " h0stn4me" ,
318
+ "valid" : true
319
+ },
320
+ {
321
+ "description" : " single label starting with digit" ,
322
+ "data" : " 1host" ,
323
+ "valid" : true
324
+ },
325
+ {
326
+ "description" : " single label ending with digit" ,
327
+ "data" : " hostnam3" ,
328
+ "valid" : true
304
329
}
305
330
]
306
331
}
Original file line number Diff line number Diff line change 95
95
"description" : " exceeds maximum label length" ,
96
96
"data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
97
97
"valid" : false
98
+ },
99
+ {
100
+ "description" : " single label" ,
101
+ "data" : " hostname" ,
102
+ "valid" : true
103
+ },
104
+ {
105
+ "description" : " single label with hyphen" ,
106
+ "data" : " host-name" ,
107
+ "valid" : true
108
+ },
109
+ {
110
+ "description" : " single label with digits" ,
111
+ "data" : " h0stn4me" ,
112
+ "valid" : true
113
+ },
114
+ {
115
+ "description" : " single label starting with digit" ,
116
+ "data" : " 1host" ,
117
+ "valid" : true
118
+ },
119
+ {
120
+ "description" : " single label ending with digit" ,
121
+ "data" : " hostnam3" ,
122
+ "valid" : true
98
123
}
99
124
]
100
125
}
Original file line number Diff line number Diff line change 301
301
"comment" : " https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement" ,
302
302
"data" : " \u0628\u064a\u200c\u0628\u064a " ,
303
303
"valid" : true
304
+ },
305
+ {
306
+ "description" : " single label" ,
307
+ "data" : " hostname" ,
308
+ "valid" : true
309
+ },
310
+ {
311
+ "description" : " single label with hyphen" ,
312
+ "data" : " host-name" ,
313
+ "valid" : true
314
+ },
315
+ {
316
+ "description" : " single label with digits" ,
317
+ "data" : " h0stn4me" ,
318
+ "valid" : true
319
+ },
320
+ {
321
+ "description" : " single label starting with digit" ,
322
+ "data" : " 1host" ,
323
+ "valid" : true
324
+ },
325
+ {
326
+ "description" : " single label ending with digit" ,
327
+ "data" : " hostnam3" ,
328
+ "valid" : true
304
329
}
305
330
]
306
331
}
Original file line number Diff line number Diff line change 95
95
"description" : " exceeds maximum label length" ,
96
96
"data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
97
97
"valid" : false
98
+ },
99
+ {
100
+ "description" : " single label" ,
101
+ "data" : " hostname" ,
102
+ "valid" : true
103
+ },
104
+ {
105
+ "description" : " single label with hyphen" ,
106
+ "data" : " host-name" ,
107
+ "valid" : true
108
+ },
109
+ {
110
+ "description" : " single label with digits" ,
111
+ "data" : " h0stn4me" ,
112
+ "valid" : true
113
+ },
114
+ {
115
+ "description" : " single label starting with digit" ,
116
+ "data" : " 1host" ,
117
+ "valid" : true
118
+ },
119
+ {
120
+ "description" : " single label ending with digit" ,
121
+ "data" : " hostnam3" ,
122
+ "valid" : true
98
123
}
99
124
]
100
125
}
Original file line number Diff line number Diff line change 301
301
"comment" : " https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement" ,
302
302
"data" : " \u0628\u064a\u200c\u0628\u064a " ,
303
303
"valid" : true
304
+ },
305
+ {
306
+ "description" : " single label" ,
307
+ "data" : " hostname" ,
308
+ "valid" : true
309
+ },
310
+ {
311
+ "description" : " single label with hyphen" ,
312
+ "data" : " host-name" ,
313
+ "valid" : true
314
+ },
315
+ {
316
+ "description" : " single label with digits" ,
317
+ "data" : " h0stn4me" ,
318
+ "valid" : true
319
+ },
320
+ {
321
+ "description" : " single label starting with digit" ,
322
+ "data" : " 1host" ,
323
+ "valid" : true
324
+ },
325
+ {
326
+ "description" : " single label ending with digit" ,
327
+ "data" : " hostnam3" ,
328
+ "valid" : true
304
329
}
305
330
]
306
331
}
Original file line number Diff line number Diff line change 92
92
"description" : " exceeds maximum label length" ,
93
93
"data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
94
94
"valid" : false
95
+ },
96
+ {
97
+ "description" : " single label" ,
98
+ "data" : " hostname" ,
99
+ "valid" : true
100
+ },
101
+ {
102
+ "description" : " single label with hyphen" ,
103
+ "data" : " host-name" ,
104
+ "valid" : true
105
+ },
106
+ {
107
+ "description" : " single label with digits" ,
108
+ "data" : " h0stn4me" ,
109
+ "valid" : true
110
+ },
111
+ {
112
+ "description" : " single label ending with digit" ,
113
+ "data" : " hostnam3" ,
114
+ "valid" : true
95
115
}
96
116
]
97
117
}
Original file line number Diff line number Diff line change 92
92
"description" : " exceeds maximum label length" ,
93
93
"data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
94
94
"valid" : false
95
+ },
96
+ {
97
+ "description" : " single label" ,
98
+ "data" : " hostname" ,
99
+ "valid" : true
100
+ },
101
+ {
102
+ "description" : " single label with hyphen" ,
103
+ "data" : " host-name" ,
104
+ "valid" : true
105
+ },
106
+ {
107
+ "description" : " single label with digits" ,
108
+ "data" : " h0stn4me" ,
109
+ "valid" : true
110
+ },
111
+ {
112
+ "description" : " single label ending with digit" ,
113
+ "data" : " hostnam3" ,
114
+ "valid" : true
95
115
}
96
116
]
97
117
}
Original file line number Diff line number Diff line change 92
92
"description" : " exceeds maximum label length" ,
93
93
"data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
94
94
"valid" : false
95
+ },
96
+ {
97
+ "description" : " single label" ,
98
+ "data" : " hostname" ,
99
+ "valid" : true
100
+ },
101
+ {
102
+ "description" : " single label with hyphen" ,
103
+ "data" : " host-name" ,
104
+ "valid" : true
105
+ },
106
+ {
107
+ "description" : " single label with digits" ,
108
+ "data" : " h0stn4me" ,
109
+ "valid" : true
110
+ },
111
+ {
112
+ "description" : " single label ending with digit" ,
113
+ "data" : " hostnam3" ,
114
+ "valid" : true
95
115
}
96
116
]
97
117
}
Original file line number Diff line number Diff line change 298
298
"comment" : " https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement" ,
299
299
"data" : " \u0628\u064a\u200c\u0628\u064a " ,
300
300
"valid" : true
301
+ },
302
+ {
303
+ "description" : " single label" ,
304
+ "data" : " hostname" ,
305
+ "valid" : true
306
+ },
307
+ {
308
+ "description" : " single label with hyphen" ,
309
+ "data" : " host-name" ,
310
+ "valid" : true
311
+ },
312
+ {
313
+ "description" : " single label with digits" ,
314
+ "data" : " h0stn4me" ,
315
+ "valid" : true
316
+ },
317
+ {
318
+ "description" : " single label ending with digit" ,
319
+ "data" : " hostnam3" ,
320
+ "valid" : true
301
321
}
302
322
]
303
323
}
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ skipsdist = True
5
5
6
6
[testenv:sanity]
7
7
# used just for validating the structure of the test case files themselves
8
- deps = jsonschema ==4.18.0a4
8
+ deps = jsonschema ==4.19.0
9
9
commands = {envpython} bin/jsonschema_suite check
You can’t perform that action at this time.
0 commit comments