%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jsonschema/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jsonschema/tests/__pycache__/test_format.cpython-312.pyc

�

`��d���p�dZddlmZddlmZmZmZddlmZe	d�Z
ed�Zd�Z
Gd�d	e�Zy
)zH
Tests for the parts of jsonschema related to the :kw:`format` keyword.
�)�TestCase)�
FormatChecker�FormatError�ValidationError)�Draft4ValidatorzBoom!zBang!c�$�|dk(rt�t�)N�bang)�BANG�BOOM��things �>/usr/lib/python3/dist-packages/jsonschema/tests/test_format.py�boomrs������
�
�J�c�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�TestFormatCheckerc�R�td��}|j|j�y)N���formats)r�assertFalse�checkers��self�checkers  r�test_it_can_validate_no_formatsz1TestFormatChecker.test_it_can_validate_no_formatss ����+������)�)�*rc�r�|jt�5tdg��ddd�y#1swYyxYw)Nzo noesr)�assertRaises�KeyErrorr)rs r�.test_it_raises_a_key_error_for_unknown_formatsz@TestFormatChecker.test_it_raises_a_key_error_for_unknown_formatss/��
�
�
�x�
(�	.��8�*�-�	.�	.�	.�s�-�6c�*�ttj�}|jtjjd�tj
d�t�|jtjt|tdf���y�Nrr)r)�dictrr�
addCleanup�pop�
cls_checksr�assertEqual)r�originals  r�!test_it_can_register_cls_checkersz3TestFormatChecker.test_it_can_register_cls_checkerssf���
�.�.�/�����
�.�.�2�2�F�;�(�
� � ��(��.�����"�"����r�
�+�	
rc���t�}|jd�t�|j|jttjtdf���yr")r�checksrr'rr#rs  r�test_it_can_register_checkersz/TestFormatChecker.test_it_can_register_checkers&sG���/������v��t�$���������'�'�t�R�j�9�	
rc��t�}|jdtt���t�|jt�5}|jdd��ddd�|jjjt�|j|jjt�|jtt��5|jdd��ddd�y#1swY��xYw#1swYyxYw)Nr��raises���instance�formatr	)
rr+�typerrrr�check�assertIs�	exception�cause�	__cause__r
)rr�cms   r�!test_it_catches_registered_errorsz3TestFormatChecker.test_it_catches_registered_errors.s����/��1����v�d�4�j��1�$�7�
�
�
�{�
+�	6�r��M�M�2�f�M�5�	6�	
�
�
�b�l�l�(�(�$�/��
�
�b�l�l�,�,�d�3��
�
�t�D�z�
*�	:��M�M�6�&�M�9�	:�	:�	6�	6��	:�	:�s�
C5�D�5C>�D
c��t�}|jdt��t�t	ddi|��}|jt�5}|jd�ddd�|jjjt�|j|jjt�y#1swY�^xYw)Nrr.r3)�format_checkerr)
rr+�
ValueErrorrrrr�validater6r7r8rr9)rr�	validatorr:s    r�7test_format_error_causes_become_validation_error_causeszITestFormatChecker.test_format_error_causes_become_validation_error_causes<s����/��1����v�j��1�$�7�#�X�v�$6�w�O�	�
�
�
��
/�	'�2����v�&�	'�	
�
�
�b�l�l�(�(�$�/��
�
�b�l�l�,�,�d�3�		'�	'�s�B?�?Cc��t�}|jt�5|jdd��ddd�y#1swYyxYw)Nznot-an-ipv4�ipv4r1)rrrr5rs  r�'test_format_checkers_come_with_defaultsz9TestFormatChecker.test_format_checkers_come_with_defaultsGsB��
 �/��
�
�
�{�
+�	A��M�M�=��M�@�	A�	A�	A�s	�=�Ac���td��}|jd�d��|jd�d��|jd�d��|jt|�d	�y)
Nrr�fooc��y�NTrrs r�<lambda>z-TestFormatChecker.test_repr.<locals>.<lambda>R��r�barc��yrHrrs rrIz-TestFormatChecker.test_repr.<locals>.<lambda>SrJr�bazc��yrHrrs rrIz-TestFormatChecker.test_repr.<locals>.<lambda>TrJrz.<FormatChecker checkers=['bar', 'baz', 'foo']>)rr+r'�reprrs  r�	test_reprzTestFormatChecker.test_reprPs`����+������u��0�1�����u��0�1�����u��0�1������M�<�	
rc�
�	ddlm}t�}|j|j	dd��|j|j	dd��|j|j	dd��y#t$rYywxYw)Nr)�is_duration��duration�P4Y�test)�jsonschema._formatrRr�
assertTrue�conformsr�ImportError)rrRrs   r�test_duration_formatz&TestFormatChecker.test_duration_formatZsu��	C�6�$�o�G��O�O�G�,�,�Q�
�;�<��O�O�G�,�,�U�J�?�@����W�-�-�f�j�A�B��
�	��	�s�A6�6	B�Bc���t�}|j|jdd��|j|jdd��|j|jdd��y)NrS�uuidz$6e6659ec-4503-4428-9f03-2e2ea4d6c278rV)rrXrYrrs  r�test_uuid_formatz"TestFormatChecker.test_uuid_formates\���/������(�(��F�3�4�������C�V�L�	
�	
����)�)�&�&�9�:rN)
�__name__�
__module__�__qualname__rr r)r,r;rArDrPr[r^rrrrrs6��+�.�
�
�:�	4�A�
�	C�;rrN)�__doc__�unittestr�
jsonschemarrr�jsonschema.validatorsrr>r�ZeroDivisionErrorr
rrrrr�<module>rgs?����B�B�1��'�����!���W;��W;r

Zerion Mini Shell 1.0