403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/jsonschema/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/jsonschema/tests/__pycache__/test_exceptions.cpython-314.pyc
+
P4i�L���^RIHt^RIt^RIHt^RIHt!RR]4t!RR]4t!R	R
]4t	!RR]4t
!R
R]4tR#)�)�TestCaseN)�
exceptions)�_LATEST_VERSIONc�a�]tRt^toRtRtRtRtRtRt	Rt
RtR	tR
t
RtRtR
tRtRtRtRtVtR#)�
TestBestMatchc�2�\\V4PV44p\P!\V44p\P!\
V44pVPVP4VP4RVRV24V#)zNo consistent best match!
Got: z

Then: )	�listr�iter_errorsr�
best_match�iter�reversed�assertEqual�	_contents)�self�instance�schema�errors�best�
reversed_bests&&&   �B/usr/lib/python3/dist-packages/jsonschema/tests/test_exceptions.py�
best_match_of�TestBestMatch.best_match_of	s����o�f�-�9�9�(�C�D���$�$�T�&�\�2��"�-�-�h�v�.>�?�
�����N�N���#�#�%�.�t�f�J�}�o�N�	
�
��c��RRR^RRRR/////pVPRR.//VR7pVPVPR4R#)�
properties�foo�
minProperties�bar�type�object�rrN�rr�	validator�rrrs&  r�(test_shallower_errors_are_better_matches�6TestBestMatch.test_shallower_errors_are_better_matchessa����#�Q� �5�6�8�*<�"=���
���!�!�E�E�2�;�+?��!�O���������9rc��R^RRR/RR/.RRR/RR/./pVP/VR7pVPVPR4R#)	zV
A property you *must* match is probably better than one you have to
match a part of.
r�anyOfr�string�number�oneOfr!Nr"r$s&  r�%test_oneOf_and_anyOf_are_weak_matches�3TestBestMatch.test_oneOf_and_anyOf_are_weak_matches sc��
�Q��v�x�(�6�8�*<�=��v�x�(�6�8�*<�=�
��
�!�!�2�f�!�=���������9rc��RRRRR/RRRR///.///pVPRR^//VR7pVPVPR4R	#)
a
If the most relevant error is an anyOf, then we traverse its context
and select the otherwise *least* relevant error, since in this case
that means the most specific, deep, error inside the instance.

I.e. since only one of the schemas must match, we look for the most
relevant one.
rrr(rr)r�arrayr!N�rr�validator_valuer$s&  r�8test_if_the_most_relevant_error_is_anyOf_it_is_traversed�FTestBestMatch.test_if_the_most_relevant_error_is_anyOf_it_is_traversed.�s��
�����*�%����/@�'A�B����	
���!�!�E�E�2�;�+?��!�O������-�-�w�7rc�~�RRR/RR/RR/./pVP.VR7pVPVPR4R#)zz
We don't traverse into an anyOf (as above) if all of its context errors
seem to be equally "wrong" against the instance.
r(rr)�integerr r!Nr"r$s&  r�3test_no_anyOf_traversal_for_equally_relevant_errors�ATestBestMatch.test_no_anyOf_traversal_for_equally_relevant_errorsE�V��
���"���#���"��
���!�!�2�f�!�=���������1rc�r�RRR/./pVP.VR7pVPVPR4R#)zl
We *do* traverse anyOf with a single nested error, even though it is
vacuously equally relevant to itself.
r(rr)r!Nr"r$s&  r�6test_anyOf_traversal_for_single_equally_relevant_error�DTestBestMatch.test_anyOf_traversal_for_single_equally_relevant_errorU�F��
���"��
��
�!�!�2�f�!�=���������0rc��RRRRR/RRRR///.///pVPRR^//VR7pVPVPR4R	#)
a
If the most relevant error is an oneOf, then we traverse its context
and select the otherwise *least* relevant error, since in this case
that means the most specific, deep, error inside the instance.

I.e. since only one of the schemas must match, we look for the most
relevant one.
rrr+rr)rr/r!Nr0r$s&  r�8test_if_the_most_relevant_error_is_oneOf_it_is_traversed�FTestBestMatch.test_if_the_most_relevant_error_is_oneOf_it_is_traversedcr4rc�~�RRR/RR/RR/./pVP.VR7pVPVPR4R#)zz
We don't traverse into an oneOf (as above) if all of its context errors
seem to be equally "wrong" against the instance.
r+rr)r6r r!Nr"r$s&  r�3test_no_oneOf_traversal_for_equally_relevant_errors�ATestBestMatch.test_no_oneOf_traversal_for_equally_relevant_errorszr9rc�r�RRR/./pVP.VR7pVPVPR4R#)zl
We *do* traverse oneOf with a single nested error, even though it is
vacuously equally relevant to itself.
r+rr)r!Nr"r$s&  r�6test_oneOf_traversal_for_single_equally_relevant_error�DTestBestMatch.test_oneOf_traversal_for_single_equally_relevant_error�r=rc��RRRRR/RRRR///.///pVPRR^//VR7pVPVPR4R	#)
z�
Now, if the error is allOf, we traverse but select the *most* relevant
error from the context, because all schemas here must match anyways.
rr�allOfrr)rr/r!Nr0r$s&  r�8test_if_the_most_relevant_error_is_allOf_it_is_traversed�FTestBestMatch.test_if_the_most_relevant_error_is_allOf_it_is_traversed�ss��
�����*�%����/@�'A�B����	
���!�!�E�E�2�;�+?��!�O������-�-�x�8rc
��RRRRR/RRR/RRRR///././//pVPRR^//VR7pVPVPR4R	#)
zX
We traverse into nested contexts (a oneOf containing an error in a
nested oneOf here).
rrr+rr)rr/r!Nr0r$s&  r�test_nested_context_for_oneOf�+TestBestMatch.test_nested_context_for_oneOf�s���
�����*�#�!'�� 2�$0�(-���/@�3&�!"�&�	����
��&�!�!�E�E�2�;�+?��!�O������-�-�w�7rc��RRRRRR^/RRR^
/.///pVPRR/VR	7pVPVPR4RRRRRR^
/RRR^/.///pVPRR/VR	7pVPVPR4R
#)rrr(rr/�minItemsr)�	minLengthrr!Nr"�rrr�	reordereds&   r�"test_it_prioritizes_matching_types�0TestBestMatch.test_it_prioritizes_matching_types�s��������*�a�8���;��;����	
���!�!�E�5�>�&�!�I���������5�
�����;��;���*�a�8����	
�	��!�!�E�5�>�)�!�L���������5rc��RRRRRR.R^/RRR.R	^
/.///pVPRR
/VR7pVPVPR	4RRRRRR	^
/RRR^/.///pVPRR
/VR7pVPVPR	4R#)
rrr(rr/r rOr6r)rPrr!Nr"rQs&   r�(test_it_prioritizes_matching_union_types�6TestBestMatch.test_it_prioritizes_matching_union_types�s�������'�8�!4�j�!�D��)�X�!6��R�H����	
���!�!�E�5�>�&�!�I���������5�
�����;��;���*�a�8����	
�	��!�!�E�5�>�)�!�L���������5rc�r�RRR//pVPRR/VR7pVPVP4R#)rrFrr!N)r�assertIsNoner#r$s&  r�test_boolean_schemas�"TestBestMatch.test_boolean_schemas�s;������/���!�!�E�5�>�&�!�I�����$�.�.�)rc���\R^/4pVP/4wpVP\P!VP/44P
R4R#)rN)rr
rrrr#)rr#�errors&  r�test_one_error�TestBestMatch.test_one_errorsS��#�_�a�$8�9�	��&�&�r�*�������!�!�)�"7�"7��";�<�F�F��	
rc��\/4pVP\P!VP	/444R#)N)rrYrrr
)rr#s& r�test_no_errors�TestBestMatch.test_no_errors
s0��#�B�'�	����*�/�/�	�0E�0E�b�0I�J�Kr�N)�__name__�
__module__�__qualname__�__firstlineno__rr%r,r2r7r;r?rBrErIrLrSrVrZr^ra�__static_attributes__�__classdictcell__��
__classdict__s@rrrs\����	�
:�:�8�.2� 1�8�.2� 1�9�&8�86�66�6*�

�L�Lrrc�8a�]tRtRtoRtRtRtRtRtVt	R#)�TestByRelevanceic� �\P!RR.R7p\P!RRR.R7p\W.\PR7pVP	W14\W!.\PR7pVP	W14R#)�Oh no!�baz��path�Oh yes!rr��keyN)r�ValidationError�max�	relevance�assertIs)r�shallow�deep�matchs&   r�#test_short_paths_are_better_matches�3TestByRelevance.test_short_paths_are_better_matchessl���,�,�X�U�G�D���)�)�)�5�%�.�I���W�O��)=�)=�>���
�
�e�%��T�O��)=�)=�>���
�
�e�%rc���\P!R.R7p\P!RR.R7p\W.\PR7pTP	VUu.uFp\VP4NK	upR...4\W!.\PR7pTP	VUu.uFp\VP4NK	upR...4R#uupiuupi)rorqrsrrtN)rrv�sortedrxrr	rr)rrzr{rr]s&    r�*test_global_errors_are_even_better_matches�:TestByRelevance.test_global_errors_are_even_better_matchess����,�,�X�B�?���)�)�)�5�'�B�����Z�-A�-A�B�����+1�2�6�%�T�%�*�*�
�6�2��W�b�M�	
�
���Z�-A�-A�B�����+1�2�6�%�T�%�*�*�
�6�2��W�b�M�	
��
3��
3s�C�1C!c��\P!R.RR7p\P!R.RR7p\P!RR7p\W.VR7pVP	WB4\W!.VR7pVP	WB4R#)ro�a�rrr#rs�b)�weakrtN�rrv�by_relevancerwry)rr��normalrr|s&    r�%test_weak_keywords_are_lower_priority�5TestByRelevance.test_weak_keywords_are_lower_priority)sn���)�)�(��s�K���+�+�I�B�#�N���,�,�#�6�
��T�N�
�3���
�
�e�$��V�N�
�3���
�
�e�$rc�L�\P!R.RR7p\P!R.RR7p\P!R.RR7p\P!RRR7p\WV.VR7pVP	WS4\W2V.VR7pVP	WS4R	#)
ror�r�rsr�zOh fine!�c)r��strongrtNr�)rr�r�r�rr|s&     r�(test_strong_keywords_are_higher_priority�8TestByRelevance.test_strong_keywords_are_higher_priority5s����)�)�(��s�K���+�+�I�B�#�N���+�+�J�R�3�O���,�,�#�c�B�
��T�6�*�
�;���
�
�e�$��V�T�*�
�;���
�
�e�$rrcN)
rdrerfrgr}r�r�r�rhrirjs@rrmrms����&�
� 
%�%�%rrmc�ha�]tRtRtoRtRtRtRtRtRt	Rt
R	tR
tRt
RtR
tRtVtR#)�
TestErrorTreeiCc���\^4Uu.uFp\P!RVR7NK	pp\P!V4pVP	VP
^4R#uupi)��	Something�r#N)�rangerrv�	ErrorTreer�total_errors)r�ir�trees&   r�/test_it_knows_how_many_total_errors_it_contains�=TestErrorTree.test_it_knows_how_many_total_errors_it_containsDsb���1�X�
���
�&�&�{�a�@��	�
��#�#�F�+������*�*�A�.��
s�!A%c��\P!RR.R7.p\P!V4pVPRV4R#)�	a messagerrqN)rrvr��assertIn�rrr�s&  r�1test_it_contains_an_item_if_the_item_had_an_error�?TestErrorTree.test_it_contains_an_item_if_the_item_had_an_errorMs7���,�,�[��w�G�H���#�#�F�+���
�
�e�T�"rc��\P!RR.R7.p\P!V4pVPRV4R#)r�rrqrN)rrvr��assertNotInr�s&  r�9test_it_does_not_contain_an_item_if_the_item_had_no_error�GTestErrorTree.test_it_does_not_contain_an_item_if_the_item_had_no_errorRs9���,�,�[��w�G�H���#�#�F�+�������%rc��\P!RRR7p\P!V.4pVPVPRV/4R#)r�rr�N�rrvr�rr�rr]r�s&  r�/test_keywords_that_failed_appear_in_errors_dict�=TestErrorTree.test_keywords_that_failed_appear_in_errors_dictWs>���*�*�;�%�H���#�#�U�G�,��������u�e�n�5rc��\P!RR.R7\P!RR^.R7.p\P!V4pVP^VR,4VP	^VR,4R#)z
a bar messagerrqza bar -> 0 messageN)rrvr�r�r�r�s&  r�1test_it_creates_a_child_tree_for_each_nested_path�?TestErrorTree.test_it_creates_a_child_tree_for_each_nested_path\sh���&�&��e�W�E��&�&�';�5�!�*�M�
���#�#�F�+���
�
�a��e��%�����D��K�(rc��\P!RRR^.R7\P!RRR^.R7r!\P!W.4pVPVR,^,PRVRV/4R#)�1rr)r#rr�2�quuxNr��r�e1�e2r�s&   r�+test_children_have_their_errors_dicts_built�9TestErrorTree.test_children_have_their_errors_dicts_builtesn���&�&�s�e�5�!�*�M��&�&�s�f�E�1�:�N�
��#�#�R�H�-������e��Q��.�.���F�B�0G�Hrc��\P!RRRR.RR7\P!RRR^.R	R7r!\P!W.4R
#)r�rr�bar2�i1�r#rrrr�r��foobar�i2N)rrvr�)rr�r�s&  r�"test_multiple_errors_with_instance�0TestErrorTree.test_multiple_errors_with_instancemsW���&�&����V�_��	
�

�&�&�� ���]��	
�

�	���b�X�&rc���\P!RR.R7p\P!V.4pVP\4;_uu_4V^,RRR4R# +'giR#;i)�123r)r#rN)rrvr��assertRaises�
IndexErrorr�s&  r�>test_it_does_not_contain_subtrees_that_are_not_in_the_instance�LTestErrorTree.test_it_does_not_contain_subtrees_that_are_not_in_the_instance|sO���*�*�5�E�B�O���#�#�U�G�,��
�
�
�z�
*�
*���G�+�
*�
*�
*�s�
A"�"A3	c��\P!RR/R.R7p\P!V.4pVPVR,\P4R#)zt
If a keyword refers to a path that isn't in the instance, the
tree still properly returns a subtree for that path.
r�r)r#rrrN)rrvr��assertIsInstancer�s&  r�9test_if_its_in_the_tree_anyhow_it_does_not_raise_an_error�GTestErrorTree.test_if_its_in_the_tree_anyhow_it_does_not_raise_an_error�sM���*�*��5�2�U�G�
���#�#�U�G�,�����d�5�k�:�+?�+?�@rc��\P!RRRR.RR7p\P!V.4pVP\	V4R4R#)r�rrr�r�r�z<ErrorTree (1 total error)>N�rrvr�r�reprr�s&  r�test_repr_single�TestErrorTree.test_repr_single�sK���*�*�������	
���#�#�U�G�,������d��%B�Crc���\P!RRRR.RR7\P!RRR^.R	R7r!\P!W.4pVP\	V4R
4R#)r�rrr�r�r�r�r�r�r�z<ErrorTree (2 total errors)>Nr�r�s&   r�test_repr_multiple� TestErrorTree.test_repr_multiple�sn���&�&����V�_��	
�

�&�&�� ���]��	
�

��#�#�R�H�-������d��%C�Drc�h�\P!.4pVP\V4R4R#)z<ErrorTree (0 total errors)>N)rr�rr�)rr�s& r�test_repr_empty�TestErrorTree.test_repr_empty�s'���#�#�B�'������d��%C�DrrcN)rdrerfrgr�r�r�r�r�r�r�r�r�r�r�r�rhrirjs@rr�r�CsL����/�#�
&�
6�
)�I�
'��
A�D�E� E�Err�c�\a�]tRtRtoRtRtRtRtRtRt	Rt
R	tR
tRt
RtVtR
#)�TestErrorInitReprStri�c�t�\RRR^RR/R7pVPV4\P!R/VB#)�hellorr))�messager#r1rrrc)�dict�updaterrv)r�kwargs�defaultss&, r�
make_error�TestErrorInitReprStr.make_error�sB�����$���H�%�
��	������)�)�5�H�5�5rc��\P!V4PR4pVP!R/VBp\	V4PR4wrEpVP
WCP4VP
Wa4R#)�
Nrc)�textwrap�dedent�rstripr��str�	partitionrr�)r�expectedr�r]�message_line�_�rests&&,    r�assertShows� TestErrorInitReprStr.assertShows�se���?�?�8�,�3�3�D�9�����)�&�)�� #�E�
� 4� 4�T� :��������}�}�5�����(rc�p�VP4pVP\VP4^4R#)�N)r��
assertGreater�len�args)rr]s& r�!test_it_calls_super_and_sets_args�6TestErrorInitReprStr.test_it_calls_super_and_sets_args�s&�����!�����3�u�z�z�?�A�.rc�f�VP\\P!RR74R4R#)zHello!�r�z<ValidationError: 'Hello!'>N)rr�rrv�rs&r�	test_repr�TestErrorInitReprStr.test_repr�s&�������+�+�H�=�>�)�	
rc	��\P!R4pVP\V4R4RRRRR^RRR//pVFAp\	V4pWC\P!R/VBpVP\V4R4KC	R#)	r�r#rr1r)rrNr�)rrvrr�r�)rr]r��attr�ks&    r�test_unset_error�%TestErrorInitReprStr.test_unset_error�s����*�*�9�5������U��Y�/�
���x����v�x�(�	
���D��V��A����.�.�>�A�>�E����S��Z��3�	rc�.�VPR..R7R#)z�
            Failed validating 'type' in schema:
                {'type': 'string'}

            On instance:
                5
            �rr�schema_pathN�r�r�s&r�test_empty_paths�%TestErrorInitReprStr.test_empty_paths�s"�����
���	�
	
rc�2�VPR^.R.R7R#)z�
            Failed validating 'type' in schema:
                {'type': 'string'}

            On instance[0]:
                5
            �itemsrNrr�s&r�test_one_item_paths�(TestErrorInitReprStr.test_one_item_paths�s&�����
��� �	�	�
	
rc�6�VPR^R..ROR7R#)z�
            Failed validating 'type' in schema['items'][0]:
                {'type': 'string'}

            On instance[0]['a']:
                5
            r�rN)rrr�rr�s&r�test_multiple_item_paths�-TestErrorInitReprStr.test_multiple_item_paths�s&�����
��S��'�	�
	
rc��VPR\\^44\\	\^4\^444RR7R#)a?
            Failed validating 'maxLength' in schema:
                {0: 0,
                 1: 1,
                 2: 2,
                 3: 3,
                 4: 4,
                 5: 5,
                 6: 6,
                 7: 7,
                 8: 8,
                 9: 9,
                 10: 10,
                 11: 11,
                 12: 12,
                 13: 13,
                 14: 14,
                 15: 15,
                 16: 16,
                 17: 17,
                 18: 18,
                 19: 19}

            On instance:
                [0,
                 1,
                 2,
                 3,
                 4,
                 5,
                 6,
                 7,
                 8,
                 9,
                 10,
                 11,
                 12,
                 13,
                 14,
                 15,
                 16,
                 17,
                 18,
                 19,
                 20,
                 21,
                 22,
                 23,
                 24]
            �	maxLength)rrr#N)r�r	r�r��zipr�s&r�test_uses_pprint�%TestErrorInitReprStr.test_uses_pprintsC�����1
�d�%��)�_���E�"�I�u�R�y�1�2�!�k	�6	
rc�a�!V3RlR4pV!4p\P!RRVRRR7pSP\V4\	V44R#)	z�
Check for #164 which rendered exceptions unusable when a
`ValidationError` involved instances with an `__eq__` method
that returned truthy values.
c�:<a�]tRtRtoV3RltV3RltRtVtR#)�dTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator.<locals>.DontEQMeBroiDc�*<�SPR4R#�zDon't!N��fail��this�otherrs&&�r�__eq__�kTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator.<locals>.DontEQMeBro.__eq__E�����	�	�(�#rc�*<�SPR4R#rrrs&&�r�__ne__�kTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator.<locals>.DontEQMeBro.__ne__HrrrcN)rdrerfrgrr rhri)rkrs@�r�DontEQMeBrorDs����
$�
$�
$rr"r�r�somer)r#rr1rN)rrvr�r�r�)rr"rr]sf   r�:test_str_works_with_instances_having_overriden_eq_operator�OTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator=sM���	$�	$��=���*�*����"��
��	
�
�
�d�8�n�c�%�j�1rrcN)rdrerfrgr�r�r�r�r�rrrrr$rhrirjs@rr�r��s=����	6�)�/�
�4�"
�
�
�7
�r2�2rr�c�&a�]tRtRtoRtRtVtR#)�TestHashableiVc��\\P!R4.4\\P!R4.4R#)�N)�setrrv�SchemaErrorr�s&r�
test_hashable�TestHashable.test_hashableWs.���Z�
'�
'��
+�,�-��Z�
#�
#�B�
'�(�)rrcN)rdrerfrgr,rhrirjs@rr'r'Vs����*�*rr')�unittestrr��
jsonschemar�jsonschema.validatorsrrrmr�r�r'rcrr�<module>r1s[����!�1�DL�H�DL�N1%�h�1%�hhE�H�hE�Ve2�8�e2�P*�8�*r

Youez - 2016 - github.com/yon3zu
LinuXploit