Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/local/lib/python3.6/site-packages/jsonschema/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

F�KdR�@s�dZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlZdd�Zejdd	�Gd
d�de��Zejdd	�Gdd
�d
e��Zejddd�Gdd�de��Zdd�ZdS)z=
Python representations of the JSON Schema Test Suite tests.
�)�partial)�PathN)�_VALIDATORScCsBtjjd�}|dk	rt|�Sttj�jjd}|j�s>td��|S)NZJSON_SCHEMA_TEST_SUITE�jsonz�Can't find the JSON-Schema-Test-Suite directory. Set the 'JSON_SCHEMA_TEST_SUITE' environment variable or run the tests from alongside a checkout of the suite.)	�os�environ�getr�
jsonschema�__file__�parent�is_dir�
ValueError)�root�r�=/tmp/pip-build-8nxjc3nm/jsonschema/jsonschema/tests/_suite.py�_find_suitesrT)�hashc@s6eZdZejeje�d�Zdd�Zdd�Z	dd�Z
dS)	�Suite)�defaultcCsB|jjdd�}tjtjt|�dg�}dd�tj|j	d��j
�D�S)N�bin�jsonschema_suite�remotescSs"i|]\}}|d|jdd��qS)zhttp://localhost:1234/�\�/)�replace)�.0�name�schemarrr�
<dictcomp>0sz"Suite._remotes.<locals>.<dictcomp>zutf-8)�_root�joinpath�
subprocess�check_output�sys�
executable�strr�loads�decode�items)�selfrrrrr�_remotes+s
zSuite._remotescCs0x*tj�D]\}}|j|d�j||d�q
WdS)N)r)�runner�	Validator)rr(�version�	benchmark)r)r+rr,rrrr.5szSuite.benchmarkcCst||jjd|�|j�d�S)N�tests)r�pathr)�Versionrr r*)r)rrrrr-<sz
Suite.versionN)�__name__�
__module__�__qualname__�attr�ibZFactoryrrr*r.r-rrrrr&s
rc@sTeZdZej�Zej�Zej�Zdd�Zdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
S)r1cKs<x6|j�D]*}x$|D]}|j|jt|jf|��qWq
WdS)N)r/Z
bench_func�fully_qualified_namer�validate_ignoring_errors)r)r+�kwargs�suite�testrrrr.Ls

zVersion.benchmarkcs�fdd��jjd�D�S)Nc3s0|](}�j|jdd�|d�D]
}|VqqdS)N�)�subjectr0���)�	_tests_inr)r�childr;)r)rr�	<genexpr>Vsz Version.tests.<locals>.<genexpr>z*.json)�_path�glob)r)r)r)rr/Ts
z
Version.testscs&�jjdd�}�fdd�|jd�D�S)N�optional�formatc3s0|](}�j|jdd�|d�D]
}|VqqdS)Nr<)r=r0r>)r?r)rr@r;)r)rrrAasz'Version.format_tests.<locals>.<genexpr>z*.json)rBr rC)r)r0r)r)r�format_tests^s
zVersion.format_testscCs|j||jjd|d�d�S)NrDz.json)r=r0)r?rBr )r)rrrr�optional_tests_ofiszVersion.optional_tests_ofcsf�jdd|jj�jdd��}�fdd�|D�}t|tjf|�}yt�|_Wnt	k
r`YnX|S)NrZTest�-�cs0i|](}|D]}|D]}|jf��|j�qqqSr)�to_unittest_method�method_name)rr:r/r;)r9rrrqsz0Version.to_unittest_testcase.<locals>.<dictcomp>)
�popr�titler�type�unittestZTestCase�)_someone_save_us_the_module_of_the_callerr3�	Exception)r)Zsuitesr9r�methods�clsr)r9r�to_unittest_testcaseos
zVersion.to_unittest_testcasec#s<x6tj|jdd��D] ����fdd��dD�VqWdS)Nzutf-8)�encodingc	3s2|]*}tf���d�d�jd�|��VqdS)�descriptionr)r-r=�case_descriptionrrN)�_Testr*)rr;)�eachr)r=rrrA�sz$Version._tests_in.<locals>.<genexpr>r/)rr&Z	read_text)r)r=r0r)rYr)r=rr?�szVersion._tests_inN)r2r3r4r5r6rBr*rr.r/rFrGrTr?rrrrr1Ds
r1F)r�reprc@s�eZdZej�Zej�Zej�Zej�Zej�Z	ejdd�Z
ej�Zej�Zejdd�Z
dd�Zedd��Zed	d
��Zdd�fd
d�Zdd�Zdd�ZdS)rXF)rZN)rcCsdj|j�S)Nz	<Test {}>)rEr7)r)rrr�__repr__�sz_Test.__repr__cCsdj|jj|j|j|jg�S)Nz > )�joinr-rr=rWrV)r)rrrr7�s
z_Test.fully_qualified_namecCs6d}djtj|d|j�tj|d|j�tj|d|j��S)Nz[\W\- ]+z
test_{}_{}_{}�_)rE�re�subr=rWrV)r)�
delimitersrrrrK�s
z_Test.method_namecCsdS)Nr)r;rrr�<lambda>�sz_Test.<lambda>csH�jr��fdd�}n��fdd�}�j|_|��}tj|dk	|�|�S)Ncs�jf��dS)N)�validate)�this)r9r)rr�fn�sz$_Test.to_unittest_method.<locals>.fnc
s(|jtj���jf��WdQRXdS)N)ZassertRaisesr	�ValidationErrorrb)rc)r9r)rrrd�s)�validrKr2rOZskipIf)r)�skipr9rd�reasonr)r9r)rrJ�sz_Test.to_unittest_methodcKs@tjj|j|j|jd�}|f|j|d�|��}|j|jd�dS)N)r�storeZid_of)r�resolver)�instance)r	ZRefResolverZfrom_schemarr*ZID_OFrb�data)r)r,r9rjZ	validatorrrrrb�s
z_Test.validatecCs,y|j|d�Wntjk
r&YnXdS)N)r,)rbr	re)r)r,rrrr8�sz_Test.validate_ignoring_errors)r2r3r4r5r6r-r=rWrVrlrrfr*�commentr[�propertyr7rKrJrbr8rrrrrX�s	
	rXcCstjd�jdS)a�
    The FQON of the module 2nd stack frames up from here.

    This is intended to allow us to dynamicallly return test case classes that
    are indistinguishable from being defined in the module that wants them.

    Otherwise, trial will mis-print the FQON, and copy pasting it won't re-run
    the class that really is running.

    Save us all, this is all so so so so so terrible.
    �r2)r#�	_getframe�	f_globalsrrrrrP�s
rP)�__doc__�	functoolsrZpathlibrrrr^r!r#rOr5Zjsonschema.validatorsrr	r�s�objectrr1rXrPrrrr�<module>s&LE

haha - 2025