Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/local/lib/python3.6/site-packages/jsonschema/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.6/site-packages/jsonschema/tests/__pycache__/test_format.cpython-36.pyc
3

F�Kd��@s\dZddlmZddlmZmZmZddlmZe	d�Z
ed�Zdd�Z
Gd	d
�d
e�ZdS)zP
Tests for the parts of jsonschema related to the :validator:`format` property.
�)�TestCase)�
FormatChecker�FormatError�ValidationError)�Draft4ValidatorzBoom!zBang!cCs|dkrt�t�dS)N�bang)�BANG�BOOM)�thing�r�B/tmp/pip-build-8nxjc3nm/jsonschema/jsonschema/tests/test_format.py�boomsr
c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�TestFormatCheckercCstfd�}|j|j�dS)N)�formats)r�assertFalse�checkers)�self�checkerrrr�test_it_can_validate_no_formatss
z1TestFormatChecker.test_it_can_validate_no_formatsc
Cs&|jt��tdgd�WdQRXdS)Nzo noes)r)�assertRaises�KeyErrorr)rrrr�.test_it_raises_a_key_error_for_unknown_formatssz@TestFormatChecker.test_it_raises_a_key_error_for_unknown_formatscCsFttj�}|jtjjd�tjd�t�|jtjt|tffd��dS)Nr
)r
)�dictrrZ
addCleanup�popZ
cls_checksr
�assertEqual)r�originalrrr�!test_it_can_register_cls_checkerss
z3TestFormatChecker.test_it_can_register_cls_checkerscCs4t�}|jd�t�|j|jttjtffd��dS)Nr
)r
)r�checksr
rrr)rrrrr�test_it_can_register_checkers&s
z/TestFormatChecker.test_it_can_register_checkerscCs�t�}|jdtt�d�t�|jt��}|jddd�WdQRX|j|j	j
t�|j|j	jt�|jtt���|jddd�WdQRXdS)Nr
)�raises�)�instance�formatr)
rr�typer	r
rr�check�assertIs�	exception�cause�	__cause__r)rr�cmrrr�!test_it_catches_registered_errors.sz3TestFormatChecker.test_it_catches_registered_errorsc
Cslt�}|jdtd�t�tddi|d�}|jt��}|jd�WdQRX|j|j	j
t�|j|j	jt�dS)Nr
)rr")Zformat_checkerr	)
rr�
ValueErrorr
rrr�validater%r&r'r	r()rrZ	validatorr)rrr�7test_format_error_causes_become_validation_error_causes<szITestFormatChecker.test_format_error_causes_become_validation_error_causescCs.t�}|jt��|jddd�WdQRXdS)Nznot-an-ipv4Zipv4)r!r")rrrr$)rrrrr�'test_format_checkers_come_with_defaultsGsz9TestFormatChecker.test_format_checkers_come_with_defaultscCsTtfd�}|jd�dd��|jd�dd��|jd�dd��|jt|�d	�dS)
N)rZfoocSsdS)NTr)r
rrr�<lambda>Rsz-TestFormatChecker.test_repr.<locals>.<lambda>�barcSsdS)NTr)r
rrrr/SsZbazcSsdS)NTr)r
rrrr/Tsz.<FormatChecker checkers=['bar', 'baz', 'foo']>)rrr�repr)rrrrr�	test_reprPs
zTestFormatChecker.test_reprcCsfyddlm}Wntk
r$Yn>Xt�}|j|jdd��|j|jdd��|j|jdd��dS)Nr)�is_duration��durationZP4Y�test)Zjsonschema._formatr3�ImportErrorr�
assertTrue�conformsr)rr3rrrr�test_duration_formatZsz&TestFormatChecker.test_duration_formatcCs@t�}|j|jdd��|j|jdd��|j|jdd��dS)Nr4�uuidz$6e6659ec-4503-4428-9f03-2e2ea4d6c278r6)rr8r9r)rrrrr�test_uuid_formates
z"TestFormatChecker.test_uuid_formatN)
�__name__�
__module__�__qualname__rrrrr*r-r.r2r:r<rrrrrs		
rN)�__doc__ZunittestrZ
jsonschemarrrZjsonschema.validatorsrr+r	�ZeroDivisionErrorrr
rrrrr�<module>s

haha - 2025