File: //var/opt/nydus/ops/referencing/tests/__pycache__/test_referencing_suite.cpython-39.pyc
a
�,�h � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl ZG dd� de
�Zdejv rreejd �d Z
nee�jjjd Z
e
�� s�e� �e�e
�d
��� �Zej�ddd
� e
�d�D ��dd� �ZdS )� )�PathN)�Registry)�Unresolvablec @ s e Zd Zdd� ZdS )�
SuiteNotFoundc C s dS )Nz�Cannot find the referencing suite. Set the REFERENCING_SUITE environment variable to the path to the suite, or run the test suite from alongside a full checkout of the git repository.� )�selfr r �Y/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/referencing/tests/test_referencing_suite.py�__str__
s �zSuiteNotFound.__str__N)�__name__�
__module__�__qualname__r r r r r r s r ZREFERENCING_SUITE�testszsuite/testszspecifications.json� test_pathc C s* g | ]"}t j||jj� d |j� �d��qS )�-)�id)�pytest�param�parent�name�stem)�.0Zeachr r r �
<listcomp>! s �r z*/**/*.jsonc
s� t | �t�jd }tj�|�� t�| � � �}|d }t
� �� fdd�|d �� D ��}|d D �]4}|j
|d��� d| jv r�t�d� |j|�d d
�d�}|�d�r�t�t�� |�|d
� W d � n1 s�0 Y n�|�|d
�}|j|d k�sJ �|�d�}|�rv|j
||d��4 |j�|d
�}|j|d k�sHJ �W d � n1 �s^0 Y |�d�}�qW d � q`1 �s�0 Y q`d S )Nr �registryc 3 s | ]\}}|� � |�fV qd S )N)Zcreate_resource)r �uri�contents��
specificationr r � <genexpr>+ s �z)test_referencing_suite.<locals>.<genexpr>r
)�testZ
normalizationz+APIs need to change for proper URL support.�base_uri� )r �error�ref�target�then)r r$ )�DIALECT_IDS�relative_to�SUITE�parts�referencingZ
jsonschemaZspecification_with�json�loads� read_textr Zwith_resources�itemsr r r Zxfail�resolver�getZraisesr �lookupr ) r ZsubtestsZ
dialect_id�loadedr r r. �resolvedr$ r r r �test_referencing_suite s.
�
.
4r3 )�pathlibr r* �osr r) r Zreferencing.exceptionsr Zreferencing.jsonschema� Exceptionr �environr'