File tree Expand file tree Collapse file tree 12 files changed +235
-6
lines changed
draft-next/optional/format
draft2019-09/optional/format
draft2020-12/optional/format Expand file tree Collapse file tree 12 files changed +235
-6
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,11 @@ import warnings
1414try :
1515 import jsonschema .validators
1616except ImportError :
17- jsonschema = None
17+ jsonschema = Unresolvable = None
1818 VALIDATORS = {}
1919else :
20+ from referencing .exceptions import Unresolvable
21+
2022 VALIDATORS = {
2123 "draft3" : jsonschema .validators .Draft3Validator ,
2224 "draft4" : jsonschema .validators .Draft4Validator ,
@@ -587,7 +589,7 @@ class SanityTests(unittest.TestCase):
587589 with self .subTest (case = case , version = version .name ):
588590 try :
589591 Validator (case ["schema" ]).is_valid (12 )
590- except jsonschema . exceptions . RefResolutionError :
592+ except Unresolvable :
591593 pass
592594
593595 @unittest .skipIf (jsonschema is None , "Validation library not present!" )
@@ -615,9 +617,6 @@ class SanityTests(unittest.TestCase):
615617 with self .subTest (path = path ):
616618 try :
617619 validator .validate (cases )
618- except jsonschema .exceptions .RefResolutionError :
619- # python-jsonschema/jsonschema#884
620- pass
621620 except jsonschema .ValidationError as error :
622621 self .fail (str (error ))
623622
Original file line number Diff line number Diff line change 9595 "description" : " exceeds maximum label length" ,
9696 "data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
9797 "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
98123 }
99124 ]
100125 }
Original file line number Diff line number Diff line change 301301 "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" ,
302302 "data" : " \u0628\u064a\u200c\u0628\u064a " ,
303303 "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
304329 }
305330 ]
306331 }
Original file line number Diff line number Diff line change 9595 "description" : " exceeds maximum label length" ,
9696 "data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
9797 "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
98123 }
99124 ]
100125 }
Original file line number Diff line number Diff line change 301301 "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" ,
302302 "data" : " \u0628\u064a\u200c\u0628\u064a " ,
303303 "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
304329 }
305330 ]
306331 }
Original file line number Diff line number Diff line change 9595 "description" : " exceeds maximum label length" ,
9696 "data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
9797 "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
98123 }
99124 ]
100125 }
Original file line number Diff line number Diff line change 301301 "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" ,
302302 "data" : " \u0628\u064a\u200c\u0628\u064a " ,
303303 "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
304329 }
305330 ]
306331 }
Original file line number Diff line number Diff line change 9292 "description" : " exceeds maximum label length" ,
9393 "data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
9494 "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
95115 }
96116 ]
97117 }
Original file line number Diff line number Diff line change 9292 "description" : " exceeds maximum label length" ,
9393 "data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
9494 "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
95115 }
96116 ]
97117 }
Original file line number Diff line number Diff line change 9292 "description" : " exceeds maximum label length" ,
9393 "data" : " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com" ,
9494 "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
95115 }
96116 ]
97117 }
You can’t perform that action at this time.
0 commit comments