
    Bvh!                     P
   d Z ddlmZ ddlZ e       Zej                  d      Zej                  d      Zej                  d      Zej                  d      Z	ej                  d	      Z
ej                  d
      Zd Zd Zd Zd Zd Zej#                  ej%                         ej'                         ej)                  d      ej)                  d      ej)                  d      ej*                  ej*                  j,                  d       Zej#                  ej%                         ej'                         ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej0                  ej0                  j,                  d 
      Zej#                  ej%                         ej'                         ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej4                  ej4                  j,                  d 	      Ze	j#                  e	j%                         e	j'                         e	j)                  d      e	j)                  d      e	j)                  d      ej)                  d      e	j)                  d      e	j)                  d      ej8                  ej8                  j,                  d       Ze
j#                  e
j%                         e
j)                  d      e
j)                  d      e
j)                  d      e
j)                  d      e
j)                  d      e
j)                  d      e
j)                  d      e
j)                  d      e
j)                  d      ej<                   edd d!"      #      Ze
j#                  e
j'                         d$ej<                  ej<                  j,                  d% &      Z ej#                  ej%                         e
j)                  d      ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej)                  d      ej)                  d      ejB                   edd d!"      #      Z"ej#                  ej'                         d'ejB                  ejB                  j,                  d( &      Z#y))z
Test runner for the JSON Schema official test suite

Tests comprehensive correctness of each draft's validator.

See https://github.com/json-schema-org/JSON-Schema-Test-Suite for details.
    )SuiteNdraft3)namedraft4draft6draft7zdraft2019-09zdraft2020-12c                       fd}|S )Nc                 P     t         fdj                         D              rS y )Nc              3   B   K   | ]  \  }}|t        |      k(    y wN)getattr).0attrvaluetests      U/RAG/venv/lib/python3.12/site-packages/jsonschema/tests/test_jsonschema_test_suite.py	<genexpr>z(skip.<locals>.skipper.<locals>.<genexpr>   s"     N~eud++~s   )allitems)r   kwargsmessages   `r   skipperzskip.<locals>.skipper   s"    Nv||~NNN O     )r   r   r   s   `` r   skipr      s     Nr   c                 $    | j                   dk(  ryy )Nzecmascript-regexz*ECMA regex support will be added in #1142.)subjectr   s    r   ecmascript_regexr      s    ||)); *r   c                       fd}|S )Nc                     | j                   }|du s/|du s+d|vs'|d   j                  j                  v s| j                  ry d|d   dS )NTFformatzFormat checker z not found.)schemaFORMAT_CHECKERcheckersvalid)r   r#   	Validators     r   missing_formatz&missing_format.<locals>.missing_format#   sZ    dNv%h9#;#;#D#DDzz !1 4K@@r   r   )r'   r(   s   ` r   r(   r(   "   s    A r   c                     | j                   dk7  ry d} t        |d      |       xsR  t        |d      |       xs=  t        |d      |       xs(  t        |d      |       xs  t        |d      |       S )	Nemailz8Complex email validation is (intentionally) unsupported.zan invalid domain)r   descriptionzan invalid IPv4-address-literalz!dot after local part is not validz"dot before local part is not validz3two subsequent dots inside local part are not valid)r   r   r   r   s     r   complex_email_validationr-   2   s    ||wHG4'  t5 t7 t8 tI r   c                    d} t        |dd      |       xs  t        |dd      |       xs  t        |dd      |       xs  t        |dd      |       xs  t        |dd      |       xsl  t        |dd	      |       xsV  t        |dd
      |       xs@  t        |dd      |       xs*  t        |dd      |       xs  t        |dd      |       S )NzLeap seconds are unsupported.timez$a valid time string with leap secondr   r   r+   z*a valid time string with leap second, Zuluz0a valid time string with leap second with offsetz'valid leap second, positive time-offsetz'valid leap second, negative time-offsetz-valid leap second, large positive time-offsetz-valid leap second, large negative time-offsetz#valid leap second, zero time-offsetz	date-timez)a valid date-time with a leap second, UTCz7a valid date-time with a leap second, with minus offset)r   r,   s     r   leap_secondr1   I   ss   -G4: 	 (t@ 		(tF 	(t= 	( t= 	!((tC 	)(0tC 	1(8t9 	9(@t? 	A(HtM 	I(r   bignumznon-bmp-regexzeroTerminatedFloatsc                 t    t        |       xs,  t        t        j                        |       xs t	        |       S r   )r   r(   
jsonschemaDraft3Validatorr-   r   s    r   <lambda>r7   ~   s6     	*5>*445d;	*#D)	*r   )r'   format_checkerr   zfloat-overflowidc                     t        |       xs9 t        |       xs,  t        t        j                        |       xs t        |       S r   )r   r1   r(   r5   Draft4Validatorr-   r   s    r   r7   r7      E     	*t	*5>*445d;	* $D)	*r   c                     t        |       xs9 t        |       xs,  t        t        j                        |       xs t        |       S r   )r   r1   r(   r5   Draft6Validatorr-   r   s    r   r7   r7      r<   r   zcross-draftunknownKeywordc                     t        |       xs9 t        |       xs,  t        t        j                        |       xs t        |       S r   )r   r1   r(   r5   Draft7Validatorr-   r   s    r   r7   r7      r<   r   anchorz	no-schemarefOfUnknownKeywordz(Vocabulary support is still in-progress.
vocabularyz5no validation: invalid number, but it still validatesr0   )r'   r   TestDraft201909Formatc                     t        |       xsF t        |       xs9 t        |       xs,  t        t        j
                        |       xs t        |       S r   )r-   r   r1   r(   r5   Draft201909Validatorr   s    r   r7   r7      T     & 	*D!	*t	* ;>*99:4@	* $D)		*r   )r   r'   r8   r   TestDraft202012Formatc                     t        |       xsF t        |       xs9 t        |       xs,  t        t        j
                        |       xs t        |       S r   )r-   r   r1   r(   r5   Draft202012Validatorr   s    r   r7   r7      rH   r   )$__doc__jsonschema.tests._suiter   r5   SUITEversionDRAFT3DRAFT4DRAFT6DRAFT7DRAFT201909DRAFT202012r   r   r(   r-   r1   to_unittest_testcasecasesformat_casesoptional_cases_ofr6   r$   
TestDraft3r;   
TestDraft4r>   
TestDraft6rA   
TestDraft7rG   TestDraft201909rE   rK   TestDraft202012rI   r   r   r   <module>r`      s)   * 	H	%	H	%	H	%	H	%mmm0mmm0<
 .*Z ((
LLN

(+
/2
"89((--<<
 ) 
  ((
LLN

(+
"23
$'
/2
"89((--<<
 ) 
& ((
LLN

(+
"23
$'
/2((--<<
 ) 
$ ((
LLN

(+
-0
"23
$'
/2
"23((--<<
 ) 
( 22!!x!0!!x!0!!}!5!!'7!8!!t!,!!{!3!!!7!!'<!=!!'7!8--	:C	
 3 , $88	 --22AA
 9   22!!x!0!!x!0!!}!5!!'7!8!!t!,!!{!3!!!7!!'<!=!!'7!8--	:C	
 3 , $88	 --22AA
 9  r   