%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jsonschema/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jsonschema/tests/__pycache__/_suite.cpython-312.pyc

�

`��dq��@�dZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlZd�Zej d��Gd	�d
e��Zej d��Gd�de��Zej dd
��Gd�de��Zd�Zy)z=
Python representations of the JSON Schema Test Suite tests.
�)�partial)�PathN)�_VALIDATORSc���tjjd�}|�t|�Sttj
�jjdz}|j�std��|S)N�JSON_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)�roots �9/usr/lib/python3/dist-packages/jsonschema/tests/_suite.py�_find_suitersh��
�:�:�>�>�2�3�D����D�z���
�#�#�$�+�+�2�2�V�;�D��;�;�=�� �
�	
��K�T)�hashc�d�eZdZejej
e���Zd�Zd�Z	d�Z
y)�Suite��defaultc���|jjdd�}tjtj
t
|�dg�}tj|jd��S)N�bin�jsonschema_suite�remotes�utf-8)
�_root�joinpath�
subprocess�check_output�sys�
executable�strr�loads�decode)�selfrrs   r�_remoteszSuite._remotes+sX���:�:�.�.�u�6H�I���)�)�
�^�^�S�!1�2�I�>�
���z�z�'�.�.��1�2�2rc��tj�D](\}}|j|��j||���*y)N)�name)�runner�	Validator)r�items�version�	benchmark)r(r,r+r-s    rr0zSuite.benchmark2sB��*�0�0�2�	�O�D�)��L�L�d�L�#�-�-��#�
.�
�	rc�n�t||jjd|�|j���S)N�tests)r+�pathr)�Versionrr r)�r(r+s  rr/z
Suite.version9s/�������$�$�W�d�3��M�M�O�
�	
rN)�__name__�
__module__�__qualname__�attr�ib�Factoryrrr)r0r/�rrrr&s.��
�D�G�G�L�D�L�L��5�6�E�3��
rrc��eZdZej�Zej�Zej�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
y)r4c
��|j�D]9}|D]2}|j|jt|jfi|����4�;y�N)r2�
bench_func�fully_qualified_namer�validate_ignoring_errors)r(r,�kwargs�suite�tests     rr0zVersion.benchmarkIsP���Z�Z�\�	�E��
���!�!��-�-��D�9�9�D�V�D��
�	rc�L���fd��jjd�D�S)Nc3�l�K�|]+}�j|jdd|��D]}|����-y�w�N�����subjectr3��	_tests_inr+��.0�childrEr(s   �r�	<genexpr>z Version.tests.<locals>.<genexpr>R�L�����
������
�
�3�B���'��
��
�
��
���14�*.json)�_path�glob�r(s`rr2z
Version.testsQs"���
�������2�
�	
rc�p���jjdd�}�fd�|jd�D�S)N�optional�formatc3�l�K�|]+}�j|jdd|��D]}|����-y�wrHrLrNs   �rrQz'Version.format_tests.<locals>.<genexpr>]rRrSrT)rUr rV)r(r3s` r�format_testszVersion.format_tests[s4����z�z�"�"�:�x�8��
����8�,�
�	
rc�b�|j||jjd|dz���S)NrYz.jsonrJ)rMrUr r5s  r�optional_tests_ofzVersion.optional_tests_offs3���~�~�����$�$�Z����@��
�	
rc
�~�|jdd|jj�jdd�z�}|D���cic]-}|D]&}|D]}|j|j
di|����!�(�/}}}}t
|tjf|�}	t�|_
|Scc}}}w#t$rY|SwxYw)Nr+�Test�-�r<)�popr+�title�replace�method_name�to_unittest_method�type�unittest�TestCase�)_someone_save_us_the_module_of_the_callerr7�	Exception)	r(�suitesrCr+rDr2rE�methods�clss	         r�to_unittest_testcasezVersion.to_unittest_testcasels����z�z�&�&�4�9�9�?�?�+<�+D�+D�S�"�+M�"M�N�� �
�
���
���	
��
���5�d�5�5�?��?�?�
��
��
��
��4�(�+�+�-�w�7��	�F�H�C�N��
��!
���	�
��
�
	�s�2B(�B/�/	B<�;B<c#����K�tj|jd���D]����fd��dD����y�w)Nr)�encodingc
3�`�K�|]%}td���d�d�jd�|�����'y�w)�description�schema)r/rK�case_descriptionrurNr<)�_Testr))rOrE�eachr(rKs  ���rrQz$Version._tests_in.<locals>.<genexpr>�sK�����	���� �#�%)�-�%8���>� �M�M���
�	�s�+.r2)rr&�	read_text)r(rKr3rxs`` @rrMzVersion._tests_in�sB������J�J�t�~�~�w�~�?�@�
	�D�	�#�7�m�	�	
�
	�s�>AN)r6r7r8r9r:rUr)r+r0r2r\r^rprMr<rrr4r4AsI��
�D�G�G�I�E��t�w�w�y�H��4�7�7�9�D��
�	
�
��(rr4F)r�reprc��eZdZej�Zej�Zej�Zej�Zej�Z	ejd��Z
ej�Zej�Zejd��Z
d�Zed��Zed��Zd�fd	�Zd
�Zd�Zy)rwF)rzNrc�8�dj|j�S)Nz	<Test {}>)rZrArWs r�__repr__z_Test.__repr__�s���!�!�$�";�";�<�<rc��dj|jj|j|j|j
g�S)Nz > )�joinr/r+rKrvrtrWs rrAz_Test.fully_qualified_name�s>���z�z����!�!�����%�%�� � �	
�
�	
rc	���d}djtj|d|j�tj|d|j�tj|d|j
��S)Nz[\W\- ]+z
test_{}_{}_{}�_)rZ�re�subrKrvrt)r(�
delimiterss  rrfz_Test.method_name�sZ�� �
��%�%��F�F�:�s�D�L�L�1��F�F�:�s�D�$9�$9�:��F�F�:�s�D�$4�$4�5�
�	
rc��yr?r<)rEs r�<lambda>z_Test.<lambda>�s�rc�����jr��fd�}n��fd�}�j|_|��}|�|Stjjdd�dk7rt
j|�St
j|�|�S)Nc�*���jdi���y�Nr<)�validate��thisrCr(s ��r�fnz$_Test.to_unittest_method.<locals>.fn�s�����
�
�'��'rc���|jtj�5�jdi���ddd�y#1swYyxYwr�)�assertRaisesr�ValidationErrorr�r�s ��rr�z$_Test.to_unittest_method.<locals>.fn�s=����&�&�z�'A�'A�B�,�!�D�M�M�+�F�+�,�,�,�s	�=�A�JSON_SCHEMA_EXPECTED_FAILURES�0)	�validrfr6r	r
rri�expectedFailure�skip)r(r�rCr��reasons` `  rrgz_Test.to_unittest_method�su����:�:�
(�
,��&�&����d����>��I�
�Z�Z�^�^�;�S�
A�S�
H��+�+�B�/�/�(�8�=�=��(��,�,rc��|j|j�tjj	|j|j
|j��}d�}||_|d|j|d�|��}tjjdd�dk7r
t�|j|j��y)N)ru�store�id_ofc��td|����)NzTried to access the network: )�RuntimeError)�uris r�prevent_network_accessz._Test.validate.<locals>.prevent_network_access�s���!>�s�e�D�E�Er)ru�resolver�JSON_SCHEMA_DEBUGr�)�instancer<)�check_schemarur�RefResolver�from_schemar)�ID_OF�resolve_remoter	r
r�
breakpointr��data)r(r-rCr�r��	validators      rr�z_Test.validate�s������t�{�{�+��)�)�5�5��;�;��-�-��/�/�6�
��	F�"8����N�T�[�[�8�N�v�N�	�
�:�:�>�>�-�s�3�s�:��L����D�I�I��.rc�\�	|j|��y#tj$rYywxYw)N)r-)r�rr�)r(r-s  rrBz_Test.validate_ignoring_errors�s-��	��M�M�I�M�.���)�)�	��	�s��+�+)r6r7r8r9r:r/rKrvrtr�rur�r)�commentr}�propertyrArfrgr�rBr<rrrwrw�s����d�g�g�i�G��d�g�g�i�G��t�w�w�y���$�'�'�)�K��4�7�7�9�D�
�T�W�W�%�
 �F��D�G�G�I�E��t�w�w�y�H��d�g�g�d�#�G�=��
��
��
��
�'8�-�$/�(rrwc�F�tjd�jdS)a�
    The FQON of the module 2nd stack frames up from here.

    This is intended to allow us to dynamically 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.
    �r6)r#�	_getframe�	f_globalsr<rrrkrk�s���=�=���%�%�j�1�1r)�__doc__�	functoolsr�pathlibrrr	r�r!r#rir9�jsonschema.validatorsrrr�s�objectrr4rwrkr<rr�<module>r�s�������	�	��
���-���$����T��
�F�
��
�4����T��I�f�I��I�X����T���R�F�R��R�j
2r

Zerion Mini Shell 1.0