403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.12/site-packages/jsonschema/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.12/site-packages/jsonschema/tests/__pycache__/test_validators.cpython-312.pyc
�

�% g-H���ddlmZddlmZmZddlmZddlmZddl	m
Z
ddlmZddl
mZmZddlmZdd	lZdd	lZdd	lZdd	lZdd	lZdd
lmZmZddlmZdd	lZddlmZm Z m!Z!m"Z"m#Z#d
�Z$Gd�de�Z%Gd�de�Z&Gd�de�Z'Gd�d�Z(Gd�de(�Z)Gd�d�Z*Gd�de*e)e�Z+Gd�de*e)e�Z,Gd�de)e�Z-Gd �d!e)e�Z.Gd"�d#e)e�Z/Gd$�d%e)e�Z0Gd&�d'e�Z1Gd(�d)e�Z2Gd*�d+e�Z3Gd,�d-e�Z4Gd.�d/e�Z5Gd0�d1e�Z6d2�Z7eGd3�d4��Z8eGd5�d6��Z9y	)7�)�annotations)�deque�
namedtuple)�contextmanager)�Decimal)�BytesIO)�Any)�TestCase�mock)�pathname2urlN)�define�field)�DRAFT202012)�
FormatChecker�TypeChecker�
exceptions�	protocols�
validatorsc#�lK�|D]+}|jdd�tjdi|�����-y�w)N�messagezYou told me to fail!�)�
setdefaultr�ValidationError)�	validator�errors�instance�schema�eachs     �E/usr/lib/python3.12/site-packages/jsonschema/tests/test_validators.py�failr s3���������	�#9�:��(�(�0�4�0�0��s�24c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�TestCreateAndExtendc���|j|jtjt	tj��|j|jtj
t	tj
��ddi|_dti|_t�|_	tj|j|j|j��|_y)N�$idzsome://meta/schemar )�meta_schemar�type_checker)�
addCleanup�assertEqualr�
_META_SCHEMAS�dict�_VALIDATORSr%r rr&�create�	Validator��selfs r�setUpzTestCreateAndExtend.setUp$s����������$�$���)�)�*�	
�
	
�������"�"���'�'�(�	
�"�#7�8���!�4�.���'�M���#�*�*��(�(�����*�*�
���c���|j|jj|jj|jjf|j
|j|jf�y�N)r(r-�
VALIDATORS�META_SCHEMA�TYPE_CHECKERrr%r&r.s r�
test_attrszTestCreateAndExtend.test_attrs9s\��������)�)����*�*����+�+�
�
���� � ��!�!��
	
r1c�b�dgi}|j|j|�j|�y)Nr )r(r-r�r/rs  r�	test_initzTestCreateAndExtend.test_initFs*���"����������/�6�6��?r1c��dgi}|j|�}t|jd��}|j|g�y)Nr �hello)r-�list�iter_errorsr(�r/rrrs    r�test_iter_errors_successfulz/TestCreateAndExtend.test_iter_errors_successfulJs>���"����N�N�6�*�	��i�+�+�G�4�5�������$r1c
�P�dddigi}|j|�}tjdd|dddigtdg���}t	|jd��}|j
t|�d�|j
|dj�|j��y)Nr rzWhoops!�goodbye)rrr�validator_value�schema_path�r)	r-rrrr=r>r(�len�	_contents)r/rr�expected_errorrs     r�test_iter_errors_one_errorz.TestCreateAndExtend.test_iter_errors_one_errorQs����I�y�1�2�3���N�N�6�*�	�#�3�3�����'��3�4��v�h��

���i�+�+�I�6�7������V��a�(�������,�,�.��0H�0H�0J�Kr1c��dddiddd�ddigi}|j|�}t|jd��}|jt	|�d	�y)
Nr r�FirstzSecond!�asdf)rr�ThirdrB�)r-r=r>r(rFr?s    r� test_iter_errors_multiple_errorsz4TestCreateAndExtend.test_iter_errors_multiple_errorsbsb����G�$�%�F�;��G�$��
���N�N�6�*�	��i�+�+�I�6�7������V��a�(r1c�N�tjddid��}|jtjjd�|jtj
jd�|j
|jd�|j
|jd�y)Nr$�	something�
my version�r%�version�MyVersionValidator)	rr,r'r)�popr+r(�__name__�__qualname__�r/r-s  r�.test_if_a_version_is_provided_it_is_registeredzBTestCreateAndExtend.test_if_a_version_is_provided_it_is_registeredos����%�%���,� �
�	�	
���
�0�0�4�4�k�B����
�.�.�2�2�L�A�����+�+�-A�B�����/�/�1E�Fr1c� �tjddid��}|jtjjd�|jtj
jd�|j
t|i��d�y)Nr$rQrRrSz2MyVersionValidator(schema={}, format_checker=None))rr,r'r)rVr+r(�reprrYs  r�	test_reprzTestCreateAndExtend.test_reprysp���%�%���,� �
�	�	
���
�0�0�4�4�k�B����
�.�.�2�2�L�A������2���@�	
r1c�H�tjddid��}|jtjjd�|jtj
jd�|j
t|dttd��i��d�y)Nr$rQrRrS�ai�zNMyVersionValidator(schema={'a': [0, 1, 2, 3, 4, 5, ...]}, format_checker=None))
rr,r'r)rVr+r(r\r=�rangerYs  r�test_long_reprz"TestCreateAndExtend.test_long_repr�s����%�%���,� �
�	�	
���
�0�0�4�4�k�B����
�.�.�2�2�L�A������C��e�D�k�!2�3�4�5�'�	
r1c�r�tji��}|jt|i��d�y)N�r%z)Validator(schema={}, format_checker=None))rr,r(r\rYs  r�test_repr_no_versionz(TestCreateAndExtend.test_repr_no_version�s/���%�%�"�5�	������2���7�	
r1c��tjddid��}|jtjjd�|jtj
jd�|j
|jd�y)Nr$rQzfoo-barrS�FooBarValidator)rr,r'r)rVr+r(rXrYs  r�-test_dashes_are_stripped_from_validator_nameszATestCreateAndExtend.test_dashes_are_stripped_from_validator_names�sj���%�%���,��
�	�	
���
�0�0�4�4�k�B����
�.�.�2�2�I�>�����/�/�1B�Cr1c��ttj�}tjddi��|j	tj|�y)N�idrc)r*rr)r,r()r/�originals  r�6test_if_a_version_is_not_provided_it_is_not_registeredzJTestCreateAndExtend.test_if_a_version_is_not_provided_it_is_not_registered�s:���
�0�0�1�����t�T�l�3�����1�1�8�<r1c�*�d}d|i}tj|dd���|jtjj|�|jtj
jd�|j
|tj�y)N�meta schema idrirRc�&�|jdd�S�Nri���get��ss r�<lambda>zMTestCreateAndExtend.test_validates_registers_meta_schema_id.<locals>.<lambda>����A�E�E�$��Or1�r%rT�id_of�rr,r'r)rVr+�assertIn�r/�meta_schema_key�my_meta_schemas   r�'test_validates_registers_meta_schema_idz;TestCreateAndExtend.test_validates_registers_meta_schema_id�sr��*����0�����&� �+�	
�
	
���
�0�0�4�4�o�F����
�.�.�2�2�L�A��
�
�o�z�'?�'?�@r1c�&�d}d|i}tj|d��|jtjj|�|jtj
jd�|j
|tj�y)N�meta schema $idr$rRrSryr{s   r�.test_validates_registers_meta_schema_draft6_idzBTestCreateAndExtend.test_validates_registers_meta_schema_draft6_id�so��+����1�����&� �	
�	
���
�0�0�4�4�o�F����
�.�.�2�2�L�A��
�
�o�z�'?�'?�@r1c���tjid���|jt�fd�dgfddddd	ifd
fD���y)Nr�r%rc3�V�K�|] \}}�i�j||�����"y�w))r�typeN)�is_type)�.0r�rr-s   �r�	<genexpr>z@TestCreateAndExtend.test_create_default_types.<locals>.<genexpr>�s5������'�N�D�(��"�
�%�%�x�d�%�C�'�s�&)�array)�booleanT)�integer�)�nullN)�numberg(@�object)�string�foo)rr,�
assertTrue�allrYs @r�test_create_default_typesz-TestCreateAndExtend.test_create_default_types�sW����%�%�"��D�	�������b�M�%�#�"�$��r�N�%�'��
�
	
r1c�R�tjtjjddiid���}|j	ddi�|jtj�5|j	i�ddd�|ddi�jd�y#1swY�#xYw)zq
        One can create a validator class whose metaschema uses a different
        dialect than itself.
        r$�const)�$schema�notrcr��barN)	rr,�Draft202012Validatorr5�check_schema�assertRaisesr�SchemaError�validate�r/�NoEmptySchemasValidators  r�+test_check_schema_with_different_metaschemaz?TestCreateAndExtend.test_check_schema_with_different_metaschema�s���#-�"3�"3�%�:�:�F�F�u�M���}��#
��	 �,�,�e�U�^�<�
�
�
�z�5�5�
6�#�0�0��4�7�	 ����/�8�8��?�7�
6�s�)B�B&c���tjdddigidti��}|jtj
�5|j
i�ddd�y#1swYyxYw)z�
        A validator whose metaschema doesn't declare $schema defaults to its
        own validation behavior, not the latest "normal" specification.
        r rzMeta schema whoops!r�N)rr,r r�rr�r�r�s  r�<test_check_schema_with_different_metaschema_defaults_to_selfzPTestCreateAndExtend.test_check_schema_with_different_metaschema_defaults_to_self�s]��#-�"3�"3��9�.C�"D�!E�F���~�#
���
�
�z�5�5�
6�#�0�0��4�7�
6�
6�s�A�A&c��t|jj�}t�}t	j
|jd|i��}|j
|j|j|j|jjft||��|jj|jj|f�y)N�new)r)r�)	r*r-r4r�r�extendr(r5r6)r/rjr��Extendeds    r�test_extendzTestCreateAndExtend.test_extend�s�������1�1�2���h���$�$��N�N��s�|�
��	
����#�#��$�$��%�%����)�)�	
��X�3�'����*�*����+�+��	�
	
r1c�N���fd�}d}d|d�}tj|�j�j|��}�j|j	|j
�|�tj|�}�j|j	|j
�|�y)zK
        Extending a validator preserves its notion of schema IDs.
        c�Z��|jd�jj|��S)N�__test__)rrr-�ID_OF)rr/s �rrxz3TestCreateAndExtend.test_extend_idof.<locals>.id_ofs#����:�:�j�$�.�.�*>�*>�v�*F�G�Gr1zthe://correct/id/zthe://wrong/id/)r$r�)r%rr&rxN)rr,r&r(r�r5r�)r/rx�
correct_idr%�Original�Deriveds`     r�test_extend_idofz$TestCreateAndExtend.test_extend_idof
s����	H�(�
�$�"�
���$�$�#�����*�*��	
��	
�������(<�(<�=�z�J��#�#�H�-��������w�':�':�;�Z�Hr1c��dddiiddd�}tj|�}|j|jd��tjtj�}|j||�jd��y)	zV
        Extending a validator preserves its notion of applicable validators.
        �testr�r�z#/$defs/testrE)�$defs�$ref�maximum�%N)r�Draft4Validatorr��is_validr�)r/r�draft4r�s    r�!test_extend_applicable_validatorsz5TestCreateAndExtend.test_extend_applicable_validators sv���v�x�0�1�"��
���+�+�F�3���������+�,��#�#�J�$>�$>�?��������0�0��4�5r1N)rW�
__module__rXr0r7r:r@rIrOrZr]rardrgrkr~r�r�r�r�r�r�r�rr1rr"r"#sn��
�*
�@�%�L�")�G�

�
�
�D�=�
A�A�
�"@�&5�
�,I�,6r1r"c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-d,�Z.d-�Z/y.)/�TestValidationErrorMessagesc�:�|jdtj�}|j|�||g|��i|��}t	|j|��}|j
|d|����|jt|�dd|����|djS)N�clszNo errors were raised for )�msgrEz"Expected exactly one error, found r)
rVr�_LATEST_VERSIONr�r=r>r�r(rFr)r/rr�args�kwargsr�rrs        r�message_forz'TestValidationErrorMessages.message_for3s����j�j��
� :� :�;������ ���0��0��0�	��i�+�+�H�5�6������&@���$M��N������K�
�4�V�J�?�	�	
�
�a�y� � � r1c�R�|jdddi��}|j|d�y�NrEr�r��rr�1 is not of type 'string'�r�r(�r/rs  r�test_single_type_failurez4TestValidationErrorMessages.test_single_type_failure@s-���"�"�A�v�x�6H�"�I������"=�>r1c�T�|jdddgi��}|j|d�yr�r�r�s  r�test_single_type_list_failurez9TestValidationErrorMessages.test_single_type_list_failureDs/���"�"�A�v��z�6J�"�K������"=�>r1c�h�d}|jddt|�i��}|j|d�y)N)r�r�rEr�r�z#1 is not of type 'string', 'object')r�r=r()r/�typesrs   r�test_multiple_type_failurez6TestValidationErrorMessages.test_multiple_type_failureHs6��"���"�"�A�v�t�E�{�6K�"�L������"G�Hr1c�|�dddd�gi}|jd|tj��}|j|d�y)Nr��FoorN)�name�minimumrE�rrr�z1 is not of type 'Foo'�r�r�Draft3Validatorr(�r/rrs   r�#test_object_with_named_type_failurez?TestValidationErrorMessages.test_object_with_named_type_failureMsK���E�a�8�9�:���"�"����*�*�#�
��
	
����":�;r1c�R�|jdddi��}|j|d�y)NrEr��r�z1 is less than the minimum of 2r�r�s  r�test_minimumz(TestValidationErrorMessages.test_minimumVs,���"�"�A�y�!�n�"�E������"C�Dr1c�R�|jdddi��}|j|d�y)NrEr�rr�z"1 is greater than the maximum of 0r�r�s  r�test_maximumz(TestValidationErrorMessages.test_maximumZs,���"�"�A�y�!�n�"�E������"F�Gr1c��d\}}d||ii}|jddi|tj��}|j|d�y�N�r�r��dependenciesr�r�r�z'foo' is a dependency of 'bar'r��r/�depend�onrrs     r� test_dependencies_single_elementz<TestValidationErrorMessages.test_dependencies_single_element^sT��!�
��� �6�2�,�/���"�"��Q�Z���*�*�#�
��
	
����"B�Cr1c��dddigi}|jdd|gitj��}|j|d�y)Nr�r�rNrEr�z+1 is not of type {'type': [{'minimum': 3}]}r�)r/r�rs   r�-test_object_without_title_type_failure_draft3zITestValidationErrorMessages.test_object_without_title_type_failure_draft3hsT���)�Q��(�)���"�"���T�F�#��*�*�#�
��
	
����9�	
r1c��d\}}d||gii}|jddi|tj��}|j|d�yr�r�r�s     r�test_dependencies_list_draft3z9TestValidationErrorMessages.test_dependencies_list_draft3t�V��!�
��� �6�B�4�.�1���"�"��Q�Z���*�*�#�
��
	
����"B�Cr1c��d\}}d||gii}|jddi|tj��}|j|d�yr�)r�r�Draft7Validatorr(r�s     r�test_dependencies_list_draft7z9TestValidationErrorMessages.test_dependencies_list_draft7~r�r1c�t�|jdggdd�tj��}|jd|�y)Nr�F��items�additionalItemsr�z(2 was unexpected)�r�rr�rzr�s  r�#test_additionalItems_single_failurez?TestValidationErrorMessages.test_additionalItems_single_failure�s>���"�"��S��E�:��*�*�#�
��
	
�
�
�*�G�4r1c�v�|jgd�gdd�tj��}|jd|�y)N�rEr�rNFr�r�z(1, 2, 3 were unexpected)r�r�s  r�&test_additionalItems_multiple_failureszBTestValidationErrorMessages.test_additionalItems_multiple_failures�s<���"�"���E�:��*�*�#�
��
	
�
�
�1�7�;r1c�^�d}ddi}|j|di|��}|jd|�y)Nr��additionalPropertiesFr�r�z('foo' was unexpected)�r�rz)r/�
additionalrrs    r�(test_additionalProperties_single_failurezDTestValidationErrorMessages.test_additionalProperties_single_failure�s9���
�(�%�0���"�"�Z��O�F�"�K���
�
�.��8r1c���ddi}|jtjddg�|��}|jt	d�|�|jt	d�|�|jd|�y)Nr�Fr�r�r�zwere unexpected))r�r*�fromkeysrzr\r�s   r�+test_additionalProperties_multiple_failureszGTestValidationErrorMessages.test_additionalProperties_multiple_failures�si��(�%�0���"�"��]�]�E�5�>�2��#�
��
	
�
�
�d�5�k�7�+��
�
�d�5�k�7�+��
�
�(�'�2r1c�Z�ddi}|jddi|��}|jd|�y)Nr�r�r�r�r�z12 was expectedr�r�s   r�
test_constz&TestValidationErrorMessages.test_const�s;���2����"�"��U�^��#�
��	
�
�
�'��1r1c�~�dddii}|jdigg|tj��}|j|d�y)N�containsr�r�r�r�z4None of [2, {}, []] are valid under the given schema)r�r�Draft6Validatorr(r�s   r�test_contains_draft_6z1TestValidationErrorMessages.test_contains_draft_6�sP���w��m�,���"�"���R�[���*�*�#�
��
	
����B�	
r1c��td��}|jd�d��ddi}|jd||��}|jt	d�|�|jt	d�|�|jd|�y)	Nr)�formats�thingc��y�NFr)�values rruzQTestValidationErrorMessages.test_invalid_format_default_message.<locals>.<lambda>�s��er1�format�bla)rr�format_checkerzis not a)r�checksr�rzr\)r/�checkerrrs    r�#test_invalid_format_default_messagez?TestValidationErrorMessages.test_invalid_format_default_message�s|����+������w�� 3�4��G�$���"�"���"�#�
��	
�
�
�d�5�k�7�+��
�
�d�7�m�W�-��
�
�j�'�*r1c��ddddiddid�d�}|jddi|tj�	�}|j|d
j	td�td�td���|jdd
d�|tj�	�}|j|dj	td�td�td�td���y)Nr�Fr�r�)�^abc$�^def$)r�r��patternProperties�zebra�{r�z,{} does not match any of the regexes: {}, {}rri�)r�fishz.{}, {} do not match any of the regexes: {}, {}r)r�rr�r(rr\r�s   r�1test_additionalProperties_false_patternPropertieszMTestValidationErrorMessages.test_additionalProperties_false_patternProperties�s���"�*/� &��1� &��1�(����"�"��s�^���*�*�#�
��
	
����:�A�A��W�
�t�G�}�d�7�m�
�	
��"�"�"�C�0���*�*�#�
��
	
����<�C�C��V��d�7�m�T�'�]�D��M�
�	
r1c�N�|jdd��}|j|d�y)NrQFr�z'False schema does not allow 'something'r�r�s  r�test_False_schemaz-TestValidationErrorMessages.test_False_schema�s0���"�"� ��#�
��	
����"K�Lr1c�R�|jdddi��}|j|d�y)NrN�
multipleOfr�r�z3 is not a multiple of 2r�r�s  r�test_multipleOfz+TestValidationErrorMessages.test_multipleOf�s5���"�"�� �!�$�#�
��	
����"<�=r1c�R�|jgddi��}|j|d�y)N�minItemsr�r�z[] is too shortr�r�s  r�
test_minItemsz)TestValidationErrorMessages.test_minItems�s,���"�"�B�
�A��"�G������"3�4r1c�V�|jgd�ddi��}|j|d�y)Nr��maxItemsr�r�z[1, 2, 3] is too longr�r�s  r�
test_maxItemsz)TestValidationErrorMessages.test_maxItems�s,���"�"�I�z�1�o�"�N������"9�:r1c�\�|jgd�diigd���}|j|d�y)N�rEr�r��F�r��prefixItemsr�z%Expected at most 2 items, but found 4r�r�s  r�test_prefixItems_with_itemsz7TestValidationErrorMessages.test_prefixItems_with_itemss9���"�"�%�"�B��8�<�#�
��	
����"I�Jr1c�R�|jdddi��}|j|d�y)Nrp�	minLengthr�r�z'' is too shortr�r�s  r�test_minLengthz*TestValidationErrorMessages.test_minLengths5���"�"����#�#�
��	
����"3�4r1c�R�|jdddi��}|j|d�y)N�abc�	maxLengthr�r�z'abc' is too longr�r�s  r�test_maxLengthz*TestValidationErrorMessages.test_maxLengths5���"�"����#�#�
��	
����"5�6r1c�R�|jdddi��}|j|d�y)N�bbb�patternz^a*$r�z'bbb' does not match '^a*$'r�r�s  r�test_patternz(TestValidationErrorMessages.test_patterns5���"�"���v�&�#�
��	
����"?�@r1c�V�|jgdddii��}|j|d�y)Nrr�r�r�z3[] does not contain items matching the given schemar�r�s  r�test_does_not_containz1TestValidationErrorMessages.test_does_not_contains=���"�"����� 2�3�#�
��	
����A�	
r1c�\�|jddgddidd���}|j|d�y)	Nr�rEr�r�r��r�minContainsr��MToo few items match the given schema (expected at least 2 but only 1 matched)r�r�s  r�test_contains_too_fewz1TestValidationErrorMessages.test_contains_too_few&sC���"�"��Q�Z�!'�� 2�1�E�#�
��	
����
7�	
r1c�^�|jddgddiddd���}|j|d	�y)
Nr�rEr�r�r���rr:�maxContainsr�r;r�r�s  r�&test_contains_too_few_both_constrainedzBTestValidationErrorMessages.test_contains_too_few_both_constrained1sI���"�"��Q�Z�#�X�.� � ��#�
��	
����
�	
r1c�\�|jgd�ddidd���}|j|d�y)N�r�r��bazr�r�r��rr@r��:Too many items match the given schema (expected at most 2)r�r�s  r�test_contains_too_manyz2TestValidationErrorMessages.test_contains_too_many@s=���"�"�*�!'�� 2�1�E�#�
��	
����H�	
r1c�b�|jdgdzddiddd���}|j|d	�y)
Nr�r'r�r�r�r>r?r�z:Too many items match the given schema (expected at most 4)r�r�s  r�'test_contains_too_many_both_constrainedzCTestValidationErrorMessages.test_contains_too_many_both_constrainedJsI���"�"��W�q�[�#�X�.� � ��#�
��	
����H�	
r1c�R�|jdddi��}|j|d�y)NrN�exclusiveMinimumr'r�z+3 is less than or equal to the minimum of 5r�r�s  r�test_exclusiveMinimumz1TestValidationErrorMessages.test_exclusiveMinimumXs8���"�"��&��*�#�
��	
����9�	
r1c�R�|jdddi��}|j|d�y)NrN�exclusiveMaximumr�r�z.3 is greater than or equal to the maximum of 2r�r�s  r�test_exclusiveMaximumz1TestValidationErrorMessages.test_exclusiveMaximumbs1���"�"�A�7I�1�6M�"�N������<�	
r1c�T�|jiddgi��}|j|d�y)N�requiredr�r�z'foo' is a required propertyr�r�s  r�
test_requiredz)TestValidationErrorMessages.test_requiredis/���"�"�B�
�U�G�7L�"�M������"@�Ar1c�\�|jdiidddgii��}|j|d�y)Nr��dependentRequiredr�r�z'bar' is a dependency of 'foo'r�r�s  r�test_dependentRequiredz2TestValidationErrorMessages.test_dependentRequiredms@���"�"��R�[�'�%�%��)9�:�#�
��	
����"B�Cr1c�R�|jiddi��}|j|d�y)N�
minPropertiesr�r�z"{} does not have enough propertiesr�r�s  r�test_minPropertiesz.TestValidationErrorMessages.test_minPropertiests-���"�"�B���7K�"�L������"F�Gr1c�Z�|jiiid�ddi��}|j|d�y)N)r_�b�c�
maxPropertiesr�r�z3{'a': {}, 'b': {}, 'c': {}} has too many propertiesr�r�s  r�test_maxPropertiesz.TestValidationErrorMessages.test_maxPropertiesxs?���"�"��B�R�0�#�Q�'�#�
��	
����A�	
r1c�T�|jiddgi��}|j|d�y)N�oneOfFr�z.{} is not valid under any of the given schemasr�r�s  r�test_oneOf_matches_nonez3TestValidationErrorMessages.test_oneOf_matches_none�s2���"�"�B��%��7I�"�J������<�	
r1c�V�|jidddgi��}|j|d�y)Nr_Tr�z${} is valid under each of True, Truer�r�s  r�test_oneOf_matches_too_manyz7TestValidationErrorMessages.test_oneOf_matches_too_many�s1���"�"�B��$���7N�"�O������"H�Ir1c�\�ddd�}|jddg|��}|j|d�y)Nr�F�r��unevaluatedItemsr�r�r�z@Unevaluated items are not allowed ('bar', 'foo' were unexpected)r�r�s   r�test_unevaluated_itemsz2TestValidationErrorMessages.test_unevaluated_items�s7��!�u�=���"�"�U�E�N�6�"�J���
�
��N�	
r1c�X�ddd�}|jd|��}|j|d�y)Nr�Frdr�r�z'foo' is not of type 'array'r�r�s   r�&test_unevaluated_items_on_invalid_typezBTestValidationErrorMessages.test_unevaluated_items_on_invalid_type�s2��!�u�=���"�"�E�&�"�A������"@�Ar1c�l�dddiiddid�}|jdddd�|�	�}|j|d
�y)Nr�r�r�r�r�)�
properties�unevaluatedPropertiesr�rCr�z_Unevaluated properties are not valid under the given schema ('bar' was unevaluated and invalid)r�r�s   r�5test_unevaluated_properties_invalid_against_subschemazQTestValidationErrorMessages.test_unevaluated_properties_invalid_against_subschema�s_�� �6�8�"4�5�&-�r�]�
���"�"�����
�
#�
��	
����
2�	
r1c�^�ddd�}|jddd�|��}|j|d�y)	Nr�F�r�rkr�r��r�r�r�zEUnevaluated properties are not allowed ('bar', 'foo' were unexpected)r�r�s   r�&test_unevaluated_properties_disallowedzBTestValidationErrorMessages.test_unevaluated_properties_disallowed�sI��"�U�C���"�"�����#�
��	
����
-�	
r1c�X�ddd�}|jd|��}|j|d�y)Nr�Frnr�r�z'foo' is not of type 'object'r�r�s   r�+test_unevaluated_properties_on_invalid_typezGTestValidationErrorMessages.test_unevaluated_properties_on_invalid_type�s2��"�U�C���"�"�E�&�"�A������"A�Br1N)0rWr�rXr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr!r$r*r-r1r5r7r<rArGrIrLrOrRrUrXr]r`rbrfrhrlrprrrr1rr�r�2s���!�?�?�I�
<�E�H�D�

�D�D�5�<�9�	3�2�

�
+�
�<M�>�5�;�K�5�7�A�
�	
�

�
�
�
�
�B�D�H�
�
�J�
�B�

�&

�Cr1r�c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�TestValidationErrorDetailsc�6�d}dddiddigi}tj|�}t|j|��}|j	t|�d�|d}|j	|jd�|j	|j|d�|j	|j|�|j	|j|�|j|j�|j	|jtg��|j	|jtg��|j	|jtg��|j	|j d	�|j	|j"tdg��|j	|j$tdg��|j	|j&tdg��|j	t|j(�d
�t+|j(�\}}|j	|jd�|j	|j|ddd�|j	|j|�|j	|j|dd�|j-|j|�|j	|jtg��|j	|jtg��|j	|jtg��|j	|j d	�|j	|j"tddg��|j	|j$tddg��|j	|j&tgd���|j/|j(�|j	|jd�|j	|j|ddd�|j	|j|�|j	|j|dd�|j-|j|�|j	|jtg��|j	|jtg��|j	|jtg��|j	|j d	�|j	|j"tddg��|j	|j$tddg��|j	|j&tgd���|j	t|j(�d�y)
Nr'�anyOfr��r�r�rEr�$r�)rvrr�)rvrEr�)rr�r=r>r(rFrrCrr�assertIsNone�parent�pathr�
relative_path�
absolute_path�	json_pathrD�relative_schema_path�absolute_schema_path�context�
sorted_errors�assertIs�assertFalse�r/rrrr�e�e1�e2s        r�
test_anyOfz%TestValidationErrorDetails.test_anyOf�sA������B����"��
���.�.�v�6�	��i�+�+�H�5�6������V��a�(��1�I��������g�.�����*�*�F�7�O�<�������X�.�������6�*����!�(�(�#��������r��+�������%��)�4�������%��)�4�������c�*��������w�i�(8�9�����/�/���y�1A�B�����/�/���y�1A�B�����Q�Y�Y���+��q�y�y�)���B�������y�1�����+�+�V�G�_�Q�-?�	�-J�K�������h�/�������F�7�O�A�$6�7��
�
�b�i�i��#�������%��)�,�����)�)�5��9�5�����)�)�5��9�5�������s�+���������9�~�)>�?�����0�0�%��I��2G�H�����#�#�U�+B�%C�	
�	
������$�������v�.�����+�+�V�G�_�Q�-?��-G�H�������h�/�������F�7�O�A�$6�7��
�
�b�i�i��#�������%��)�,�����)�)�5��9�5�����)�)�5��9�5�������s�+���������6�{�);�<�����0�0�%��F��2D�E�����0�0�%�8L�2M�N�����R�Z�Z��!�,r1c�"�ddi}dddiddddgiid�gi}tj|�}t|j|��}|j	t|�d�|d	}|j	|jd�|j	|j|d�|j	|j|�|j	|j|�|j|j�|j	|jtg��|j	|jtg��|j	|jtg��|j	|j d
�|j	|j"tdg��|j	|j$tdg��|j	|j&tdg��|j	t|j(�d�t+|j(�\}}|j	|jd�|j	|j|dd	d�|j	|j|�|j	|j|dd	�|j-|j|�|j	|jtg��|j	|jtg��|j	|jtg��|j	|j d
�|j	|j"td	dg��|j	|j$td	dg��|j	|j&tgd���|j/|j(�|j	|jd�|j	|jdg�|j	|jd�|j	|jddgi�|j-|j|�|j	|jtdg��|j	|jtdg��|j	|jtdg��|j	|j d�|j	|j"tgd
���|j	|j$tgd
���|j	|j&tgd���|j/|j(�y)Nr�rEr�r�r��enumr��r�rjrrx)r�rr��$.foo)rErjr�r�)r�rErjr�r�)rr�r=r>r(rFrrCrrryrzr{rr|r}r~rDrr�r�r�r�r�r�s        r�	test_typez$TestValidationErrorDetails.test_type
sG���1�:�����#�$�#(�6�A�3�-�"8���
���.�.�v�6�	��i�+�+�H�5�6������V��a�(��1�I��������f�-�����*�*�F�6�N�;�������X�.�������6�*����!�(�(�#��������r��+�������%��)�4�������%��)�4�������c�*��������v�h��8�����/�/���x��A�����/�/���x��A�����Q�Y�Y���+��q�y�y�)���B�������v�.�����+�+�V�F�^�A�->�v�-F�G�������h�/�������F�6�N�1�$5�6��
�
�b�i�i��#�������%��)�,�����)�)�5��9�5�����)�)�5��9�5�������s�+���������6�{�);�<�����0�0�%��F��2D�E�����0�0�%�8K�2L�M�������$�������v�.�����+�+�a�S�1�������a�(�������V�a�S�M�2��
�
�b�i�i��#�������%���.�1�����)�)�5�%��>�:�����)�)�5�%��>�:�������w�/�����N�N�E�"B�C�	
�	
����#�#�U�+K�%L�	
�	
����#�#��:�;�	
�
	
������$r1c���ddgddd�}dddid	did
gd�d�d
�i}tj|�}|j|�}t|�\}}}}|j	|j
t
dg��|j	|j
t
dg��|j	|j
t
dg��|j	|j
t
dg��|j	|jt
dg��|j	|jt
dg��|j	|jt
dg��|j	|jt
dg��|j	|jt
dg��|j	|jt
dg��|j	|jt
dg��|j	|jt
dg��|j	|jd�|j	|jd�|j	|jd�|j	|jd�|j	|jd	�|j	|jd�|j	|jd�|j	|jd�y)Nr�rE��spam)r�r�rD�quuxrjr�r�r �
)r�r>��)r�r�rCr�rDr��$.barz$.bazr�r�r�)rr�r>r�r(r{rr|r}r~r)	r/rrrrr�r��e3�e4s	         r�test_single_nestingz.TestValidationErrorDetails.test_single_nestingWsT���a�S��V�D�����)�"�A��#%�|�<��
���.�.�v�6�	��&�&�x�0��&�v�.���B��B�������%���.�1�������%���.�1�������%���.�1�������%���.�1�����)�)�5�%��>�:�����)�)�5�%��>�:�����)�)�5�%��>�:�����)�)�5�%��>�:�����)�)�5�%��>�:�����)�)�5�%��>�:�����)�)�5�%��>�:�����)�)�5�%��>�:�������w�/�������w�/�������w�/�������w�/�������z�2�������v�.�������y�1�������v�.r1c��ddddgid�dg}dddgddd	gid
ddid
did�d�d�d�d�}tj|�}|j|�}t|�\}}}}}	}
|j	|j
t
g��|j	|j
t
dg��|j	|j
t
ddg��|j	|j
t
gd���|j	|	j
t
gd���|j	|
j
t
ddg��|j	|jd�|j	|jd�|j	|jd�|j	|jd�|j	|	jd�|j	|
jd�|j	|jt
dg��|j	|jt
ddg��|j	t|j�gd��|j	t|j�gd��|j	t|	j�gd ��|j	t|
j�gd!��|j	|jd�|j	|jd�|j	|jd�|j	|jd�|j	|	jd
�|j	|
jd�y)"NrEr�rDror�r�r�r�rNr�rQTr )r�rDr�)r�r�rr�)rEr�r�)rEr�rDr�rx�$[0]z$[1].barz$[1].bar.barz$[1].bar.bazz$[1].foor�r�)r�rjr�r�)r�rjr�rjr�rQ)r�rjr�rjrDr )r�rjr�r�)rr�r>r�r(r{rr~rDr=r)r/rrrrr�r�r�r��e5�e6s           r�test_multiple_nestingz0TestValidationErrorDetails.test_multiple_nesting~s����q�%�!���6��?���!�8�,�"�Q��F�+� '�$.��#5�$.��?�'��	��
��"�.�.�v�6�	��&�&�x�0��!.�v�!6���B��B��B�������%��)�,�������%���*�-�������%��E�
�"3�4�������%�(9�":�;�������%�(9�":�;�������%��E�
�"3�4�������s�+�������v�.�������z�2�������~�6�������~�6�������z�2���������x��9����������/@�)A�B�������� �"H�	
�	
������� �K�	
�	
������� �K�	
�	
������� �"H�	
�	
������v�.�������v�.�������v�.�������z�2�������z�2�������v�.r1c	�l�dddddgddiddd	d
iid�d�d
�giiddgdd	d
iid�}dddddddiid�id�i}tj|�}|j|�\}|j|jtdg��|j|jtgd���|j|jd�|j\}|j|jtgd���|j|jtgd���|j|jd�|j\}|j|jtgd���|j|jtgd���|j|jd�y)N�nodervr�r��childrenr�r��^.*$r�z#/definitions/node)r�r)r�r�)r�rQrj�root)�definitionsr�rQrjr_�ab)rjr�rvz$.root)r�r�r_)	rjr�rvrrjr�rr�rvz$.root.children.a)r�r�r_r�r�)rjr�rvrrjr�rr�rvrrjr�rr�rvz$.root.children.a.children.ab)	rr�r>r(r}rr�r~r�)r/rrrr�r�r�s       r�test_recursivez)TestValidationErrorDetails.test_recursive�s����� (�%+�Z�$8�!'��%�)1�$*�(.�0D�-&�6"�)�	'�����*���!�F�,@�#A�B�1
��8
��� #� � &��#�%��
�
�
�� �.�.�v�6�	�
�
"�
"�8�
,���������%���/�:����
�"�"�E�*I�$J�	
�	
������h�/��i�i�������)�)�5�1J�+K�L�����#�#�U�
�&�	
�	
������':�;��j�j���������e�;��	
�
	
����#�#�U��&�	
�*	
������'F�Gr1c��ddd�}dddd�i}tj|�}|j|�}t|�\}}|j	|j
t
dg��|j	|j
t
dg��|j	|jd	�|j	|jd
�|j	|jd�|j	|jd�y)
Nr�r�r�r�r�r'�r�r�r�r�r�r�r��	rr�r>r�r(r{rr~r�r/rrrrr�r�s       r�test_additionalPropertiesz4TestValidationErrorDetails.test_additionalProperties s��� ��+��(�9��*K�L���.�.�v�6�	��&�&�x�0���v�&���B�������%���.�1�������%���.�1�������w�/�������w�/�������v�.�������y�1r1c��ddd�}dddiddid�i}tj|�}|j|�}t|�\}}|j	|j
t
d	g��|j	|j
t
d
g��|j	|jd�|j	|jd�|j	|jd�|j	|jd�y)
NrEr�r�rr�r�r�r'r�r�r�r�r�r�s       r�test_patternPropertiesz1TestValidationErrorDetails.test_patternProperties1s����Q�'�����)�!�1�~�"�
���.�.�v�6�	��&�&�x�0���v�&���B�������%���.�1�������%���.�1�������w�/�������w�/�������v�.�������y�1r1c��ddg}gddd�d�}tj|�}|j|�}t|�\}}|j	|j
t
dg��|j	|j
t
dg��|j	|jd�|j	|jd	�|j	|jd
�|j	|jd�y)Nr�rEr�r'r�r�rr��$[1]r�r�r�r�s       r�test_additionalItemsz/TestValidationErrorDetails.test_additionalItemsGs����1�:���(1�a�@�
��
�.�.�v�6�	��&�&�x�0���v�&���B�������%���*�-�������%���*�-�������v�.�������v�.�������v�.�������y�1r1c��gd�}igddd�d�}tj|�}|j|�}t|�\}}|j	|j
t
dg��|j	|j
t
dg��|j	|jd�|j	|jd	�|j	|jd
�|j	|jd�y)N)r�r�rEr�r'r�r�rEr�r�z$[2]r�r�r�r�s       r�test_additionalItems_with_itemsz:TestValidationErrorDetails.test_additionalItems_with_items[s���$���T�(1�a�@�
��
�.�.�v�6�	��&�&�x�0���v�&���B�������%���*�-�������%���*�-�������v�.�������v�.�������v�.�������y�1r1c��ddi}ddddiii}tj|�}|j|�\}|j|jd�|j|j
d�|j|jtg��|j|jd�|j|jtddg��y)Nr�r��
propertyNamesr�r�z0'foo' should not be valid under {'const': 'foo'}rx�
rr�r>r(rrr{rr~rD)r/rrr�errors     r�test_propertyNamesz-TestValidationErrorDetails.test_propertyNamesos����2�;��!�E�G�U�+;�#<�=���.�.�v�6�	��&�&�x�0���������%�0�����M�M�>�	
�	
������U�2�Y�/�������#�.�����*�*�E�?�E�2J�,K�Lr1c��ddiddid�}tj|�}|jd�\}|j|jd�|j|j
d�|j|jtg��|j|jd�|j|jtddg��y)Nr�r��
)�if�then�13 was expectedrxr�r��r/rrr�s    r�test_if_thenz'TestValidationErrorDetails.test_if_then����B�-��b�M�
��
�.�.�v�6�	��&�&�r�*���������'�2�������(9�:�������U�2�Y�/�������#�.�����*�*�E�6�7�2C�,D�Er1c��ddiddid�}tj|�}|jd�\}|j|jd�|j|j
d�|j|jtg��|j|jd�|j|jtddg��y)	Nr�r�r�)r��elser�r�rxr�r�r�s    r�test_if_elsez'TestValidationErrorDetails.test_if_else�r�r1c�2�tjd�}|jd�\}|j|j|j
|j|j|j|j|jfdddddtg�df�y)NFr�zFalse schema does not allow 12rx)rr�r>r(rrrCrrrDr~r)r/rr�s   r�test_boolean_schema_Falsez4TestValidationErrorDetails.test_boolean_schema_False�s����.�.�u�5�	��&�&�r�*�������
�
�����%�%��������!�!����
�1������b�	��
�	
r1c
��ddddii}}tjd|itjdi||i����}|jd	d
i�\}|j	|j
|j|j|j|j|j|j|jfdddd
td	g�dditddg�df�y)
N�someRefr�r�r�r�rp��store��resolverr��notAnIntegerz''notAnInteger' is not of type 'integer'r�)rr��_RefResolverr>r(rrrCrr}rrDr~r)r/�refrrr�s     r�test_refz#TestValidationErrorDetails.test_ref�s����"8�6�9�:M�!N�V���.�.�
�S�M��,�,�R��C��=�I�
�	��&�&��~�'>�?�������
�
�����%�%�����#�#�����!�!����	
�:�����u�g����#��-�v�6�7��	
�	
r1c
��dddiiiddigi}tj|�}|jgd��\}}|j|j|j
|j|j|j|j|j|jfddddtd	g�dditgd
��df�|j|j|j
|j|j|j|j|j|jfdddd
tdg�dditgd��df�y)Nr)r�r�r�rNr&r�rEr)r)rr�r�z"5 is greater than the maximum of 3r')r)rNr��$[3]�
rr�r>r(rrrCrr}rrDr~r)r/rr�
type_error�	min_errors     r�test_prefixItemsz+TestValidationErrorDetails.test_prefixItems�s[���6�8�"4�b�"�y�!�n�!M�N���3�3�F�;�	� )� 5� 5�6F� G��
�I�����"�"��$�$��*�*��#�#��(�(��!�!��&�&��$�$�	
�,�����q�c�
���"��0�1��	
�	
�,	
����!�!��#�#��)�)��"�"��'�'�� � ��%�%��#�#�	
�5�����q�c�
��A���3�4��	
�	
r1c
��ddiigd�}tj|�}|jgd��\}}|j|j|j
|j|j|j|j|j|jfddddtdg�dditddg�d	f�|j|j|j
|j|j|j|j|j|jfd
dddtdg�dditddg�d
f�y)Nr�r�r()r�r�r�r>rDz2 is not of type 'string'r�rEr�r�z4 is not of type 'string'r>rNr�r��r/rrr�r�s     rr*z6TestValidationErrorDetails.test_prefixItems_with_itemssE���h�'��4�
���3�3�F�;�	��&�&�'B�C���B�����
�
�����"�"����� � ��	�	�������	
�,�����q�c�
���"��w��'�(��	
�	
�,	
����
�
�����"�"����� � ��	�	�������	
�,�����q�c�
���"��w��'�(��	
�	
r1c�~�ddidd�}tj|�}|jgd��\}|j|j|j
|j|j|j|j|j|jfdddgd�tg�ddidd�tdg�d	f�y
)z�
        `contains` + `maxContains` produces only one error, even if there are
        many more incorrectly matching elements.
        r�r�r�rE)r�r�r�r>rDr�rFr@rrxNr�r�s    rrGz1TestValidationErrorDetails.test_contains_too_many:s���
 &�x�0��C���3�3�F�;�	��&�&�'J�K�������
�
�����%�%�����#�#�����!�!����	
�M���3��b�	�$�h�/��B��z�l�#��	
�	
r1c�~�ddidd�}tj|�}|jgd��\}|j|j|j
|j|j|j|j|j|jfdddgd�tg�ddidd�tdg�d	f�y)
Nr�r�r�r9)r�r�r>r;r:rrxr�r�s    rr<z0TestValidationErrorDetails.test_contains_too_fewYs���%�x�0��C���3�3�F�;�	��&�&�}�5�������
�
�����%�%�����#�#�����!�!����	
�?�����b�	�$�h�/��B��z�l�#��
�	
r1c��ddidd�}tj|�}|jddg�\}|j|j|j
|j|j|j|j|j|jfddddiddgtg�ddidd�tdg�df�y)	Nr�r�r�r9r>z7[2, 4] does not contain items matching the given schemarrxr�r�s    r�test_contains_nonez-TestValidationErrorDetails.test_contains_nonews���%�x�0��C���3�3�F�;�	��&�&��1�v�.�������
�
�����%�%�����#�#�����!�!����	
�J����"��A���b�	�$�h�/��B��z�l�#��	
�	
r1c��dddgiidddgd�id�}tj|�}|jdii�\}}|j|j|j
|j|j|j|j|j|j|jf	d	ddgitdg�ddgitgd
��tgd
��df	�|j|j|j
|j|j|j|j|j|j|jf	dddgitdg�ddgd�tgd
��tgd
��df	�y)
Nr�rQr��apropz#/$defs/foorD)r�rQ)r�rjz'bar' is a required property)rjr�rQz$.apropz'baz' is a required property)rr�r>r(rrrCrr}rrDrr~rr�s     r�test_ref_siblingz+TestValidationErrorDetails.test_ref_sibling�s����j�5�'�2�3��)�!&����
���3�3�F�;�	��&�&���}�5���B�����
�
�����"�"����� � ��	�	�����'�'����

�/������w�i� ��e�W�%��9�:��9�:��

�	
�0	
����
�
�����"�"����� � ��	�	�����'�'����

�/������w�i� �&�U�G�<��9�:��9�:��

�	
r1N)rWr�rXr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r*rGr<r�r�rr1rrtrt�st��C-�JK%�Z%/�N;/�zcH�J2�"2�,2�(2�(M� 
F�
F�
�2
�>/
�b2
�h
�>
�<
�6<
r1rtc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�MetaSchemaTestsMixinc��|jtj�5|jj	ddi�ddd�y#1swYyxYw)Nrjr��r�rr�r-r�r.s r�test_invalid_propertiesz,MetaSchemaTestsMixin.test_invalid_properties�s9��
�
�
�z�5�5�
6��N�N�'�'��r�(:�;�7�
6�
6���A�Ac��|jtj�5|jj	ddi�ddd�y#1swYyxYw)Nr �1r�r.s r�test_minItems_invalid_stringz1MetaSchemaTestsMixin.test_minItems_invalid_string�s9��
�
�
�z�5�5�
6��N�N�'�'��S�(9�:�7�
6�
6�r�c�:�|jtjtjhvrF|j	t
j�5|jjdgi�ddd�y|jjdgi�y#1swYyxYw)z�
        Technically, all the spec says is they SHOULD have elements, not MUST.

        (As of Draft 6. Previous drafts do say MUST).

        See #529.
        r�N�r-rr�r�r�rr�r�r.s r�test_enum_allows_empty_arraysz2MetaSchemaTestsMixin.test_enum_allows_empty_arrays�s|���>�>��&�&��&�&�
�
��"�"�:�#9�#9�:����+�+�V�R�L�9�;�:�
�N�N�'�'����5�;�:�s�B�Bc�B�|jtjtjhvrH|j	t
j�5|jjdddgi�ddd�y|jjdddgi�y#1swYyxYw)z�
        Technically, all the spec says is they SHOULD be unique, not MUST.

        (As of Draft 6. Previous drafts do say MUST).

        See #529.
        r�r�Nr�r.s r�!test_enum_allows_non_unique_itemsz6MetaSchemaTestsMixin.test_enum_allows_non_unique_items�s����>�>��&�&��&�&�
�
��"�"�:�#9�#9�:����+�+�V�b�"�X�,>�?�;�:�
�N�N�'�'��"�b��(:�;�;�:�s� B�Bc��|jtj�5|jj	ddi�ddd�y#1swYyxYw)Nr4�
*notaregexr�r.s r�test_schema_with_invalid_regexz3MetaSchemaTestsMixin.test_schema_with_invalid_regex�s9��
�
�
�z�5�5�
6��N�N�'�'��L�(A�B�7�
6�
6�r�c�B�|jjddid��y)Nr4r��r)r-r�r.s r�>test_schema_with_invalid_regex_with_disabled_format_validationzSMetaSchemaTestsMixin.test_schema_with_invalid_regex_with_disabled_format_validations$�����#�#�
��%��	$�	
r1N)	rWr�rXr�r�r�r�r�r�rr1rr�r��s!��<�;�
6�"<�"C�
r1r�c�~�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�ValidatorTestMixinc�b�|j|ji�tj�yr3)�assertIsInstancer-rr.s r�)test_it_implements_the_validator_protocolz<ValidatorTestMixin.test_it_implements_the_validator_protocol
s!�����d�n�n�R�0�)�2E�2E�Fr1c��|j\}}|j|j|�j|��yr3)�validr�r-r��r/rrs   r�test_valid_instances_are_validz1ValidatorTestMixin.test_valid_instances_are_valid
s0���:�:����������v�.�7�7��A�Br1c��|j\}}|j|j|�j|��yr3)�invalidr�r-r�r�s   r�$test_invalid_instances_are_not_validz7ValidatorTestMixin.test_invalid_instances_are_not_valids2���<�<�����������/�8�8��B�Cr1c�z�|jt�t�i�jt���y)N)r)r-r�r�r.s r�(test_non_existent_properties_are_ignoredz;ValidatorTestMixin.test_non_existent_properties_are_ignoreds'�������&�(�+�,�5�5�v�x�5�Hr1c�H�ddit�}}|j||��}|jddi|jj��}|jddi|jj|j��}|j||�|j
||�y)Nr�r�r�r�)rr)r�	_resolver)rr-�evolve�FORMAT_CHECKERrr(�assertNotEqual)r/rrrjr��expecteds      r�test_evolvezValidatorTestMixin.test_evolves���"(�)�!4�m�o����>�>��)�"�
���o�o��H�%��>�>�8�8��
��
�>�>�
�X���>�>�8�8��m�m�"�
��	
����h�'����C��*r1c��|jt�5tGd�d|j��}ddd�id��}|j	|j
gd��|j
ddi�	�}|j	|j
gd��|j	|jd�y#1swY��xYw)
ar
        Subclassing validators isn't supported public API, but some users have
        done it, because we don't actually error entirely when it's done :/

        We need to deprecate doing so first to help as many of these users
        ensure they can move to supported APIs, but this test ensures that in
        the interim, we haven't broken those users.
        c�2�eZdZed���Zed��Zy)�:ValidatorTestMixin.test_evolve_with_subclass.<locals>.OhNoc�
�gd�S)Nr�rrr1rruzCValidatorTestMixin.test_evolve_with_subclass.<locals>.OhNo.<lambda>9s��Ir1)�factoryr���defaultN)rWr�rXrr��_barrr1r�OhNor	7s���$5�6���R�(�r1rNr�)r�r�r�r��r)�assertWarns�DeprecationWarningr
r-r(r�rr)r/rrr�s    r�test_evolve_with_subclassz,ValidatorTestMixin.test_evolve_with_subclass,s����
�
�0�
1�
�
)�t�~�~�
)��
)�2����$�	�������	�2����v�y�&9��:��������)�,�������2�&�2�
1�s�B4�4B=c�d�|j|ji�jdd��y)Nr�r�)r�r-r�r.s r�#test_is_type_is_true_for_valid_typez6ValidatorTestMixin.test_is_type_is_true_for_valid_typeCs$��������r�*�2�2�5�(�C�Dr1c�d�|j|ji�jdd��y)Nr�r��r�r-r�r.s r�&test_is_type_is_false_for_invalid_typez9ValidatorTestMixin.test_is_type_is_false_for_invalid_typeFs&���������+�3�3�E�7�C�Dr1c���|j|ji�jdd��|j|ji�jdd��y)NTr�r�rr.s r�,test_is_type_evades_bool_inheriting_from_intz?ValidatorTestMixin.test_is_type_evades_bool_inheriting_from_intIsJ���������+�3�3�D�)�D�E��������+�3�3�D�(�C�Dr1c��dddii}tj|j|jjj	dd����}||�}|jddt
d�t
d�zg�d	igd
dg}|j|j|�D�cgc]}|j��c}|�ycc}w)Nr�r�r�c�^�t|tttf�xrt|t�Sr3)�
isinstance�int�floatr�bool�rrs  rruzGValidatorTestMixin.test_it_can_validate_with_decimals.<locals>.<lambda>Ss,��z��C���0�(�(2�$�U�D�1�1�(2r1�r&rEg�������?r�r�T)
rr�r-r6�redefiner�rr(r>r)r/rr-rr�r�s      r�"test_it_can_validate_with_decimalsz5ValidatorTestMixin.test_it_can_validate_with_decimalsMs����F�H�-�.���%�%��N�N����4�4�=�=��2��
�	��f�%�	����A�s�G�A�J����$;�<�=��"�b�$��-�����)2�)>�)>�w�)G�H�)G��U�^�^�)G�H��	
��Hs�#B?c�`�|jddit���}|jd�y)Nr�carrotr��bugs)r-rr��r/rs  r�7test_it_returns_true_for_formats_it_does_not_know_aboutzJValidatorTestMixin.test_it_returns_true_for_formats_it_does_not_know_aboutbs1���N�N�
�x� ���#�
�	�	���6�"r1c�\�|ji�}|j|j�yr3)r-ryrr(s  r�,test_it_does_not_validate_formats_by_defaultz?ValidatorTestMixin.test_it_does_not_validate_formats_by_defaulths$���N�N�2�&�	����)�2�2�3r1c����t�}td��|jdt����fd��}�jddi|��}|j	d��jtj�5}|j	d�ddd��jjj��y#1swY�0xYw)	NzBad!r�)�raisesc�J��|dk(ry|dk(r���jd|�d��y)N�goodT�badzWhat is z? [Baby Don't Hurt Me])r )rr0r/s ��r�checkzTValidatorTestMixin.test_it_validates_formats_if_a_checker_is_provided.<locals>.checkps/��������%���	��	�	�H�U�G�+A�B�Cr1rr�r/r0)r�
ValueErrorrr-r�r�rrr��	exception�cause)r/rr1r�cmr0s`    @r�2test_it_validates_formats_if_a_checker_is_providedzEValidatorTestMixin.test_it_validates_formats_if_a_checker_is_providedls�����/���� ��	����j��	1�	D�
2�	D��N�N�
�u��g�#�
�	�	���6�"�
�
�
�z�9�9�
:�b����u�%�;�	
�
�
�b�l�l�(�(�#�.�	;�
:�s�=B>�>Cc���t�}d|gi}tj|j|jjj|d����}||�j
d�y)Nr�c�"�t|t�Sr3�rrr!s  rruz@ValidatorTestMixin.test_non_string_custom_type.<locals>.<lambda>�s��z�%��'=r1r"r�)r�rr�r-r6r#r�)r/�non_string_typer�Crazys    r�test_non_string_custom_typez.ValidatorTestMixin.test_non_string_custom_type�s_�� �(���?�+�,���!�!��N�N����4�4�=�=��=��
��	�f�
���r�"r1c�t�tj|j|jjj	dd����}|jtj�5}|ddi�jd�ddd�|jdtj��y#1swY�/xYw)	zh
        A tuple instance properly formats validation errors for uniqueItems.

        See #224
        r�c�"�t|t�Sr3)r�tupler!s  rruzNValidatorTestMixin.test_it_properly_formats_tuples_in_errors.<locals>.<lambda>�s��z�%��'?r1r"�uniqueItemsT)rErENz(1, 1) has non-unique elements)rr�r-r6r#r�rrr�rz�strr3)r/�TupleValidatorr�s   r�)test_it_properly_formats_tuples_in_errorsz<ValidatorTestMixin.test_it_properly_formats_tuples_in_errors�s���$�*�*��N�N����4�4�=�=��?��
���
�
�z�9�9�
:�a��M�4�0�1�:�:�6�B�;��
�
�6��A�K�K�8H�I�;�
:�s�&B.�.B7c���ddd�}tdd��tj|j|jjjd��fd�d���	�}||�}t
gd
��t
dgdgg�t
dg�t
dg�gt
dg�gt
dg�ggt
dg�ggggt
dg�gggggt
t
dg�g�t
t
dg�g�g�d
d��d
d�g�d
t
dg�g��d
t
dg�g�g�d
�d
t
dg��g��d
�d
t
dg��g�gt
t
t
dg���t
t
t
dg���gg
}|D]}|j|��t
gd��t
dgdgg�t
dg�t
dg�gt
dg�gt
dg�ggt
dg�ggggt
dg�gggggt
t
dg�g�t
t
dg�g�g�d
d��d
d�g�d
t
dg�g��d
t
dg�g�g�d
�d
t
dg��g��d
�d
t
dg��g�gt
t
t
dg���t
t
t
dg���gg
}|D];}|jtj�5|j|�ddd��=y#1swY�HxYw)zO
        Allow array to validate against another defined sequence type
        r�T)r�r@�	MyMappingza, bc�.�t|ttf�Sr3)rr=rr!s  rruzBValidatorTestMixin.test_check_redefined_sequence.<locals>.<lambda>�s��J���e�}�5r1c�(��t|t�f�Sr3)rr*)rrrEs  �rruzBValidatorTestMixin.test_check_redefined_sequence.<locals>.<lambda>�s���Z���i�0�6r1)r�r�r")r_Nr�rpTFrr_)r_rZr_N)rrr�r-r6�
redefine_manyrr�r�rr)r/rr-r�valid_instancesr�invalid_instancesrEs       @r�test_check_redefined_sequencez0ValidatorTestMixin.test_check_redefined_sequence�sD���"�$�7���{�F�3�	��%�%��N�N����4�4�B�B���	�	�
�	��f�%�	�
�,�-��E�7�Q�C�.�!�
�E�7�^�U�A�3�Z�(��U�G�n�
��q�c�
�|�,���w�� �!�"�
#���s���~�&6�%7�8�
�E�5�'�N�#�
$�e�U�A�3�Z�L�&9�:�
�s�A�
�	�#�u� 5�6��#��q�c�
�|�,��#��u�g��/�0�
�
�#�	�#�u�a�S�z� :�;�<��#�	�#�u�e�W�~� >�?�@�
��5���w��(�
)�5��u�a�S�z�1B�+C�D�!
��&(�H����x�(�(�
�/�"��E�7�U�G�$�%�
�E�7�^�U�E�7�^�,��U�G�n�
��u�g��/�0���w�� �!�"�
#���w��(8�'9�&:�%;�<�
�E�5�'�N�#�
$�e�U�E�7�^�,<�&=�>�
�s�E�
"�I�c�5�$9�:��#��u�g��/�0��#��u�g��/�0�
�
�#�	�#�u�e�W�~� >�?�@��#�	�#�u�e�W�~� >�?�@�
��5���w��(�
)�5��u�e�W�~�1F�+G�H�!
��&*�H��"�"�:�#=�#=�>��"�"�8�,�?�>�*�>�>�s�L;�;M	c���|jt�5|ji�j}ddd�|j	t
j�y#1swY�*xYwr3)rrr-r�r�rr�)r/r�s  r�.test_it_creates_a_ref_resolver_if_not_providedzAValidatorTestMixin.test_it_creates_a_ref_resolver_if_not_provided�sI��
�
�
�0�
1��~�~�b�)�2�2�H�2����h�
�(?�(?�@�2�
1�s�A�A$c��dddi}}tjdi||i��}|jd|i|��}|jtj
�5|j
d�ddd�y#1swYyxYw)N�someCoolRefr�r�rpr�r�r�)rr�r-r�rrr��r/r�rr�rs     r�/test_it_upconverts_from_deprecated_RefResolverszBValidatorTestMixin.test_it_upconverts_from_deprecated_RefResolvers�sl��#�f�i�%8�V���*�*�2�r�#�v��G���N�N�F�C�=�8�N�D�	�
�
�
�z�9�9�
:����t�$�;�
:�
:�s�A0�0A9c����G�fd�d�}|�}ddi}�jtj�5�j||��j	d�ddd�y#1swYyxYw)zb
        Legacy RefResolvers support only the context manager form of
        resolution.
        c�"��eZdZe�fd��Zy)�nValidatorTestMixin.test_it_upconverts_from_yet_older_deprecated_legacy_RefResolvers.<locals>.LegacyRefResolverc3�>�K��j|d�ddi��y�w)N�the refr�r��r()�thisr�r/s  �r�	resolvingzxValidatorTestMixin.test_it_upconverts_from_yet_older_deprecated_legacy_RefResolvers.<locals>.LegacyRefResolver.resolving�s"������ � ��i�0��y�)�)�s�N)rWr�rXrrYr.s�r�LegacyRefResolverrT�s���
�
*��
*r1rZr�rVr�N)r�rrr-r�)r/rZr�rs`   r�@test_it_upconverts_from_yet_older_deprecated_legacy_RefResolverszSValidatorTestMixin.test_it_upconverts_from_yet_older_deprecated_legacy_RefResolvers�s\���	*�	*�%�&���)�$��
�
�
�z�9�9�
:��N�N�6�H�N�5�>�>�t�D�;�
:�
:�s�#A$�$A-N)rWr�rXr�r�r�r�rrrrrr$r)r+r6r<rCrKrMrQr[rr1rr�r�	sm��G�C�D�I�+�('�.E�E�E�
�*#�4�/�0
#�J�"@-�DA�
%�Er1r�c�(�eZdZdZd�Zd�Zd�Zd�Zy)�AntiDraft6LeakMixinzN
    Make sure functionality from draft 6 doesn't leak backwards in time.
    c���|jtj�5}|jj	d�ddd�|jdt
j��y#1swY�/xYw)NTzTrue is not of type�r�rr�r-r�rzrAr3�r/r�s  r�test_True_is_not_a_schemaz-AntiDraft6LeakMixin.test_True_is_not_a_schemasP��
�
�
�z�5�5�
6�!��N�N�'�'��-�7��
�
�+�S����-=�>�7�
6���A*�*A3c���|jtj�5}|jj	d�ddd�|jdt
j��y#1swY�/xYw)NFzFalse is not of typer_r`s  r�test_False_is_not_a_schemaz.AntiDraft6LeakMixin.test_False_is_not_a_schema
sP��
�
�
�z�5�5�
6�!��N�N�'�'��.�7��
�
�,�c�!�+�+�.>�?�7�
6�rbc���|jt�5}|jd�jd�ddd�|j	j
tj�y#1swY�4xYw)NTr��r��	Exceptionr-r��assertNotIsInstancer3rrr`s  r�5test_True_is_not_a_schema_even_if_you_forget_to_checkzIAntiDraft6LeakMixin.test_True_is_not_a_schema_even_if_you_forget_to_checksQ��
�
�
�y�
)�Q��N�N�4� �)�)�"�-�*�� � ����j�.H�.H�I�*�
)���!A*�*A3c���|jt�5}|jd�jd�ddd�|j	j
tj�y#1swY�4xYw)NFr�rfr`s  r�6test_False_is_not_a_schema_even_if_you_forget_to_checkzJAntiDraft6LeakMixin.test_False_is_not_a_schema_even_if_you_forget_to_checksQ��
�
�
�y�
)�Q��N�N�5�!�*�*�2�.�*�� � ����j�.H�.H�I�*�
)�rjN)rWr�rX�__doc__rardrirlrr1rr]r]s���?�
@�
J�
Jr1r]c�\�eZdZUejZiifZded<ddidfZd�Z	d�Z
d�Zd	�Zy
)�TestDraft3Validator�tuple[dict, dict]r�r�r�r�c�\�|jddi�}|jt��y�Nr��any)r-r�r�r(s  r�#test_any_type_is_valid_for_type_anyz7TestDraft3Validator.test_any_type_is_valid_for_type_any"s$���N�N�F�E�?�3�	����6�8�$r1c�P�tj|j|jjj	dd����}|ddi�}|jd�|j
tj�5|jd�ddd�y#1swYyxYw)z(
        Sigh, because why not.
        rsc�"�t|t�Sr3r9r!s  rruzBTestDraft3Validator.test_any_type_is_redefinable.<locals>.<lambda>-s��j���.Dr1r"r�r�r�N)	rr�r-r6r#r�r�rr)r/r;rs   r�test_any_type_is_redefinablez0TestDraft3Validator.test_any_type_is_redefinable&s����!�!��N�N����4�4�=�=��D��
���6�5�/�*�	����2��
�
�
�z�9�9�
:����u�%�;�
:�
:�s�B�B%c�v�|j|jddi�jt���yrr)r�r-r�r�r.s r�!test_is_type_is_true_for_any_typez5TestDraft3Validator.test_is_type_is_true_for_any_type5s(�����������7�@�@���J�Kr1c���|j|ji�jdd��|j|jddi�jd��y)NTr�r�rs)r�r-r�r�r.s r�6test_is_type_does_not_evade_bool_if_it_is_being_testedzJTestDraft3Validator.test_is_type_does_not_evade_bool_if_it_is_being_tested8sH��������r�*�2�2�4��C�D����������7�@�@��F�Gr1N)
rWr�rXrr�r-r��__annotations__r�rtrwryr{rr1rrorosA���*�*�I� "�B�x�E��'��y�!�5�(�G�%�
&�L�Hr1roc�D�eZdZUejZiifZded<ddidfZy)�TestDraft4Validatorrpr�r�r�r�N)	rWr�rXrr�r-r�r|r�rr1rr~r~=�+���*�*�I� "�B�x�E��'��y�!�5�(�Gr1r~c�D�eZdZUejZiifZded<ddidfZy)�TestDraft6Validatorrpr�r�r�r�N)	rWr�rXrrr-r�r|r�rr1rr�r�Crr1r�c�D�eZdZUejZiifZded<ddidfZy)�TestDraft7Validatorrpr�r�r�r�N)	rWr�rXrr�r-r�r|r�rr1rr�r�Irr1r�c�D�eZdZUejZiifZded<ddidfZy)�TestDraft201909Validatorrpr�r�r�r�N)	rWr�rXr�Draft201909Validatorr-r�r|r�rr1rr�r�O�+���/�/�I� "�B�x�E��'��y�!�5�(�Gr1r�c�D�eZdZUejZiifZded<ddidfZy)�TestDraft202012Validatorrpr�r�r�r�N)	rWr�rXrr�r-r�r|r�rr1rr�r�Ur�r1r�c��eZdZdZd�Zy)�TestLatestValidatorzQ
    These really apply to multiple versions but are easiest to test on one.
    c��d}d|i}tjdi|di��}tj||��}|jtj
�5|j
d�ddd�y#1swYyxYw)NrOr�rpFr�r�)rr�r�r�rrr�rPs     r�2test_ref_resolvers_may_have_boolean_schemas_storedzFTestLatestValidator.test_ref_resolvers_may_have_boolean_schemas_stored`sh�����#����*�*�2�r�#�u��F���.�.�v��I�	�
�
�
�z�9�9�
:����t�$�;�
:�
:�s�A2�2A;N)rWr�rXrmr�rr1rr�r�[s���%r1r�c�f�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zy)�TestValidatorForc���ddi}|jtj|�tj�ddi}|jtj|�tj�y)Nr��&http://json-schema.org/draft-03/schema�'http://json-schema.org/draft-03/schema#)r�r�
validator_forr�r9s  r�test_draft_3zTestValidatorFor.test_draft_3k�`���E�F���
�
��$�$�V�,��&�&�	
�
�F�G���
�
��$�$�V�,��&�&�	
r1c���ddi}|jtj|�tj�ddi}|jtj|�tj�y)Nr��&http://json-schema.org/draft-04/schema�'http://json-schema.org/draft-04/schema#)r�rr�r�r9s  r�test_draft_4zTestValidatorFor.test_draft_4xr�r1c���ddi}|jtj|�tj�ddi}|jtj|�tj�y)Nr��&http://json-schema.org/draft-06/schema�'http://json-schema.org/draft-06/schema#)r�rr�rr9s  r�test_draft_6zTestValidatorFor.test_draft_6�r�r1c���ddi}|jtj|�tj�ddi}|jtj|�tj�y)Nr��&http://json-schema.org/draft-07/schema�'http://json-schema.org/draft-07/schema#)r�rr�r�r9s  r�test_draft_7zTestValidatorFor.test_draft_7�r�r1c���ddi}|jtj|�tj�ddi}|jtj|�tj�y)Nr�z,https://json-schema.org/draft/2019-09/schemaz-https://json-schema.org/draft/2019-09/schema#)r�rr�r�r9s  r�test_draft_201909z"TestValidatorFor.test_draft_201909��`���K�L���
�
��$�$�V�,��+�+�	
�
�L�M���
�
��$�$�V�,��+�+�	
r1c���ddi}|jtj|�tj�ddi}|jtj|�tj�y)Nr��,https://json-schema.org/draft/2020-12/schema�-https://json-schema.org/draft/2020-12/schema#)r�rr�r�r9s  r�test_draft_202012z"TestValidatorFor.test_draft_202012�r�r1c�j�|jtjd�tj�y)NT�r�rr�r�r.s r�	test_TruezTestValidatorFor.test_True�s%���
�
��$�$�T�*��&�&�	
r1c�j�|jtjd�tj�yr
r�r.s r�
test_FalsezTestValidatorFor.test_False�s%���
�
��$�$�U�+��&�&�	
r1c��tjddidd���}ddi}|jtj|�|�y)Nrirm�12c�&�|jdd�Srorqrss rruz8TestValidatorFor.test_custom_validator.<locals>.<lambda>�rvr1rwr��rr,r�r��r/r-rs   r�test_custom_validatorz&TestValidatorFor.test_custom_validator�sK���%�%��/�0��+�
�	�
�-�.���
�
��$�$�V�,��	
r1c��tjddid��}ddi}|jtj|�|�y)Nr$r��13rSr�r�r�s   r�test_custom_validator_draft6z-TestValidatorFor.test_custom_validator_draft6�sH���%�%�� 1�2��
�	��.�/���
�
��$�$�V�,��	
r1c�j�|jtji�tj�yr3r�r.s r�%test_validator_for_jsonschema_defaultz6TestValidatorFor.test_validator_for_jsonschema_default�s!���
�
�j�.�.�r�2�J�4N�4N�Or1c�R�|jtjid��d�y)Nr)r�rr�r.s r�!test_validator_for_custom_defaultz2TestValidatorFor.test_validator_for_custom_default�s���
�
�j�.�.�r�4�@�$�Gr1c��|jt�5}tjddi��ddd�|j	j
t�|j	t|j�d�y#1swY�OxYw)Nr��
unknownSchemarz�The metaschema specified by $schema was not found. Using the latest draft to validate, but this will raise an error in the future.)	rrrr�r(�filename�__file__rA�warning)r/r5s  r�1test_warns_if_meta_schema_specified_was_not_foundzBTestValidatorFor.test_warns_if_meta_schema_specified_was_not_found�sh��
�
�
�0�
1�R��$�$�Y��,H�I�2�	
������h�/������
�
�O�
&�	
�	2�
1�s�A=�=Bc���tjd��5}tjd�tjii��ddd�|j�y#1swY�xYw)NT��record�always)rr
)�warnings�catch_warnings�simplefilterrr�r�)r/�ws  r�0test_does_not_warn_if_meta_schema_is_unspecifiedzATestValidatorFor.test_does_not_warn_if_meta_schema_is_unspecified�sN��
�
$�
$�D�
1�Q��!�!�(�+��$�$�B��;�2�	
�����2�
1�s�-A�A'c�l�ddit�}}|jtj||�|�y)Nr�zmailto:foo@example.com)r�r�rr�)r/rr
s   r�-test_validator_for_custom_default_with_schemaz>TestValidatorFor.test_validator_for_custom_default_with_schema�s.��$�&>�?������
�
�j�.�.�v�w�?��Ir1N)rWr�rXr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr1rr�r�jsP��
�
�
�
�
�
�
�
�

�	
�P�H�

��Jr1r�c�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�TestValidatec���g}tjj|d|j�5t	j
i|�ddd�|j
||g�y#1swY�xYw)Nr�)r�patchr��appendrr�r()r/rr-�results    r�
assertUseszTestValidate.assertUses�sS����
�Z�Z�
�
�y�.�&�-�-�
H�����F�+�I�����&��*�I�
H�s�A!�!A*c��|jdditj��|jdditj��y)Nr�r��rr-r�)r�rr�r.s r�test_draft3_validator_is_chosenz,TestValidate.test_draft3_validator_is_chosen�J������H�I� �0�0�	�	
�
	
����G�H� �0�0�	�	
r1c��|jdditj��|jdditj��y)Nr�r�r�r�)r�rr�r.s r�test_draft4_validator_is_chosenz,TestValidate.test_draft4_validator_is_chosenr�r1c��|jdditj��|jdditj��y)Nr�r�r�r�)r�rrr.s r�test_draft6_validator_is_chosenz,TestValidate.test_draft6_validator_is_chosenr�r1c��|jdditj��|jdditj��y)Nr�r�r�r�)r�rr�r.s r�test_draft7_validator_is_chosenz,TestValidate.test_draft7_validator_is_chosen!r�r1c��|jdditj��|jdditj��y)Nr�r�r�r��r�rr�r.s r�$test_draft202012_validator_is_chosenz1TestValidate.test_draft202012_validator_is_chosen,sR������J��!�5�5�		�	
�	
����I��!�5�5�		�	
r1c�F�|jitj��y)Nr�r�r.s r�)test_draft202012_validator_is_the_defaultz6TestValidate.test_draft202012_validator_is_the_default;s�����r�Z�-L�-L��Mr1c���|jtj�5}tjdddi�ddd�|jt
j�d�y#1swY�/xYw)Nr�r�r�z1(?s)Failed validating '.*' in schema.*On instance)r�rrrr��assertRegexrAr3r`s  r�test_validation_error_messagez*TestValidate.test_validation_error_message>sX��
�
�
�z�9�9�
:�a�����V�X�$6�7�;���������?�	
�;�
:���A'�'A0c���|jtj�5}tjdddi�ddd�|jt
j�d�y#1swY�/xYw)Nr�r�z3(?s)Failed validating '.*' in metaschema.*On schema)r�rr�rr�r�rAr3r`s  r�test_schema_error_messagez&TestValidate.test_schema_error_messageFsW��
�
�
�z�5�5�
6�!�����V�R�L�1�7���������A�	
�7�
6�r�c��dddd�ddigi}|jtj�5}tjd|�ddd�|jdt
j��y#1swY�/xYw)	Nr_r�rwr�r�r�r�z!12 is less than the minimum of 20)r�rrrr�rzrAr3)r/rr�s   r�test_it_uses_best_matchz$TestValidate.test_it_uses_best_matchNso���!�b�1���!��
���
�
�z�9�9�
:�a�����F�+�;��
�
�9�3�q�{�{�;K�L�;�
:�s�A0�0A9N)
rWr�rXr�r�r�r�r�r�r�r�r�r�rr1rr�r��s6��+�	
�	
�	
�	
�

�N�
�
�	Mr1r�c��eZdZdZd�Zy)�
TestThreadinga�
    Threading-related functionality tests.

    jsonschema doesn't promise thread safety, and its validation behavior
    across multiple threads may change at any time, but that means it isn't
    safe to share *validators* across threads, not that anytime one has
    multiple threads that jsonschema won't work (it certainly is intended to).

    These tests ensure that this minimal level of functionality continues to
    work.
    c����g��fd�}|�ddlm}||��}|j�|j�|j	|j��fdgf�y)Nc���	tjdd��y#�jtj��YyxYw)Nr�Tr�)rr�r��sys�exc_info)�faileds�rr�zFTestThreading.test_validation_across_a_second_thread.<locals>.validatejs1���
.��#�#�R��=��
.��
�
�c�l�l�n�-�s	��%Ar)�Thread)�targetF)�	threadingr��start�joinr(�is_alive)r/r�r��threadr�s    @r�&test_validation_across_a_second_threadz4TestThreading.test_validation_across_a_second_threadgsS�����	.�	�
�$��x�(���������
����&�/�/�+�V�4�u�b�k�Br1N)rWr�rXrmr�rr1rr�r�Zs
��
�Cr1r�c��eZdZd�Zd�Zy)�TestReferencingc���d�}tj|��}ddi}tj||��}|j	|jd�|jd�fd�y)	Nc�0�tjddi�S)Nr�r�)r�create_resource)�uris r�retrievez=TestReferencing.test_registry_with_retrieve.<locals>.retrieve{s���.�.��	�/B�C�Cr1)r�r��https://example.com/��registryr�r�)TF)�referencing�Registryrr�r(r�)r/r�rrrs     r�test_registry_with_retrievez+TestReferencing.test_registry_with_retrievezsf��	D��'�'��:���0�1���3�3�F�X�N�	����
�
�
��
#�Y�%7�%7��%>�?��	
r1c��tj�}ddi}tj||��}t	j
d��5}t	jd�|jtjj�5|jd�ddd�ddd�|j�y#1swY�#xYw#1swY�'xYw)Nr�rrTr�r�r�)rrrr�r�r�r�r�r�Unresolvabler�r�)r/rrrr�s     r�;test_custom_registries_do_not_autoretrieve_remote_resourceszKTestReferencing.test_custom_registries_do_not_autoretrieve_remote_resources�s����'�'�)���0�1���3�3�F�X�N�	�
�
$�
$�D�
1�Q��!�!�(�+��"�"�;�#9�#9�#F�#F�G��"�"�2�&�H�2�	
�����H�G��2�
1�s$�?C�B9�C�9C	�>C�CN)rWr�rXrrrr1rr�r�ys��
�	r1r�c��eZdZdZdZddiZd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�TestRefResolverrpzfoo://stored�storedrc��i|_|j|ji|_t	j
|j|j|j�|_yr3)�referrer�
stored_uri�
stored_schemar�rr��base_urir�r.s rr0zTestRefResolver.setUp�sD����
��o�o�t�'9�'9�:��
�"�/�/��M�M�4�=�=�$�*�*�
��
r1c��tjjd}tjj|jd�5}|jj|�5}	ddd�ddd�|jtjj�|jj�y#1swY�WxYw#1swY�[xYw)Nri�resolve_remote)rr�r5rr�r�r�rYr(r��called)r/r��patched�resolveds    r�6test_it_does_not_retrieve_schema_urls_from_the_networkzFTestRefResolver.test_it_does_not_retrieve_schema_urls_from_the_network�s����(�(�4�4�T�:��
�Z�Z�
�
�t�}�}�.>�
?�7����(�(��-���.�@�	
����:�#=�#=�#I�#I�J�������(�.�-��@�
?�s$�C�$B<�&C�<C	�C�Cc���d}dt�i|jd<|jj|�5}|j	||jdd�ddd�y#1swYyxYw)Nz#/properties/foor�rj)r�r
r�rYr()r/r�rs   r�test_it_resolves_local_refsz+TestRefResolver.test_it_resolves_local_refs�sZ�� ��',�f�h�&7��
�
�l�#�
�]�]�
$�
$�S�
)�X����X�t�}�}�\�'B�5�'I�J�*�
)�
)�s�#A#�#A,c�B�dddid�}tjj|d���}|jd�5}|j	||d�ddd�|jd	�5}|j	||d�ddd�y#1swY�9xYw#1swYyxYw)
Nzhttp://bar/schema#r�r�)rir_c�&�|jdd�Srorqrs rruzETestRefResolver.test_it_resolves_local_refs_with_id.<locals>.<lambda>�������D�"�!5r1�rxz#/ar_zhttp://bar/schema#/a)rr��from_schemarYr(�r/rr�rs    r�#test_it_resolves_local_refs_with_idz3TestRefResolver.test_it_resolves_local_refs_with_id�s���,�E�5�>�B���*�*�6�6��5�7�
���
�
��
&�(����X�v�c�{�3�'�
�
�
� 6�
7�8����X�v�c�{�3�8�
7�'�
&��
7�
7�s�B	�*B�	B�Bc�j�|jj|j�5}|j||j�ddd�ddi|jj
d<|jjd�5}|j
|d�ddd�y#1swY�[xYw#1swYyxYw)Nr�r��
cached_refzcached_ref#/foo)r�rYrr�rr�r()r/rs  r�test_it_retrieves_stored_refsz-TestRefResolver.test_it_retrieves_stored_refs�s���
�]�]�
$�
$�T�_�_�
5���M�M�(�D�$6�$6�7�6�.3�B�K��
�
���L�)�
�]�]�
$�
$�%6�
7�8����X�r�*�8�
7�	6�
5��8�
7�s�B�B)�B&�)B2c�l�d}ddi}dtjvr<|jtjjdtjd�t	d|i�tjd<|j
j
|�5}|j|d�ddd�y#1swYyxYw)N�http://bar#bazrDr��requests�
http://bar)r��modulesr'�__setitem__�ReallyFakeRequestsr�rYr()r/r�rrs    r�,test_it_retrieves_unstored_refs_via_requestsz<TestRefResolver.test_it_retrieves_unstored_refs_via_requests�s�������������$��O�O����'�'��S�[�[��5L�
�#5�l�F�5K�"L����J��
�]�]�
$�
$�S�
)�X����X�r�*�*�
)�
)�s�B*�*B3c�����d}ddi�dtjvr<�jtjjdtjd�dtjd<t��fd��}�jt
tdtj�|t_�jj|�5}	ddd��jd�y#1swY�xYw)Nr$rDr�r%c3��K��j|d�ttj��j	d����y�w)Nr&�utf8)r(r�json�dumps�encode)�urlrr/s ��r�fake_urlopenzQTestRefResolver.test_it_retrieves_unstored_refs_via_urlopen.<locals>.fake_urlopen�s6��������S�,�/��$�*�*�V�,�3�3�F�;�<�<�s�AA�urlopen)r�r'r'r(r�setattrrr3r�rYr()r/r�r2rrs`   @r�+test_it_retrieves_unstored_refs_via_urlopenz;TestRefResolver.test_it_retrieves_unstored_refs_via_urlopen�s��������������$��O�O����'�'��S�[�[��5L�
�#'����J��	�	=�
�	=�	
�����Y�
�8J�8J�K�)�
��
�]�]�
$�
$�S�
)�X��*�����2�&�*�
)�s�	C&�&C/c��tjdd��5}|jtj|j
�t
jddi|�ddd�dtj
��d�}|jj|�5}|j|d�ddd�y#1swY�YxYw#1swYyxYw)NF�wt)�delete�moder�r�zfile://z#foo)�tempfile�NamedTemporaryFiler'�os�remover�r.�dumprr�rYr()r/�tempfr�rs    r�(test_it_retrieves_local_refs_via_urlopenz8TestRefResolver.test_it_retrieves_local_refs_via_urlopen�s���
�
(�
(��D�
A�U��O�O�B�I�I�u�z�z�2��I�I�u�e�n�e�,�B���U�Z�Z�0�1��6��
�]�]�
$�
$�S�
)�X����X�u�-�*�
)�B�
A��
*�
)�s�AB3�B?�3B<�?Cc��ddi}tjj|d���}|j|jd�|j|j
d�|j
d�5}|j||�ddd�|j
d�5}|j||�ddd�|j
d�5}|j||�ddd�|j
d�5}|j||�ddd�y#1swY��xYw#1swY�nxYw#1swY�NxYw#1swYyxYw)Nrir�c�&�|jdd�Srorqrs rruzPTestRefResolver.test_it_can_construct_a_base_uri_from_a_schema.<locals>.<lambda>�rr1rrp�#zfoo#�rr�rr(r�resolution_scoperYrs    r�.test_it_can_construct_a_base_uri_from_a_schemaz>TestRefResolver.test_it_can_construct_a_base_uri_from_a_schema�s�������*�*�6�6��5�7�
��	
����*�*�E�2�����2�2�E�:�
�
�
��
#�x����X�v�.�$�
�
�
��
$�����X�v�.�%�
�
�
��
&�(����X�v�.�'�
�
�
��
'�8����X�v�.�(�
'�
$�
#��
$�
$��
&�
&��
'�
'�s0�0D�D�D(�4D4�D�D%�(D1�4D=c��i}tjj|�}|j|jd�|j|j
d�|j
d�5}|j||�ddd�|j
d�5}|j||�ddd�y#1swY�6xYw#1swYyxYw)NrprCrDrs    r�9test_it_can_construct_a_base_uri_from_a_schema_without_idzITestRefResolver.test_it_can_construct_a_base_uri_from_a_schema_without_id�s������*�*�6�6�v�>������*�*�B�/�����2�2�B�7�
�
�
��
#�x����X�v�.�$�
�
�
��
$�����X�v�.�%�
$�$�
#��
$�
$�s�+B3�B?�3B<�?Cc���������fd�}ddi�d�tjdid|i��}|j��5}�j|��ddd�y#1swYyxYw)Nc�,���j|���Sr3rW)r1r�rr/s ���r�handlerz@TestRefResolver.test_custom_uri_scheme_handlers.<locals>.handler		s������S�#�&��Mr1r�r��	foo://barrp��handlers)rr�rYr()r/rKr�rr�rs`   @@r�test_custom_uri_scheme_handlersz/TestRefResolver.test_custom_uri_scheme_handlers	s]���	��������*�*�2�r�U�G�<L�M��
�
�
��
$�����X�v�.�%�
$�
$�s�A�A!c����t�g���fd�}d}tjdidd|i��}|j|�5	ddd�|j|�5	ddd�y#1swY�%xYw#1swYyxYw)Nc�f��	�j�S#t$r�jd�YywxYw)Nz#Response must not have been cached!�rV�
IndexErrorr �r1�responser/s ��rrKz5TestRefResolver.test_cache_remote_on.<locals>.handler	s3���
A��|�|�~�%���
A��	�	�?�@�
A����0�0rLrpTr���cache_remoterN�r�rr�rY�r/rKr�r�rUs`   @r�test_cache_remote_onz$TestRefResolver.test_cache_remote_on	sx����H�:��	A����*�*������0@�
���
�
��
$��%�
�
�
��
$��%�
$�%�
$��
$�
$�s�A(�A4�(A1�4A=c����t�g���fd�}d}tjdidd|i��}|j|�5	ddd�y#1swYyxYw)Nc�f��	�j�S#t$r�jd�YywxYw)NzHandler called twice!rRrTs ��rrKz6TestRefResolver.test_cache_remote_off.<locals>.handler(	s0���
3��|�|�~�%���
3��	�	�1�2�
3�rVrLrpFr�rWrYrZs`   @r�test_cache_remote_offz%TestRefResolver.test_cache_remote_off%	sU����H�:��	3����*�*����%��1A�
���
�
��
$��%�
$�
$�s�A
�
Ac���td���fd�}d}tjdid|i��}|jtj
�5}|j
|�5|jd�ddd�ddd�|jjt	j
���y#1swY�AxYw#1swY�ExYw)NzOh no! What's this?c�����r3r)r1r�s �rrKzTTestRefResolver.test_if_you_give_it_junk_you_get_a_resolution_error.<locals>.handler8	s����Kr1rLrpr�rMzShouldn't get this far!)
r2rr�r�r�_RefResolutionErrorrYr r(r3)r/rKr�r��errr�s     @r�3test_if_you_give_it_junk_you_get_a_resolution_errorzCTestRefResolver.test_if_you_give_it_junk_you_get_a_resolution_error5	s�����0�1��	����*�*�2�r�U�G�<L�M��
�
�
�z�=�=�
>�#��#�#�C�(��	�	�3�4�)�?�	
������
�(F�(F�u�(M�N�)�(��?�
>�s$�
B=�B1�1B=�1B:	�6B=�=Cc�"�tjdi�}|j�|jtj
�5}|j�ddd�|j
dtj��y#1swY�/xYw)NrpzFailed to pop the scope)	rr��	pop_scoper�rrarzrAr3)r/r��excs   r�.test_helpful_error_message_on_failed_pop_scopez>TestRefResolver.test_helpful_error_message_on_failed_pop_scopeB	sh���*�*�2�r�2������
�
�
�z�=�=�
>�#���� �?��
�
�/��S�]�]�1C�D�?�
>�s�B�Bc��tjj}tjd|�}tj||��}|j	|jddi��ddtjjdigi}tjd|�}tj||��}|j	|jddi��y)	z
        See #1085.
        rpr�r0r��allOfr�r$N)rr�r5r�r�r�)r/r�oner�another�twos      r�,test_pointer_within_schema_with_different_idz<TestRefResolver.test_pointer_within_schema_with_different_idI	s����+�+�7�7���%�%�b�&�1���.�.�v��D�	�����+�+�[�%�,@�A�B�
�v�z�9�9�E�E�e�L�M�N�
���%�%�b�'�2���.�.�w��E�	�����+�+�[�%�,@�A�Br1c�$���fd�}tjdid|i��}tjitjj��}ddd�}|||�	�}�j|j
i�|j
d
�fd�y)
zj
        See https://github.com/python-jsonschema/jsonschema/issues/1061#issuecomment-1624266555.
        c�0���j|d�ddiS)Nzhttp://example.com/foor�r�rW)r�r/s �r�handlezNTestRefResolver.test_newly_created_validator_with_ref_resolver.<locals>.handle^	s������S�":�;��I�&�&r1rp�httprMr�zhttp://example.com/barr�)r$r�r�r��FTN)rr�r,r�r4r(r�)r/rpr�r-rrs`     r�.test_newly_created_validator_with_ref_resolverz>TestRefResolver.test_newly_created_validator_with_ref_resolverY	s����
	'��*�*�2�r�V�V�<L�M���%�%��!�1�1�<�<�
�	�2�5�A���f�x�8�	����
�
�
��
#�Y�%7�%7��%;�<��	
r1c���dddiidddiid�}tj|tjd|���}|j|j	dd	i�|j	dd
i�fd�y)
zj
        See https://github.com/python-jsonschema/jsonschema/issues/1124#issuecomment-1632574249.
        �xr�z#/definitions/xr�r�)rjr�rpr��yr�rrN)rr�r�r(r�)r/rrs   r�2test_refresolver_with_pointer_in_schema_with_no_idzBTestRefResolver.test_refresolver_with_pointer_in_schema_with_no_idn	s�����):� ;�<��&�)�!4�5�
��
�3�3���,�,�R��8�
�	�	
���
�
�
��c�
�
+�Y�-?�-?��b�	�-J�K��	
r1N)rWr�rXrrrr0rrrr"r*r5r@rFrHrOr[r^rcrgrmrsrwrr1rr
r
�st���H��J��x�(�M�
�)�K�	4�+�+�'�,.�/�"/�	/��$� O�E�C� 
�*
r1r
c�"�d�}t||��S)Nc��|jD�cgc]
}t|���c}|jD�cgc]
}t|���c}fScc}wcc}wr3)r{rArD)r�r�s  r�keyzsorted_errors.<locals>.key�	sJ��"�Z�Z�(�Z��S��V�Z�(�"�.�.�/�.��S��V�.�/�
�	
��(��/s
�A�A)rz)�sorted)rrzs  rr�r��	s��
�
�&�c�"�"r1c��eZdZUded<d�Zy)r)zdict[str, Any]�
_responsesc��|jj|�}|�tdt|�z��t	tj|��S)Nz
Unknown URL: )r}rrr2r\�_ReallyFakeJSONResponser.r/)r/r1rUs   rrrzReallyFakeRequests.get�	sC���?�?�&�&�s�+���;��_�t�C�y�8�9�9�&�t�z�z�(�';�<�<r1N)rWr�rXr|rrrr1rr)r)�	s����=r1r)c��eZdZUded<d�Zy)rrA�	_responsec�@�tj|j�Sr3)r.�loadsr�r.s rr.z_ReallyFakeJSONResponse.json�	s���z�z�$�.�.�)�)r1N)rWr�rXr|r.rr1rrr�	s���N�*r1r):�
__future__r�collectionsrr�
contextlibr�decimalr�ior�typingr	�unittestr
r�urllib.requestrr.r<r�r:r��attrsr
r�referencing.jsonschemar�referencing.exceptionsr�
jsonschemarrrrrr r"r�rtr�r�r]ror~r�r�r�r�r�r�r�r�r�r
r�r)rrr1r�<module>r�s���"�)�%����#�'��	�
����.����1�L6�(�L6�^MC�(�MC�`L
��L
�^5
�5
�pwE�-�wE�tJ�J�4H�-�/A�8�H�@)�-�/A�8�)�)�,�h�)�)�,�h�)�)�1�8�)�)�1�8�)�%�(�%�LJ�x�LJ�^^M�8�^M�BC�H�C�>�h��4l
�h�l
�`#��=�=��=��*�*��*r1

Youez - 2016 - github.com/yon3zu
LinuXploit