+
    Bit                     z    R t ^ RIHt ^ RIHtHt ^ RIHt ^ RIH	t	 ]
! R4      t]! R4      tR t ! R R	]4      tR
# )zH
Tests for the parts of jsonschema related to the :kw:`format` keyword.
)TestCase)FormatCheckerValidationError)FormatError)Draft4ValidatorzBoom!zBang!c                 (    V R 8X  d   \         h\        h)bang)BANGBOOMthings   &Z/var/www/html/photoedit/myenv/lib/python3.14/site-packages/jsonschema/tests/test_format.pyboomr      s    

J    c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )TestFormatCheckerc                T    \        RR 7      pV P                  VP                  4       R# )formatsN )r   assertFalsecheckersselfcheckers   & r   test_it_can_validate_no_formats1TestFormatChecker.test_it_can_validate_no_formats   s     +))*r   c                    V P                  \        4      ;_uu_ 4        \        R .R7       RRR4       R#   + '       g   i     R# ; i)zo noesr   N)assertRaisesKeyErrorr   )r   s   &r   .test_it_raises_a_key_error_for_unknown_formats@TestFormatChecker.test_it_raises_a_key_error_for_unknown_formats   s,    x((8*- )(((s	   6A	c                   \        \        P                  4      pV P                  \        P                  P                  R 4       V P                  \        4      ;_uu_ 4        \        P                  ! R 4      ! \        4       RRR4       V P                  \        P                  \        V\        R3R7      4       R#   + '       g   i     LC; i)r   Nr   r   )
dictr   r   
addCleanuppopassertWarnsDeprecationWarning
cls_checksr   assertEqual)r   originals   & r   !test_it_can_register_cls_checkers3TestFormatChecker.test_it_can_register_cls_checkers   s    ../..22F;011$$V,T2 2""r
+	
 21s   !!B==C	c                    \        4       pVP                  R 4      ! \        4       V P                  VP                  \        \         P                  \        R3R7      4       R# )r   r#   Nr   )r   checksr   r*   r   r$   r   s   & r   test_it_can_register_checkers/TestFormatChecker.test_it_can_register_checkers(   sE    /vt$''tRj9	
r   c                   \        4       pVP                  R \        \        4      R7      ! \        4       V P                  \        4      ;_uu_ 4       pVP                  ^R R7       RRR4       V P                  XP                  P                  \        4       V P                  VP                  P                  \        4       V P                  \        VP                  4      R4       V P                  \        \        4      4      ;_uu_ 4        VP                  RR R7       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   raisesinstanceformatNz12 is not a 'boom'r   )r   r/   typer
   r   r   r   checkassertIs	exceptioncause	__cause__r*   strr	   )r   r   cms   &  r   !test_it_catches_registered_errors3TestFormatChecker.test_it_catches_registered_errors0   s    /vd4j1$7{++rMM2fM5 , 	bll(($/bll,,d3R\\*,@A tDz**MM6&M9 +* ,+ +**s   D+D>+D;	>E	c                   \        4       pVP                  R \        R7      ! \        4       \	        RR /VR7      pV P                  \        4      ;_uu_ 4       pVP                  R4       RRR4       V P                  XP                  P                  \        4       V P                  VP                  P                  \        4       R#   + '       g   i     Lf; i)r   r3   r7   )format_checkerr
   N)r   r/   
ValueErrorr   r   r   r   validater:   r;   r<   r
   r=   )r   r   	validatorr?   s   &   r   7test_format_error_causes_become_validation_error_causesITestFormatChecker.test_format_error_causes_become_validation_error_causes?   s    /vj1$7#Xv$6wO	//2v& 0 	bll(($/bll,,d3	 0/s   CC	c                    \        4       pV P                  \        4      ;_uu_ 4        VP                  R RR7       RRR4       R#   + '       g   i     R# ; i)znot-an-ipv4ipv4r5   N)r   r   r   r9   r   s   & r   'test_format_checkers_come_with_defaults9TestFormatChecker.test_format_checkers_come_with_defaultsJ   s;    
  /{++MM=M@ ,+++s   AA	c                    \        R	R 7      pVP                  R4      ! R 4       VP                  R4      ! R 4       VP                  R4      ! R 4       V P                  \        V4      R4       R# )
r   fooc                     R # Tr   r   s   &r   <lambda>-TestFormatChecker.test_repr.<locals>.<lambda>U       Dr   barc                     R # rP   r   r   s   &r   rQ   rR   V   rS   r   bazc                     R # rP   r   r   s   &r   rQ   rR   W   rS   r   z.<FormatChecker checkers=['bar', 'baz', 'foo']>Nr   )r   r/   r*   reprr   s   & r   	test_reprTestFormatChecker.test_reprS   sZ    +u01u01u01M<	
r   r   N)__name__
__module____qualname____firstlineno__r   r    r,   r0   r@   rG   rK   rY   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s3     +.

:	4A
 
r   r   N)__doc__unittestr   
jsonschemar   r   jsonschema.exceptionsr   jsonschema.validatorsr   rD   r
   ZeroDivisionErrorr	   r   r   r   r   r   <module>rh      s?     5 - 1'!F
 F
r   