HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/jsonschema/tests/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/jsonschema/tests/__pycache__/test_format.cpython-311.pyc
�

�r�c����dZddlmZddlmZmZmZddlmZe	d��Z
ed��Zd�Z
Gd�d	e��Zd
S)zH
Tests for the parts of jsonschema related to the :kw:`format` keyword.
�)�TestCase)�
FormatChecker�FormatError�ValidationError)�Draft4ValidatorzBoom!zBang!c�*�|dkrt�t�)N�bang)�BANG�BOOM��things �>/usr/lib/python3/dist-packages/jsonschema/tests/test_format.py�boomrs�������
�
�J�c�J�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�TestFormatCheckerc�Z�td���}|�|j��dS)N���formats)r�assertFalse�checkers��self�checkers  r�test_it_can_validate_no_formatsz1TestFormatChecker.test_it_can_validate_no_formatss/����+�+�+������)�*�*�*�*�*rc��|�t��5tdg���ddd��dS#1swxYwYdS)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
�:�>�>c�2�ttj��}|�tjjd��tjd��t��|�tjt|tdf�����dS�Nrr)r)�dictrr�
addCleanup�pop�
cls_checksr�assertEqual)r�originals  r�!test_it_can_register_cls_checkersz3TestFormatChecker.test_it_can_register_cls_checkerss����
�.�/�/�����
�.�2�F�;�;�;�(�
� ��(�(��.�.�.�����"����r�
�+�+�+�	
�	
�	
�	
�	
rc���t��}|�d��t��|�|jttjtdf�����dSr")r�checksrr'rr#rs  r�test_it_can_register_checkersz/TestFormatChecker.test_it_can_register_checkers&sf���/�/������v���t�$�$�$��������'�t�R�j�9�9�9�	
�	
�	
�	
�	
rc�d�t��}|�dtt�����t��|�t��5}|�dd���ddd��n#1swxYwY|�|j	j
t��|�|j	jt��|�tt����5|�dd���ddd��dS#1swxYwYdS)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.sw���/�/��1����v�d�4�j�j��1�1�$�7�7�7�
�
�
�{�
+�
+�	6�r��M�M�2�f�M�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	
�
�
�b�l�(�$�/�/�/��
�
�b�l�,�d�3�3�3��
�
�t�D�z�z�
*�
*�	:�	:��M�M�6�&�M�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s$� B�B�B�D%�%D)�,D)c��t��}|�dt���t��t	ddi|���}|�t��5}|�d��ddd��n#1swxYwY|�|j	j
t��|�|j	jt��dS)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�1�$�7�7�7�#�X�v�$6�w�O�O�O�	�
�
�
��
/�
/�	'�2����v�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	
�
�
�b�l�(�$�/�/�/��
�
�b�l�,�d�3�3�3�3�3s�&B�B�Bc��t��}|�t��5|�dd���ddd��dS#1swxYwYdS)Nznot-an-ipv4�ipv4r1)rrrr5rs  r�'test_format_checkers_come_with_defaultsz9TestFormatChecker.test_format_checkers_come_with_defaultsGs���
 �/�/��
�
�
�{�
+�
+�	A�	A��M�M�=��M�@�@�@�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A����	A�	A�	A�	A�	A�	As�A�A�Ac�&�td���}|�d��d���|�d��d���|�d��d���|�t|��d	��dS)
Nrr�fooc��dS�NTrrs r�<lambda>z-TestFormatChecker.test_repr.<locals>.<lambda>R���D�r�barc��dSrHrrs rrIz-TestFormatChecker.test_repr.<locals>.<lambda>SrJr�bazc��dSrHrrs rrIz-TestFormatChecker.test_repr.<locals>.<lambda>TrJrz.<FormatChecker checkers=['bar', 'baz', 'foo']>)rr+r'�reprrs  r�	test_reprzTestFormatChecker.test_reprPs�����+�+�+������u���0�0�1�1�1�����u���0�0�1�1�1�����u���0�0�1�1�1������M�M�<�	
�	
�	
�	
�	
rc�H�	ddlm}t��}|�|�dd����|�|�dd����|�|�dd����dS#t$rYdSwxYw)Nr)�is_duration��duration�P4Y�test)�jsonschema._formatrRr�
assertTrue�conformsr�ImportError)rrRrs   r�test_duration_formatz&TestFormatChecker.test_duration_formatZs���	C�6�6�6�6�6�6�$�o�o�G��O�O�G�,�,�Q�
�;�;�<�<�<��O�O�G�,�,�U�J�?�?�@�@�@����W�-�-�f�j�A�A�B�B�B�B�B��
�	�	�	��D�D�	���s�B�
B!� B!c��t��}|�|�dd����|�|�dd����|�|�dd����dS)NrS�uuidz$6e6659ec-4503-4428-9f03-2e2ea4d6c278rV)rrXrYrrs  r�test_uuid_formatz"TestFormatChecker.test_uuid_formates����/�/������(�(��F�3�3�4�4�4�������C�V�L�L�	
�	
�	
�	
����)�)�&�&�9�9�:�:�:�:�:rN)
�__name__�
__module__�__qualname__rr r)r,r;rArDrPr[r^rrrrrs�������+�+�+�.�.�.�
�
�
�
�
�
�:�:�:�	4�	4�	4�A�A�A�
�
�
�	C�	C�	C�;�;�;�;�;rrN)�__doc__�unittestr�
jsonschemarrr�jsonschema.validatorsrr>r�ZeroDivisionErrorr
rrrrr�<module>rgs�����������B�B�B�B�B�B�B�B�B�B�1�1�1�1�1�1��z�'�������!�!�����W;�W;�W;�W;�W;��W;�W;�W;�W;�W;r