__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

���g�L���SSKJr SSKrSSKJr SSKJr "SS\5r"SS\5r"S	S
\5r	"SS\5r
"S
S\5rg)�)�TestCaseN)�
exceptions)�_LATEST_VERSIONc�t�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrg)�
TestBestMatch�c�2�[[U5RU55n[R"[U55n[R"[
U55nURUR5UR5SUSU35 U$)NzNo 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�~�SSSSSS00S.00nURSS/00US9nURURS	5 g)
N�
properties�foo��bar�type�object)�
minPropertiesr�rrr"�rr�	validator�rrrs   r�(test_shallower_errors_are_better_matches�6TestBestMatch.test_shallower_errors_are_better_matchess]����%&�#(�6�8�*<�"=���
���!�!�E�E�2�;�+?��!�O���������9rc��SSS0SS0/SS0SS0/S.nUR0US9nURURS5 g)	zV
A property you *must* match is probably better than one you have to
match a part of.
rr �string�number)r"�anyOf�oneOfr#r"Nr$r&s   r�%test_oneOf_and_anyOf_are_weak_matches�3TestBestMatch.test_oneOf_and_anyOf_are_weak_matches s]����x�(�6�8�*<�=��x�(�6�8�*<�=�
��
�!�!�2�f�!�=���������9rc��SSSSS0SSSS000/000nURSSS00US	9nURURS5 g
)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,r r*r�array�r#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�v�SSS0SS0SS0/0nUR/US9nURURS5 g)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,r r*�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�j�SSS0/0nUR/US9nURURS5 g)zl
We *do* traverse anyOf with a single nested error, even though it is
vacuously equally relevant to itself.
r,r r*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��SSSSS0SSSS000/000nURSSS00US	9nURURS5 g
)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-r r*rr1r2r#Nr3r&s   r�8test_if_the_most_relevant_error_is_oneOf_it_is_traversed�FTestBestMatch.test_if_the_most_relevant_error_is_oneOf_it_is_traversedcr7rc�v�SSS0SS0SS0/0nUR/US9nURURS5 g)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-r r*r9r!r#Nr$r&s   r�3test_no_oneOf_traversal_for_equally_relevant_errors�ATestBestMatch.test_no_oneOf_traversal_for_equally_relevant_errorszr<rc�j�SSS0/0nUR/US9nURURS5 g)zl
We *do* traverse oneOf with a single nested error, even though it is
vacuously equally relevant to itself.
r-r r*r#Nr$r&s   r�6test_oneOf_traversal_for_single_equally_relevant_error�DTestBestMatch.test_oneOf_traversal_for_single_equally_relevant_error�r@rc��SSSSS0SSSS000/000nURSSS00US	9nURURS5 g
)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�allOfr r*rr1r2r#Nr3r&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
��SSSSS0SSS0SSSS000/0/000nURSSS00US	9nURURS5 g
)zX
We traverse into nested contexts (a oneOf containing an error in a
nested oneOf here).
rrr-r r*rr1r2r#Nr3r&s   r�test_nested_context_for_oneOf�+TestBestMatch.test_nested_context_for_oneOf�s���
�����*�#�!'�� 2�$0�(-���/@�3&�!"�&�	����
��&�!�!�E�E�2�;�+?��!�O������-�-�w�7rc��SSSSSS.SSS	./000nURSS
0US9nURURS5 SSSSSS	.SSS./000nURSS
0US9nURURS5 g)
Nrrr,r1r�r �minItemsr*�
�r �	minLengthrr#rVr$�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��SSSSS/SS.SS	/S
S./000nURSS0US
9nURURS5 SSSS	S
S.SSS./000nURSS0US
9nURURS5 g)Nrrr,r1r!rrRr9r*rTrUrr#rVr$rWs    r�(test_it_prioritizes_matching_union_types�6TestBestMatch.test_it_prioritizes_matching_union_types�s������")�8�!4�!�D�"+�X�!6�R�H����	
���!�!�E�5�>�&�!�I���������5�
���!)��;�!(�a�8����	
�	��!�!�E�5�>�)�!�L���������5rc�j�SSS00nURSS0US9nURUR5 g)NrrFrr#)r�assertIsNoner%r&s   r�test_boolean_schemas�"TestBestMatch.test_boolean_schemas�s;������/���!�!�E�5�>�&�!�I�����$�.�.�)rc���[SS05nUR05unUR[R"UR055R
S5 g)Nr"r)rrrrrr%)rr%�errors   r�test_one_error�TestBestMatch.test_one_errorsS��#�_�a�$8�9�	��&�&�r�*�������!�!�)�"7�"7��";�<�F�F��	
rc��[05nUR[R"UR	0555 g)N)rr_rrr)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.r5r:r>rBrErHrLrOrYr\r`rdrg�__static_attributes__rirrrrsS��	�
:�:�8�.2� 1�8�.2� 1�9�&8�86�66�6*�

�Lrrc�,�\rSrSrSrSrSrSrSrg)�TestByRelevanceic��[R"SS/S9n[R"SSS/S9n[X/[RS9nUR	X15 [X!/[RS9nUR	X15 g)N�Oh no!�baz��path�Oh yes!rr��key)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��[R"S/S9n[R"SS/S9n[X/[RS9nUR	UVs/sHn[UR5PM snS///5 [X!/[RS9nUR	UVs/sHn[UR5PM snS///5 gs snfs snf)Nrrrtrvrrw)rry�sortedr{rr
ru)rr}r~rrcs     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�&Cc���[R"S/SS9n[R"S/SS9n[R"SS9n[X/US9nUR	XB5 [X!/US9nUR	XB5 g)Nrr�a�rur%rv�b)�weakrw�rry�by_relevancerzr|)rr��normalrrs     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�&�[R"S/SS9n[R"S/SS9n[R"S/SS9n[R"SSS9n[XU/US	9nUR	XS5 [X2U/US	9nUR	XS5 g)
Nrrr�r�rvr�zOh fine!�c)r��strongrwr�)rr�r�r�rrs      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�$rriN)	rjrkrlrmr�r�r�r�rnrirrrprps��&�
� 
%�%rrpc�\�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrg)�
TestErrorTreeiCc���[S5Vs/sHn[R"SUS9PM nn[R"U5nUR	UR
S5 gs snf)Nr�	Something�r%)�rangerry�	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��[R"SS/S9/n[R"U5nURSU5 g)N�	a messagerrt)rryr��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��[R"SS/S9/n[R"U5nURSU5 g)Nr�rrtr)rryr��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��[R"SSS9n[R"U/5nURURSU05 g)Nr�rr��rryr�rr�rrcr�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���[R"SS/S9[R"SSS/S9/n[R"U5nURSUS5 UR	SUS5 g)Nz
a bar messagerrtza bar -> 0 messager�)rryr�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���[R"SSSS/S9[R"SSSS/S9p![R"X/5nURUSSRXS.5 g)	N�1rrr)r%ru�2�quux)rr�r��r�e1�e2r�s    r�+test_children_have_their_errors_dicts_built�9TestErrorTree.test_children_have_their_errors_dicts_builtesh���&�&�s�e�5�!�*�M��&�&�s�f�E�1�:�N�
��#�#�R�H�-������e��Q��.�.��0G�Hrc��[R"SSSS/SS9[R"SSS	S
/SS9p![R"X/5 g)Nr�rr�bar2�i1�r%rurr�r��foobarr�i2)rryr�)rr�r�s   r�"test_multiple_errors_with_instance�0TestErrorTree.test_multiple_errors_with_instancemsW���&�&����V�_��	
�

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

�	���b�X�&rc���[R"SS/S9n[R"U/5nUR[5 US SSS5 g!,(df   g=f)N�123r)r%rr)rryr��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|sI���*�*�5�E�B�O���#�#�U�G�,��
�
�
�z�
*���G�+�
*�
*�s�A�
A c��[R"SS0S/S9n[R"U/5nURUS[R5 g)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%rruN)rryr��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��[R"SSSS/SS9n[R"U/5nUR[	U5S5 g)Nr�rrr�r�r�z<ErrorTree (1 total error)>�rryr�r�reprr�s   r�test_repr_single�TestErrorTree.test_repr_single�sK���*�*�������	
���#�#�U�G�,������d��%B�Crc���[R"SSSS/SS9[R"SSS	S
/SS9p![R"X/5nUR[	U5S5 g)
Nr�rrr�r�r�r�r�r�rr�z<ErrorTree (2 total errors)>r�r�s    r�test_repr_multiple� TestErrorTree.test_repr_multiple�sn���&�&����V�_��	
�

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

��#�#�R�H�-������d��%C�Drc�f�[R"/5nUR[U5S5 g)Nz<ErrorTree (0 total errors)>)rr�rr�)rr�s  r�test_repr_empty�TestErrorTree.test_repr_empty�s'���#�#�B�'������d��%C�DrriN)rjrkrlrmr�r�r�r�r�r�r�r�r�r�r�r�rnrirrr�r�CsC��/�#�
&�
6�
)�I�
'��
A�D�E� Err�c�P�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�TestErrorInitReprStri�c�n�[SSSSSS0S9nURU5 [R"S0UD6$)N�hellor r*�)�messager%r4rrri)�dict�updaterry)r�kwargs�defaultss   r�
make_error�TestErrorInitReprStr.make_error�sB�����$���H�%�
��	������)�)�5�H�5�5rc��[R"U5RS5nUR"S0UD6n[	U5RS5upEnUR
XCR5 UR
Xa5 g)N�
ri)�textwrap�dedent�rstripr��str�	partitionrr�)r�expectedr�rc�message_line�_�rests       r�assertShows� TestErrorInitReprStr.assertShows�se���?�?�8�,�3�3�D�9�����)�&�)�� #�E�
� 4� 4�T� :��������}�}�5�����(rc�n�UR5nUR[UR5S5 g)Nr�)r��
assertGreater�len�args)rrcs  r�!test_it_calls_super_and_sets_args�6TestErrorInitReprStr.test_it_calls_super_and_sets_args�s&�����!�����3�u�z�z�?�A�.rc�^�UR[[R"SS95S5 g)NzHello!�r�z<ValidationError: 'Hello!'>)rr�rry�rs r�	test_repr�TestErrorInitReprStr.test_repr�s&�������+�+�H�=�>�)�	
rc��[R"S5nUR[U5S5 SSSSS0S.nUHAn[	U5nXC	[R"S0UD6nUR[U5S5 MC g)Nr�r r*r�)r%r4rrr�)rryrr�r�)rrcr��attr�ks     r�test_unset_error�%TestErrorInitReprStr.test_unset_error�s����*�*�9�5������U��Y�/� �'���x�(�	
���D��V��A����.�.�>�A�>�E����S��Z��3�	rc�&�URS//S9 g)Nz�
            Failed validating 'type' in schema:
                {'type': 'string'}

            On instance:
                5
            �ru�schema_path�r�r�s r�test_empty_paths�%TestErrorInitReprStr.test_empty_paths�s"�����
���	�
	
rc�*�URSS/S/S9 g)Nz�
            Failed validating 'type' in schema:
                {'type': 'string'}

            On instance[0]:
                5
            r�itemsrrr�s r�test_one_item_paths�(TestErrorInitReprStr.test_one_item_paths�s&�����
��� �	�	�
	
rc�.�URSSS//SQS9 g)Nz�
            Failed validating 'type' in schema['items'][0]:
                {'type': 'string'}

            On instance[0]['a']:
                5
            rr�)r
rr�rrr�s r�test_multiple_item_paths�-TestErrorInitReprStr.test_multiple_item_paths�s&�����
��S��'�	�
	
rc��URS[[S55[[	[S5[S555SS9 g)Na?
            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%)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�^�"U4SjS5nU"5n[R"SSUSSS9nTR[U5[	U55 g)	z�
Check for #164 which rendered exceptions unusable when a
`ValidationError` involved instances with an `__eq__` method
that returned truthy values.
c�.>�\rSrSrU4SjrU4SjrSrg)�dTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator.<locals>.DontEQMeBroiDc�(>�TRS5 g�NzDon't!��fail��this�otherrs  �r�__eq__�kTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator.<locals>.DontEQMeBro.__eq__E�����	�	�(�#rc�(>�TRS5 grrrs  �r�__ne__�kTestErrorInitReprStr.test_str_works_with_instances_having_overriden_eq_operator.<locals>.DontEQMeBro.__ne__Hr#rriN)rjrkrlrmr!r%rnr�s�r�DontEQMeBrorDs���
$�
$�
$rr'r�r�somer)r%rr4rN)rryr�r�r�)rr'rrcs`   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�1rriN)rjrkrlrmr�r�r�r�rrrrrr)rnrirrr�r��s5��	6�)�/�
�4�"
�
�
�7
�r2rr�c��\rSrSrSrSrg)�TestHashableiVc��[[R"S5/5 [[R"S5/5 g)N�)�setrry�SchemaErrorr�s r�
test_hashable�TestHashable.test_hashableWs.���Z�
'�
'��
+�,�-��Z�
#�
#�B�
'�(�)rriN)rjrkrlrmr1rnrirrr,r,Vs��*rr,)�unittestrr��
jsonschemar�jsonschema.validatorsrrrpr�r�r,rirr�<module>r6s[����!�1�DL�H�DL�N1%�h�1%�hhE�H�hE�Ve2�8�e2�P*�8�*r

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 156 B 0644
_suite.cpython-313.pyc File 12.91 KB 0644
fuzz_validate.cpython-313.pyc File 2.21 KB 0644
test_cli.cpython-313.pyc File 32.09 KB 0644
test_deprecations.cpython-313.pyc File 23.52 KB 0644
test_exceptions.cpython-313.pyc File 25.63 KB 0644
test_format.cpython-313.pyc File 6.06 KB 0644
test_jsonschema_test_suite.cpython-313.pyc File 9.68 KB 0644
test_types.cpython-313.pyc File 11.6 KB 0644
test_utils.cpython-313.pyc File 6.86 KB 0644
test_validators.cpython-313.pyc File 126.6 KB 0644
Filemanager