AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/jsonschema/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/jsonschema/tests/__pycache__/test_validators.cpython-310.pyc
o

>��]���@s�ddlmZddlmZddlmZddlmZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZddlZddlmZmZmZmZdd	lmZmZdd
lmZdd�ZGd
d�de�ZGdd�de�ZGdd�de	�ZGdd�de	�ZGdd�de	�Z Gdd�de!�Z"Gdd�de"e!�Z#Gdd�de!�Z$Gdd�de$e#e	�Z%Gdd �d e$e#e	�Z&Gd!d"�d"e#e	�Z'Gd#d$�d$e#e	�Z(Gd%d&�d&e�Z)Gd'd(�d(e�Z*Gd)d*�d*e�Z+d+d,�Z,ej-Gd-d.�d.e!��Z.ej-Gd/d0�d0e!��Z/dS)1�)�deque)�contextmanager)�Decimal)�BytesIO)�TestCaseN)�SynchronousTestCase)�
FormatChecker�TypeChecker�
exceptions�
validators)�PY3�pathname2url)�bugccs �|�|�st�d�VdSdS)N�Whoops!)�
startswithr
�ValidationError)�	validatorr�instance�schema�r�B/usr/lib/python3/dist-packages/jsonschema/tests/test_validators.pyrs�
�rc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�TestCreateAndExtendcCsP|�|jtjttj��ddi|_dti|_t�|_tj	|j|j|jd�|_
dS)N�$idzsome://meta/schemar��meta_schemar�type_checker)�
addCleanup�assertEqualr�meta_schemas�dictrrr	r�create�	Validator��selfrrr�setUps�

�zTestCreateAndExtend.setUpcCs.|�|jj|jj|jjf|j|j|jf�dS�N)rr!�
VALIDATORS�META_SCHEMA�TYPE_CHECKERrrrr"rrr�
test_attrs*s���zTestCreateAndExtend.test_attrscCs ddi}|�|�|�j|�dS)Nr�foo)rr!r�r#rrrr�	test_init7szTestCreateAndExtend.test_initcCs�ddi}|�|�j}t|d��}|�|g�tjdd|ddtdg�d�}t|d��}|�t|�d�|�|d��|���dS)	Nr�hel�hellor�goodbye)rrr�validator_value�schema_path�r)	r!�iter_errors�listrr
rr�len�	_contents)r#rr3�errors�expected_errorrrr�test_iter_errors;s�	z$TestCreateAndExtend.test_iter_errorscCs4tjddidd�}|�tjjd�|�|jd�dS)Nr�	something�
my version�r�version�MyVersionValidator)rr rr�popr�__name__�r#r!rrr�.test_if_a_version_is_provided_it_is_registeredOs�zBTestCreateAndExtend.test_if_a_version_is_provided_it_is_registeredcCs,ttj�}tjddid�|�tj|�dS)N�id)r)rrrr r)r#�originalrrr�6test_if_a_version_is_not_provided_it_is_not_registeredWs
zJTestCreateAndExtend.test_if_a_version_is_not_provided_it_is_not_registeredcCsBd}d|i}tj|ddd�d�|�tjj|�|�|tj�dS)N�meta schema idrCr;cS�|�dd�S�NrC���get��srrr�<lambda>c�zMTestCreateAndExtend.test_validates_registers_meta_schema_id.<locals>.<lambda>�rr=�id_of�rr rrr?�assertIn�r#�meta_schema_key�my_meta_schemarrr�'test_validates_registers_meta_schema_id\s�z;TestCreateAndExtend.test_validates_registers_meta_schema_idcCs<d}d|i}tj|dd�|�tjj|�|�|tj�dS)N�meta schema $idrr;r<rRrTrrr�.test_validates_registers_meta_schema_draft6_idis�zBTestCreateAndExtend.test_validates_registers_meta_schema_draft6_idcsDtjidd��|�t�fdd�dgfdddd	d
ifdfD���dS)Nr�rrc3s&�|]\}}�i�j||d�VqdS))r�typeN)�is_type)�.0r[r�r!rr�	<genexpr>xs
��
�z@TestCreateAndExtend.test_create_default_types.<locals>.<genexpr>�array)�booleanT)�integer�)�nullN)�numberg(@�object)�stringr*)rr �
assertTrue�allr"rr^r�test_create_default_typesus���z-TestCreateAndExtend.test_create_default_typescCs`t|jj�}t�}tj|jd|id�}|�|j|j|j|jjft||d�|jj|jj|f�dS)N�new�r�rk)	rr!r&rfr�extendrr'r()r#rDrk�Extendedrrr�test_extend�s$��
��zTestCreateAndExtend.test_extendcsf�fdd�}d}d|d�}tj|�j�j|d�}��|�|j�|�t�|�}��|�|j�|�dS)zK
        Extending a validator preserves its notion of schema IDs.
        cs|�d�j�|��S)N�__test__)rKr!�ID_OF�rr"rrrQ��z3TestCreateAndExtend.test_extend_idof.<locals>.id_ofzthe://correct/id/zthe://wrong/id/)rrq)rrrrQN)rr rrrrr'rn)r#rQ�
correct_idr�Original�Derivedrr"r�test_extend_idof�s��
z$TestCreateAndExtend.test_extend_idofN)r@�
__module__�__qualname__r$r)r,r9rBrErWrYrjrprxrrrrrs

rc@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�TestLegacyTypeCheckingcCs0tjidd�}|�t|j�hd��|��dS)NrrZ>rdr`rerfrgrarb)rr r�set�
DEFAULT_TYPES�
flushWarningsrArrrrj�s
�
z0TestLegacyTypeChecking.test_create_default_typescCs�tjidd�}t|j�}t�}tj|d|id�}|�|j|j|j|j|j	|i�j	|�
�ddft||d�|j|j||j	|j	|�
�ddf�dS)NrrZrkrlr�messagerm)rr rr&rfrnrr'r(r}r~)r#r!rDrkrorrrrp�s2
��

��z"TestLegacyTypeChecking.test_extendcCsPddi}|�t�|��d��tj|dttfid�}|�|�d��|��dS)Nr[rgrc)�types)�assertFalser�Draft7Validator�is_valid�str�intrhr~)r#rrrrr�0test_types_redefines_the_validators_type_checker�s
�zGTestLegacyTypeChecking.test_types_redefines_the_validators_type_checkerc	Cs.|jtdtj|jjjtjiidtid�dS)NzPThe default_types argument is deprecated. Use the type_checker argument instead.r*)�categoryr�filename�frr�
default_types)	�assertWarns�DeprecationWarning�sys�modulesry�__file__rr rfr"rrr�"test_providing_default_types_warns�s
�z9TestLegacyTypeChecking.test_providing_default_types_warnscCs�tjiit�d�}|�tj��}|jWd�n1swY|�dt|j��|�tj��
|i�jWd�n1sAwY|�	|�
��dS)a�
        We raise an error when you ask a validator with non-default
        type checker for its DEFAULT_TYPES.

        The type checker argument is new, so no one but this library
        itself should be trying to use it, and doing so while then
        asking for DEFAULT_TYPES makes no sense (not to mention is
        deprecated), since type checkers are not strictly about Python
        type.
        rNz=DEFAULT_TYPES cannot be used on Validators using TypeCheckers)rr r	�assertRaises�_DontDoThatr}rSr��	exceptionr�r~�r#r!�errr�?test_cannot_ask_for_default_types_with_non_default_type_checker�s ����zVTestLegacyTypeChecking.test_cannot_ask_for_default_types_with_non_default_type_checkercCs:tjiit�d�}|�|���|i�|�|���dS)Nr)rr r	r�r~rArrr�2test_providing_explicit_type_checker_does_not_warns�zITestLegacyTypeChecking.test_providing_explicit_type_checker_does_not_warncCs6tjiid�}|�|���|i�|�|���dS)NrZ)rr r�r~rArrr�$test_providing_neither_does_not_warn#sz;TestLegacyTypeChecking.test_providing_neither_does_not_warncCsf|�t��}tjiidtit�d�Wd�n1swY|�dt|j��|�	|�
��dS)Nr*)rrr�rz:Do not specify default_types when providing a type checker)r��	TypeErrorrr rfr	rSr�r�r�r~�r#r�rrr�5test_providing_default_types_with_type_checker_errors*s���zLTestLegacyTypeChecking.test_providing_default_types_with_type_checker_errorscCsntjiidtid�}|�t��}tj|it�d�Wd�n1s#wY|�dt|j	��|�
�dS)Nr`)rrr�)rrz�Cannot extend a validator created with default_types with a type_checker. Update the validator to use a type_checker when created.)rr r4r�r�rnr	rSr�r�r~r�rrr�<test_extending_a_legacy_validator_with_a_type_checker_errors9s"����zSTestLegacyTypeChecking.test_extending_a_legacy_validator_with_a_type_checker_errorscCs8tjiid�}|�|���t�|�|�|���dS)N)rr�)rr rhr~rnr�rArrr�1test_extending_a_legacy_validator_does_not_rewarnPs
zHTestLegacyTypeChecking.test_extending_a_legacy_validator_does_not_rewarncCs@tjiid�}|�|���|�tdtj|jjj	t
|d�dS�NrZzcThe DEFAULT_TYPES attribute is deprecated. See the type checker attached to this validator instead.r}�rr r�r~r�r�r�r�ryr��getattrrArrr�"test_accessing_default_types_warnsWs�z9TestLegacyTypeChecking.test_accessing_default_types_warnscCsDtjiid�}|�|���|�tdtj|jjj	t
|i�d�dSr�r�rArrr�2test_accessing_default_types_on_the_instance_warnsis�zITestLegacyTypeChecking.test_accessing_default_types_on_the_instance_warnscCsFtjiid�}|�|���|jtdtj|jjj	|idt
id�dS)NrZzaThe types argument is deprecated. Provide a type_checker to jsonschema.validators.extend instead.�bar)r�rr�r�rr�)rr r�r~r�r�r�r�ryr�rfrArrr�"test_providing_types_to_init_warns{s
�z9TestLegacyTypeChecking.test_providing_types_to_init_warnsN)r@ryrzrjrpr�r�r�r�r�r�r�r�r�r�r�rrrrr{�sr{c@s$eZdZdd�Zdd�Zdd�ZdS)�TestIterErrorscCst�i�|_dSr%)r�Draft3Validatorrr"rrrr$�szTestIterErrors.setUpcCsnddg}dgd�gd�gdd�}dd	�|j�||�D�}d
|dfdd
|dfg}|�t|�t|��dS)Nr2�r`)�a�b�c)�dr�r��)�disallow�enum�minItemscss�|]}|jVqdSr%)r�r]r�rrrr_�s�z2TestIterErrors.test_iter_errors.<locals>.<genexpr>z%r is disallowed for [1, 2]r�z[1, 2] is too shortz[1, 2] is not one of %rr�)rr3r�sorted)r#rr�got�expectedrrrr9�s��zTestIterErrors.test_iter_errorscCsXddgddd�}dddid	did
gd�d�d
�i}t|j�||��}|�t|�d�dS)Nr�r2��spam�r*r��baz�quux�
propertiesr[rgr��
�r������maximumr��r*r�r�r�)r4rr3rr5)r#rrr7rrr�0test_iter_errors_multiple_failures_one_validator�s��z?TestIterErrors.test_iter_errors_multiple_failures_one_validatorN)r@ryrzr$r9r�rrrrr��sr�c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�TestValidationErrorMessagescOsb|�dtj�|�tj��}tj||g|�Ri|��Wd�|jjS1s(wY|jjS)N�cls)	�
setdefaultrr�r�r
r�validater�r)r#rr�args�kwargsr�rrr�message_for�s
��z'TestValidationErrorMessages.message_forcCs&|jdddid�}|�|dd�dS�Nr2r[rg�rrz1 is not of type %r�r�r�r#rrrr�test_single_type_failure�sz4TestValidationErrorMessages.test_single_type_failurecCs(|jdddgid�}|�|dd�dSr�r�r�rrr�test_single_type_list_failure�sz9TestValidationErrorMessages.test_single_type_list_failurecCs.d}|jddt|�id�}|�|d|�dS)N)rgrfr2r[r�z1 is not of type %r, %r)r�r4r)r#r�rrrr�test_multiple_type_failure�sz6TestValidationErrorMessages.test_multiple_type_failurecCs2dddigi}|jdd|gid�}|�|d�dS)Nr[�minimumr�r2r��1 is less than the minimum of 3r�)r#r[rrrr�&test_object_without_title_type_failure�szBTestValidationErrorMessages.test_object_without_title_type_failurecCs.dddd�gi}|jd|d�}|�|d�dS)Nr[�Foor�)�namer�r2r�r�r��r#rrrrr�#test_object_with_named_type_failure�sz?TestValidationErrorMessages.test_object_with_named_type_failurecC�"|jdddid�}|�|d�dS)Nr2r�r�r�z1 is less than the minimum of 2r�r�rrr�test_minimum��z(TestValidationErrorMessages.test_minimumcCr�)Nr2r�rr�z"1 is greater than the maximum of 0r�r�rrr�test_maximum�r�z(TestValidationErrorMessages.test_maximumcCsBd\}}d||ii}|jddi|tjd�}|�|d||f�dS�N�r�r*�dependenciesr�r��rrr�z%r is a dependency of %r�r�rr�r�r#�depend�onrrrrr� test_dependencies_single_element�s�z<TestValidationErrorMessages.test_dependencies_single_elementcC�Dd\}}d||gii}|jddi|tjd�}|�|d||f�dSr�r�r�rrr�test_dependencies_list_draft3���z9TestValidationErrorMessages.test_dependencies_list_draft3cCr�r�)r�rr�rr�rrr�test_dependencies_list_draft7�r�z9TestValidationErrorMessages.test_dependencies_list_draft7cCs&|jdggdd�d�}|�d|�dS)Nr�F��items�additionalItemsr�z(2 was unexpected)�r�rSr�rrr�#test_additionalItems_single_failure�s
�z?TestValidationErrorMessages.test_additionalItems_single_failurecCs(|jgd�gdd�d�}|�d|�dS)N)r2r�r�Fr�r�z(1, 2, 3 were unexpected)r�r�rrr�&test_additionalItems_multiple_failures�s
�zBTestValidationErrorMessages.test_additionalItems_multiple_failurescCs4d}ddi}|j|di|d�}|�d|f|�dS)Nr*�additionalPropertiesFr�r�z(%r was unexpected)r�)r#�
additionalrrrrr�(test_additionalProperties_single_failureszDTestValidationErrorMessages.test_additionalProperties_single_failurecCsPddi}|jt�ddg�|d�}|�td�|�|�td�|�|�d|�dS)Nr�Fr*r�r�zwere unexpected))r�r�fromkeysrS�reprr�rrr�+test_additionalProperties_multiple_failures	s�zGTestValidationErrorMessages.test_additionalProperties_multiple_failurescCs.ddi}|jddi|tjd�}|�d|�dS)N�constrcr*r�r�z12 was expected�r�r�Draft6ValidatorrSr�rrr�
test_consts�z&TestValidationErrorMessages.test_constcCs4dddii}|jdigg|tjd�}|�d|�dS)N�containsr�rcr�r�z4None of [2, {}, []] are valid under the given schemar�r�rrr�
test_containss��z)TestValidationErrorMessages.test_containscCsdtdd�}|�d�dd��ddi}|jd||d�}|�td�|�|�td�|�|�d	|�dS)
Nr)�formats�thingcSsdS�NFr��valuerrrrN+szQTestValidationErrorMessages.test_invalid_format_default_message.<locals>.<lambda>�format�bla)rr�format_checkerzis not a)r�checksr�rSr�)r#�checkerrrrrr�#test_invalid_format_default_message)s
�z?TestValidationErrorMessages.test_invalid_format_default_messagec
Cs�ddddiddid�d�}|jddi|tjd	�}|�|d
�td�td�td���|jdd
d�|tjd	�}|�|d�td�td�td�td���dS)NrfFr[rg)�^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�r�Draft4Validatorrrr�r�rrr�1test_additionalProperties_false_patternProperties8s8��������zMTestValidationErrorMessages.test_additionalProperties_false_patternPropertiescCs"|jddtjd�}|�d|�dS)Nr:Fr�z'False schema does not allow 'something')r�rr�rSr�rrr�test_False_schemaVs�z-TestValidationErrorMessages.test_False_schemaN)r@ryrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
rrrrrr��s*


	r�c@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�TestValidationErrorDetailscCs�d}dddiddigi}t�|�}t|�|��}|�t|�d�|d}|�|jd�|�|j|d�|�|j|�|�|j	|�|�
|j�|�|jt
g��|�|jt
g��|�|jt
g��|�|jt
dg��|�|jt
dg��|�|jt
dg��|�t|j�d	�t|j�\}}|�|jd�|�|j|ddd�|�|j|�|�|j	|dd�|�|j|�|�|jt
g��|�|jt
g��|�|jt
g��|�|jt
ddg��|�|jt
ddg��|�|jt
gd
���|�|j�|�|jd�|�|j|ddd�|�|j|�|�|j	|dd�|�|j|�|�|jt
g��|�|jt
g��|�|jt
g��|�|jt
ddg��|�|jt
ddg��|�|jt
gd���|�t|j�d�dS)N��anyOfr��r[rgr2rr�)rrr�)rr2r[)rrr4r3rr5rr0rr�assertIsNone�parent�pathr�
relative_path�
absolute_pathr1�relative_schema_path�absolute_schema_path�context�
sorted_errors�assertIsr��r#rrrr7r��e1�e2rrr�
test_anyOfbsb��
�z%TestValidationErrorDetails.test_anyOfcCs�ddi}dddiddddgiid�gi}t�|�}t|�|��}|�t|�d�|d	}|�|jd�|�|j|d�|�|j|�|�|j	|�|�
|j�|�|jt
g��|�|jt
g��|�|jt
g��|�|jt
dg��|�|jt
dg��|�|jt
dg��|�t|j�d�t|j�\}}|�|jd�|�|j|dd	d�|�|j|�|�|j	|dd	�|�|j|�|�|jt
g��|�|jt
g��|�|jt
g��|�|jt
d	dg��|�|jt
d	dg��|�|jt
gd
���|�|j�|�|jd�|�|jdg�|�|jd�|�|j	ddgi�|�|j|�|�|jt
dg��|�|jt
dg��|�|jt
dg��|�|jt
gd���|�|jt
gd���|�|jt
gd���|�|j�dS)
Nr*r2r[rbrfr�r��r[r�r)r[rr[)r2r�r*r�)r[r2r�r*r�)rr�r4r3rr5rr0rrrrrrrrr1rrrrrr�rrrr�	test_type�sp���

��
�z$TestValidationErrorDetails.test_typec	Cs�ddgddd�}dddid	did
gd�d�d
�i}t�|�}|�|�}t|�\}}}}|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|jtdg��|�|j	d	�|�|j	d�|�|j	d�|�|j	d�dS)Nr�r2r�r�r�r�r[rgr�r�r�r�r�r�r�r*r�r�)
rr�r3rrrrrrr)	r#rrrr7rr�e3�e4rrr�test_single_nesting�s4��

z.TestValidationErrorDetails.test_single_nestingcCs�ddddgid�dg}dddgddd	gid
ddid
did�d�d�d�d�}t�|�}|�|�}t|�\}}}}}	}
|�|jtg��|�|jtdg��|�|jtddg��|�|jtgd���|�|	jtgd���|�|
jtddg��|�|jtdg��|�|jtddg��|�t|j�gd��|�t|j�gd��|�t|	j�gd��|�t|
j�gd��|�|j	d�|�|j	d�|�|j	d�|�|j	d�|�|	j	d
�|�|
j	d�dS)Nr2r�r�)r*r�r�rgrfr�r�r`�requiredTr�)r�r�r!)r[r�rr�)r2r�r�)r2r�r�r*r[r�)r�r�r�r[)r�r�r�r�r�r&)r�r�r�r�r�r�)r�r�r*r�)
rr�r3rrrrr1r4r)r#rrrr7rrr#r$�e5�e6rrr�test_multiple_nestingsV
�����

����z0TestValidationErrorDetails.test_multiple_nestingc	Csdddddgddiddd	d
iid�d�d
�giiddgdd	d
iid�}dddddddiid�id�i}t�|�}|�|�\}|�|jtdg��|�|jtgd���|j\}|�|jtgd���|�|jtgd���|j\}|�|jtgd���|�|jtgd���dS)N�noderrfr��childrenr[rg�^.*$�$refz#/definitions/node)r[r)r�r+)r[r&r��root)�definitionsr[r&r�r��ab)r�r.r)r.r+r�)	r�r.rrr�r+rr,r)r.r+r�r+r0)r�r.rrr�r+rr,rrr�r+rr,r)rrr3rrrrr)r#rrrr�rrrrr�test_recursiveFsp��������
�������
�������z)TestValidationErrorDetails.test_recursivecCs�ddd�}dddd�i}t�|�}|�|�}t|�\}}|�|jtdg��|�|jtdg��|�|jd	�|�|jd
�dS)Nr�r�r�r�rbr�r[r�r*r[r��rr�r3rrrrr�r#rrrr7rrrrr�test_additionalProperties�s


z4TestValidationErrorDetails.test_additionalPropertiescCs�ddd�}dddiddid�i}t�|�}|�|�}t|�\}}|�|jtd	g��|�|jtd
g��|�|jd�|�|jd�dS)Nr2r�r�rr[rgr�rr�r*r3r4rrr�test_patternProperties�s
��

z1TestValidationErrorDetails.test_patternPropertiescCs�ddg}gddd�d�}t�|�}|�|�}t|�\}}|�|jtdg��|�|jtdg��|�|jd�|�|jd	�dS)
Nr*r2rbrr2r�rr[r�r3r4rrr�test_additionalItems�s�

z/TestValidationErrorDetails.test_additionalItemscCs�gd�}igddd�d�}t�|�}|�|�}t|�\}}|�|jtdg��|�|jtdg��|�|jd�|�|jd	�dS)
N)r*r�r2rbrr2r�r2r�r[r�r3r4rrr�test_additionalItems_with_items�s�

z:TestValidationErrorDetails.test_additionalItems_with_itemscCs�ddi}ddddiii}t�|�}|�|�\}|�|jd�|�|jdddidf�|�|jtg��|�|jtddg��dS)Nr*rc�
propertyNames�notr�z%r is not allowed for %r�	rr�r3rrrrrr1)r#rrr�errorrrr�test_propertyNames�s
�z-TestValidationErrorDetails.test_propertyNamescCspddiddid�}t�|�}|�d�\}|�|jd�|�|jd�|�|jtg��|�|jtgd���dS)Nr�rc�
)�if�then�13 was expected)r?r@r�r;�r#rrr<rrr�test_if_then���
z'TestValidationErrorDetails.test_if_thencCspddiddid�}t�|�}|�d�\}|�|jd�|�|jd�|�|jtg��|�|jtgd���dS)Nr�rcr>)r?�elser�rA)r?rEr�r;rBrrr�test_if_elserDz'TestValidationErrorDetails.test_if_elsec
CsNt�d�}|�d�\}|�|j|j|j|j|j|j	fdddddt
g�f�dS)NFrczFalse schema does not allow 12)rr�r3rrrr0rrr1r)r#rr<rrr�test_boolean_schema_Falses$
�	��z4TestValidationErrorDetails.test_boolean_schema_FalsecCs�ddddii}}tjd|itjdi||id�d�}|�d	d
i�\}|�|j|j|j|j|j	|j
|jfdddd
td	g�dditddg�f�dS)N�someRefr�r[rbr-rI��store��resolverr*�notAnIntegerz''notAnInteger' is not of type 'integer')
rr��RefResolverr3rrrr0rrrr1r)r#�refrrr<rrr�test_ref-s0��

��z#TestValidationErrorDetails.test_refN)r@ryrzr r"r%r)r1r5r6r7r8r=rCrFrGrPrrrrr_sBJ"6brc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�MetaSchemaTestsMixincCsH|�tj��|j�ddt�ii�Wd�dS1swYdS)Nr��test)r�r
�SchemaErrorr!�check_schemarfr"rrr�test_invalid_propertiesMs"�z,MetaSchemaTestsMixin.test_invalid_propertiescCsB|�tj��|j�ddi�Wd�dS1swYdS)Nr��1)r�r
rSr!rTr"rrr�test_minItems_invalid_stringQs"�z1MetaSchemaTestsMixin.test_minItems_invalid_stringcCs|j�dgi�dS)z�
        Technically, all the spec says is they SHOULD have elements, not MUST.

        See https://github.com/Julian/jsonschema/issues/529.
        r�N�r!rTr"rrr�test_enum_allows_empty_arraysVsz2MetaSchemaTestsMixin.test_enum_allows_empty_arrayscCs|j�dddgi�dS)z�
        Technically, all the spec says is they SHOULD be unique, not MUST.

        See https://github.com/Julian/jsonschema/issues/529.
        r�rcNrXr"rrr�!test_enum_allows_non_unique_items^sz6MetaSchemaTestsMixin.test_enum_allows_non_unique_itemsN)r@ryrzrUrWrYrZrrrrrQKs
rQc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Ze�
ed�dd��Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$S)%�ValidatorTestMixincC�$|j\}}|�|�|��|��dSr%)�validrhr!r��r#rrrrr�test_valid_instances_are_validh�
z1ValidatorTestMixin.test_valid_instances_are_validcCr\r%)�invalidr�r!r�r^rrr�$test_invalid_instances_are_not_validlr`z7ValidatorTestMixin.test_invalid_instances_are_not_validcCs |�t�t�i�jt�d�dS)N�r)r!rfr�r"rrr�(test_non_existent_properties_are_ignoredps z;ValidatorTestMixin.test_non_existent_properties_are_ignoredcCs|�|�i�jtj�dSr%)�assertIsInstancer!rLrrNr"rrr�.test_it_creates_a_ref_resolver_if_not_providedss
�zAValidatorTestMixin.test_it_creates_a_ref_resolver_if_not_providedcCspdddi}}tjdi||id�}|jd|i|d�}|�tj��|�d�Wd�dS1s1wYdS)N�someCoolRefr[rbrIrIr-rK)rrNr!r�r
rr�)r#rOrrLrrrr�#test_it_delegates_to_a_ref_resolverys"�z6ValidatorTestMixin.test_it_delegates_to_a_ref_resolvercshG�fdd�dt�}|�}ddi}��tj���j||d��d�Wd�dS1s-wYdS)zb
        Legacy RefResolvers support only the context manager form of
        resolution.
        cseZdZe�fdd��ZdS)zXValidatorTestMixin.test_it_delegates_to_a_legacy_ref_resolver.<locals>.LegacyRefResolverc3s���|d�ddiVdS)N�the refr[rb�r)�thisrOr"rr�	resolving�s�zbValidatorTestMixin.test_it_delegates_to_a_legacy_ref_resolver.<locals>.LegacyRefResolver.resolvingN)r@ryrzrrlrr"rr�LegacyRefResolver�srmr-rirKN)rfr�r
rr!r�)r#rmrLrrr"r�*test_it_delegates_to_a_legacy_ref_resolver�s"�z=ValidatorTestMixin.test_it_delegates_to_a_legacy_ref_resolvercC�|�|�i��dd��dS)Nr*rg)rhr!r\r"rrr�#test_is_type_is_true_for_valid_type��z6ValidatorTestMixin.test_is_type_is_true_for_valid_typecCro)Nr*r`�r�r!r\r"rrr�&test_is_type_is_false_for_invalid_type�rqz9ValidatorTestMixin.test_is_type_is_false_for_invalid_typecCs4|�|�i��dd��|�|�i��dd��dS)NTrbrerrr"rrr�,test_is_type_evades_bool_inheriting_from_int�sz?ValidatorTestMixin.test_is_type_evades_bool_inheriting_from_intz-In Python 3 json.load always produces unicodecCs|�ddi��d�dS)Nr[rgsfoo�r!r�r"rrr�$test_string_a_bytestring_is_a_string�sz7ValidatorTestMixin.test_string_a_bytestring_is_a_stringcCs|�ddi��d�dS)zF
        See https://github.com/Julian/jsonschema/issues/611.
        �patternr*Nrur"rrr�#test_patterns_can_be_native_strings�sz6ValidatorTestMixin.test_patterns_can_be_native_stringscCs~dddii}tj|j|jj�ddd��d�}||�}|�ddtd�td	�g�d
igddg}|�dd
�|�|�D�|�dS)Nr�r[recSst|tttf�o
t|t�Sr%)�
isinstancer��floatr�bool�rr�rrrrN�s
�zGValidatorTestMixin.test_it_can_validate_with_decimals.<locals>.<lambda>�rr2g�������?r�r*TcSsg|]}|j�qSrrc)r]r<rrr�
<listcomp>�szIValidatorTestMixin.test_it_can_validate_with_decimals.<locals>.<listcomp>)	rrnr!r(�redefiner�rrr3)r#rr!rrarrr�"test_it_can_validate_with_decimals�s��
�z5ValidatorTestMixin.test_it_can_validate_with_decimalscCs"|jddit�d�}|�d�dS)Nr�carrot�r�bugs)r!rr��r#rrrr�7test_it_returns_true_for_formats_it_does_not_know_about�s
�zJValidatorTestMixin.test_it_returns_true_for_formats_it_does_not_know_aboutcCs|�i�}|�|j�dSr%)r!rrr�rrr�,test_it_does_not_validate_formats_by_default�s
z?ValidatorTestMixin.test_it_does_not_validate_formats_by_defaultcs�t�}td��|jdtd���fdd��}�jddi|d�}|�d���tj��
}|�d	�Wd�n1s9wY��|j	j
��dS)
NzBad!r*)�raisescs,|dkrdS|dkr����d�|��dS)N�goodT�badz What is {}? [Baby Don't Hurt Me])�failrr��r�r#rr�check�s
zTValidatorTestMixin.test_it_validates_formats_if_a_checker_is_provided.<locals>.checkrr�r�r�)r�
ValueErrorrr!r�r�r
rrr��cause)r#rr�r�cmrr�r�2test_it_validates_formats_if_a_checker_is_provided�s�
�zEValidatorTestMixin.test_it_validates_formats_if_a_checker_is_providedcCsBt�}d|gi}tj|j|jj�|dd��d�}||��d�dS)Nr[cS�
t|t�Sr%�ryr�r|rrrrN��
z@ValidatorTestMixin.test_non_string_custom_type.<locals>.<lambda>r}r�)rfrrnr!r(rr�)r#�non_string_typer�Crazyrrr�test_non_string_custom_type�s
��z.ValidatorTestMixin.test_non_string_custom_typecCsttj|j|jj�ddd��d�}|�tj��}|ddi��d�Wd�n1s*wY|�	d	t
|j��dS)
z�
        A tuple instance properly formats validation errors for uniqueItems.

        See https://github.com/Julian/jsonschema/pull/224
        r`cSr�r%)ry�tupler|rrrrN�r�zNValidatorTestMixin.test_it_properly_formats_tuples_in_errors.<locals>.<lambda>r}�uniqueItemsT)r2r2Nz(1, 1) has non-unique elements)rrnr!r(rr�r
rr�rSr�r�)r#�TupleValidatorr�rrr�)test_it_properly_formats_tuples_in_errors�s���z<ValidatorTestMixin.test_it_properly_formats_tuples_in_errorsN)r@ryrzr_rbrdrfrhrnrprsrt�unittest�skipIfrrvrxr�r�r�r�r�r�rrrrr[gs&

r[c@sLeZdZdZdd�Zdd�Ze�ed��dd��Z	e�ed��d	d
��Z
dS)�AntiDraft6LeakMixinzN
    Make sure functionality from draft 6 doesn't leak backwards in time.
    cC�N|�tj��}|j�d�Wd�n1swY|�dt|j��dS)NTzTrue is not of type�r�r
rSr!rTrSr�r�r�rrr�test_True_is_not_a_schema��z-AntiDraft6LeakMixin.test_True_is_not_a_schemacCr�)NFzFalse is not of typer�r�rrr�test_False_is_not_a_schemar�z.AntiDraft6LeakMixin.test_False_is_not_a_schemaicC�^t�di�}|�t��}|jd|d��d�Wd�n1s wY|�|jtj	�dS)NrITrKrc�
rrNr��	Exceptionr!r��assertNotIsInstancer�r
r�r#rLr�rrr�5test_True_is_not_a_schema_even_if_you_forget_to_check�
�zIAntiDraft6LeakMixin.test_True_is_not_a_schema_even_if_you_forget_to_checkcCr�)NrIFrKrcr�r�rrr�6test_False_is_not_a_schema_even_if_you_forget_to_checkr�zJAntiDraft6LeakMixin.test_False_is_not_a_schema_even_if_you_forget_to_checkN)r@ryrz�__doc__r�r�r��skiprr�r�rrrrr��s
r�c@sFeZdZejZiifZddidfZdd�Zdd�Z	dd	�Z
d
d�ZdS)
�TestDraft3Validatorr[rbr*cCs|�ddi�}|�t��dS�Nr[�any)r!r�rfr�rrr�#test_any_type_is_valid_for_type_anysz7TestDraft3Validator.test_any_type_is_valid_for_type_anycCsrtj|j|jj�ddd��d�}|ddi�}|�d�|�tj��|�d�Wd�dS1s2wYdS)	z(
        Sigh, because why not.
        r�cSr�r%r�r|rrrrN*r�zBTestDraft3Validator.test_any_type_is_redefinable.<locals>.<lambda>r}r[rcr*N)	rrnr!r(rr�r�r
r)r#r�rrrr�test_any_type_is_redefinable#s��
"�z0TestDraft3Validator.test_any_type_is_redefinablecCs"|�|�i��t�ddi��dSr�)rhr!r�rfr"rrr�!test_is_type_is_true_for_any_type2s"z5TestDraft3Validator.test_is_type_is_true_for_any_typecCs8|�|�i��dd��|�|�i��dddi��dS)NTrar[r�)rhr!r\r�r"rrr�6test_is_type_does_not_evade_bool_if_it_is_being_tested5s zJTestDraft3Validator.test_is_type_does_not_evade_bool_if_it_is_being_testedN)r@ryrzrr�r!r]rar�r�r�r�rrrrr�sr�c@�&eZdZejZiifZddidfZdS)�TestDraft4Validatorr[rbr*N)r@ryrzrrr!r]rarrrrr�:�r�c@r�)�TestDraft6Validatorr[rbr*N)r@ryrzrr�r!r]rarrrrr�@r�r�c@r�)�TestDraft7Validatorr[rbr*N)r@ryrzrr�r!r]rarrrrr�Fr�r�c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�TestValidatorForcC�<ddi}|�t�|�tj�ddi}|�t�|�tj�dS)N�$schema�&http://json-schema.org/draft-03/schema�'http://json-schema.org/draft-03/schema#)rr�
validator_forr�r+rrr�test_draft_3M���zTestValidatorFor.test_draft_3cCr�)Nr��&http://json-schema.org/draft-04/schema�'http://json-schema.org/draft-04/schema#)rrr�rr+rrr�test_draft_4Zr�zTestValidatorFor.test_draft_4cCr�)Nr��&http://json-schema.org/draft-06/schema�'http://json-schema.org/draft-06/schema#)rrr�r�r+rrr�test_draft_6gr�zTestValidatorFor.test_draft_6cCr�)Nr��&http://json-schema.org/draft-07/schema�'http://json-schema.org/draft-07/schema#)rrr�r�r+rrr�test_draft_7tr�zTestValidatorFor.test_draft_7cC�|�t�d�tj�dS)NT�rrr��_LATEST_VERSIONr"rrr�	test_True���zTestValidatorFor.test_TruecCr�r�r�r"rrr�
test_False�r�zTestValidatorFor.test_FalsecCs6tjddiddd�d�}ddi}|�t�|�|�dS)NrCrF�12cSrGrHrJrLrrrrN�rOz8TestValidatorFor.test_custom_validator.<locals>.<lambda>rPr��rr rr��r#r!rrrr�test_custom_validator�s��z&TestValidatorFor.test_custom_validatorcCs0tjddidd�}ddi}|�t�|�|�dS)NrrX�13r<r�r�r�rrr�test_custom_validator_draft6�s��z-TestValidatorFor.test_custom_validator_draft6cCs|�t�i�tj�dSr%r�r"rrr�%test_validator_for_jsonschema_default�sz6TestValidatorFor.test_validator_for_jsonschema_defaultcCs|�tjidd�d�dS)N)�default)rrr�r"rrr�!test_validator_for_custom_default�sz2TestValidatorFor.test_validator_for_custom_defaultcCs,|jtdtj|jjjtjddiid�dS)Nz�The metaschema specified by $schema was not found. Using the latest draft to validate, but this will raise an error in the future.r��
unknownSchema)r�rr�r�rr�)r�r�r�r�ryr�rr�r"rrr�1test_warns_if_meta_schema_specified_was_not_found�s
�zBTestValidatorFor.test_warns_if_meta_schema_specified_was_not_foundcCs"tjiid�f|�|���dS)N)rr�)rr�r�r~r"rrr�0test_does_not_warn_if_meta_schema_is_unspecified�szATestValidatorFor.test_does_not_warn_if_meta_schema_is_unspecifiedN)r@ryrzr�r�r�r�r�r�r�r�r�r�r�r�rrrrr�Ls



r�c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�TestValidatecCs2g}|�|d|j�t�i|�|�||g�dS)NrT)�patch�appendrr�r)r#rr!�resultrrr�
assertUses�szTestValidate.assertUsescC�,|jdditjd�|jdditjd�dS)Nr�r��rr!r�)r�rr�r"rrr�test_draft3_validator_is_chosen���
�z,TestValidate.test_draft3_validator_is_chosencCr�)Nr�r�r�r�)r�rrr"rrr�test_draft4_validator_is_chosen�r�z,TestValidate.test_draft4_validator_is_chosencCr�)Nr�r�r�r�)r�rr�r"rrr�test_draft6_validator_is_chosen�r�z,TestValidate.test_draft6_validator_is_chosencCr�)Nr�r�r�r��r�rr�r"rrr�test_draft7_validator_is_chosen�r�z,TestValidate.test_draft7_validator_is_chosencCs|jitjd�dS)Nr�r�r"rrr�$test_draft7_validator_is_the_default�rtz1TestValidate.test_draft7_validator_is_the_defaultcCsR|�tj��}t�dddi�Wd�n1swY|�t|j�d�dS)Nrcr[rgz3(?s)Failed validating u?'.*' in schema.*On instance)r�r
rrr��assertRegexpMatchesr�r�r�rrr�test_validation_error_message����z*TestValidate.test_validation_error_messagecCsR|�tj��}t�dddi�Wd�n1swY|�t|j�d�dS)Nrcr[z5(?s)Failed validating u?'.*' in metaschema.*On schema)r�r
rSrr�r�r�r�r�rrr�test_schema_error_message�r�z&TestValidate.test_schema_error_messagecCsbdddiddigi}|�tj��}t�d|�Wd�n1s!wY|�dt|j��dS)N�oneOfr[rgr`rcz12 is not of type)r�r
rrr�rSr�r�)r#rr�rrr�test_it_uses_best_matchs
�z$TestValidate.test_it_uses_best_matchN)r@ryrzr�r�r�r�r�r�r�r�r�rrrrr��sr�c@s�eZdZdZdZddiZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�TestRefResolverrIzfoo://stored�storedrcCs.i|_|j|ji|_t�|j|j|j�|_dSr%)�referrer�
stored_uri�
stored_schemarJrrN�base_urirLr"rrrr$s

�zTestRefResolver.setUpcsdtjjd}���jd�fdd���j�|��}Wd�n1s#wY��|tjj�dS)NrC�resolve_remotecs
��d�S)NzShould not have been called!)r�)r�r�r"rrrNr�zXTestRefResolver.test_it_does_not_retrieve_schema_urls_from_the_network.<locals>.<lambda>)rr�r'r�rLrlr�r#rO�resolvedrr"r�6test_it_does_not_retrieve_schema_urls_from_the_networks
��zFTestRefResolver.test_it_does_not_retrieve_schema_urls_from_the_networkcCs\d}dt�i|jd<|j�|��}|�||jdd�Wd�dS1s'wYdS)Nz#/properties/foor*r�)rfr�rLrlrr�rrr�test_it_resolves_local_refs%s
"�z+TestRefResolver.test_it_resolves_local_refscCs�dddid�}tjj|dd�d�}|�d��}|�||d	�Wd�n1s)wY|�d
��}|�||d	�Wd�dS1sGwYdS)Nzhttp://bar/schema#r*r�)rCr�cSrGrHrJrsrrrrN/rOzETestRefResolver.test_it_resolves_local_refs_with_id.<locals>.<lambda>�rQz#/ar�zhttp://bar/schema#/a)rrN�from_schemarlr�r#rrLr�rrr�#test_it_resolves_local_refs_with_id+s��"�z3TestRefResolver.test_it_resolves_local_refs_with_idcCs�|j�|j��}|�||j�Wd�n1swYddi|jjd<|j�d��}|�|d�Wd�dS1s>wYdS)Nr*rc�
cached_refzcached_ref#/foo)rLrlr�rr�rJr)r#r�rrr�test_it_retrieves_stored_refs6s�"�z-TestRefResolver.test_it_retrieves_stored_refscCs~d}ddi}dtjvr|�tjjdtjd�td|i�tjd<|j�|��}|�|d�Wd�dS1s8wYdS)N�http://bar#bazr�rc�requests�
http://bar)r�r�r�__setitem__�ReallyFakeRequestsrLrlr)r#rOrr�rrr�,test_it_retrieves_unstored_refs_via_requests>s
�"�z<TestRefResolver.test_it_retrieves_unstored_refs_via_requestscs�d}ddi�dtjvr��tjjdtjd�dtjd<t��fdd��}��ttdtj�|t_�j�	|��}Wd�n1sBwY��
|d�dS)Nrr�rcrc3s(���|d�tt����d��VdS)Nr�utf8)rr�json�dumps�encode��url�rr#rr�fake_urlopenUs�zQTestRefResolver.test_it_retrieves_unstored_refs_via_urlopen.<locals>.fake_urlopen�urlopen)r�r�rrr�setattrrrrLrlr)r#rOrr�rr
r�+test_it_retrieves_unstored_refs_via_urlopenKs
�
�z;TestRefResolver.test_it_retrieves_unstored_refs_via_urlopencCs�tjddd��}|�tj|j�t�ddi|�Wd�n1s"wYd�t	|j��}|j
�|��}|�|d�Wd�dS1sGwYdS)NF�wt)�delete�moder*r�z
file://{}#foo)
�tempfile�NamedTemporaryFiler�os�remover�r�dumprr
rLrlr)r#�tempfrOr�rrr�(test_it_retrieves_local_refs_via_urlopenas�"�z8TestRefResolver.test_it_retrieves_local_refs_via_urlopencCsddi}tjj|dd�d�}|�|jd�|�|jd�|�d��}|�||�Wd�n1s2wY|�d��}|�||�Wd�n1sMwY|�d��}|�||�Wd�n1shwY|�d��}|�||�Wd�dS1s�wYdS)	NrCr*cSrGrHrJrsrrrrNnrOzPTestRefResolver.test_it_can_construct_a_base_uri_from_a_schema.<locals>.<lambda>r�rI�#zfoo#�rrNr�rr��resolution_scoperlr�rrr�.test_it_can_construct_a_base_uri_from_a_schemajs&����"�z>TestRefResolver.test_it_can_construct_a_base_uri_from_a_schemacCs�i}tj�|�}|�|jd�|�|jd�|�d��}|�||�Wd�n1s,wY|�d��}|�||�Wd�dS1sHwYdS)NrIrrr�rrr�9test_it_can_construct_a_base_uri_from_a_schema_without_id{s�"�zITestRefResolver.test_it_can_construct_a_base_uri_from_a_schema_without_idcsl���fdd�}ddi�d�tjdid|id�}|����}��|��Wd�dS1s/wYdS)Ncs��|���Sr%rjr�rOrr#rr�handler�sz@TestRefResolver.test_custom_uri_scheme_handlers.<locals>.handlerr*r��	foo://barrI��handlers)rrNrlr)r#r"rLr�rr!r�test_custom_uri_scheme_handlers�s"�z/TestRefResolver.test_custom_uri_scheme_handlerscs�t�g���fdd�}d}tjdidd|id�}|�|��Wd�n1s(wY|�|��	Wd�dS1s>wYdS)Nc�*z���WSty��d�YdSw)Nz#Response must not have been cached!�r?�
IndexErrorr�r��responser#rrr"��

�z5TestRefResolver.test_cache_remote_on.<locals>.handlerr#rITr*��cache_remoter%�rfrrNrl�r#r"rOrLrr*r�test_cache_remote_on�s��"�z$TestRefResolver.test_cache_remote_oncs`t�g���fdd�}d}tjdidd|id�}|�|��	Wd�dS1s)wYdS)Ncr')NzHandler called twice!r(rr*rrr"�r,z6TestRefResolver.test_cache_remote_off.<locals>.handlerr#rIFr*r-r/r0rr*r�test_cache_remote_off�s�"�z%TestRefResolver.test_cache_remote_offc	s�td���fdd�}d}tjdid|id�}|�tj��"}|�|��
|�d�Wd�n1s2wYWd�n1sAwY|�|j	t����dS)	NzOh no! What's this?cs��r%rr�r<rrr"�szTTestRefResolver.test_if_you_give_it_junk_you_get_a_resolution_error.<locals>.handlerr#rIr*r$zShouldn't get this far!)
r�rrNr�r
�RefResolutionErrorrlr�rr�)r#r"rOrL�errrr3r�3test_if_you_give_it_junk_you_get_a_resolution_error�s���zCTestRefResolver.test_if_you_give_it_junk_you_get_a_resolution_errorcCs^t�di�}|��|�tj��}|��Wd�n1swY|�dt|j��dS)NrIzFailed to pop the scope)	rrN�	pop_scoper�r
r4rSr�r�)r#rL�excrrr�.test_helpful_error_message_on_failed_pop_scope�s
�z>TestRefResolver.test_helpful_error_message_on_failed_pop_scopeN)r@ryrzr�r�r�r$r�r�r�rrrrrr r&r1r2r6r9rrrrr�
s&
	

r�cCsdd�}t||d�S)NcSs dd�|jD�dd�|jD�fS)NcS�g|]}t|��qSr�r�r�rrrr~��z.sorted_errors.<locals>.key.<locals>.<listcomp>cSr:rr;r�rrrr~�r<)rr1r3rrr�key�s�zsorted_errors.<locals>.key)r=)r�)r7r=rrrr�src@�eZdZe��Zdd�ZdS)rcCs2|j�|�}|durtdt|���tt�|��S)Nz
Unknown URL: )�
_responsesrKr�r��_ReallyFakeJSONResponserr	)r#rr+rrrrK�szReallyFakeRequests.getN)r@ryrz�attr�ibr?rKrrrrr��rc@r>)r@cCst�|j�Sr%)r�loads�	_responser"rrrr�sz_ReallyFakeJSONResponse.jsonN)r@ryrzrArBrErrrrrr@�rCr@)0�collectionsr�
contextlibr�decimalr�iorr�rrrr�r�twisted.trial.unittestrrA�
jsonschemarr	r
r�jsonschema.compatrr
�jsonschema.tests._helpersrrrr{r�r�rrfrQr[r�r�r�r�r�r�r�r�rrMrr@rrrr�<module>sX]"/o sN;	

Anon7 - 2022
AnonSec Team