o
    3Ih	                     @   s   d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl	ZG dd de
Zdejv r9eejd d Zn	eejjjd	 Ze sIe eed
 Zejddd edD dd ZdS )    )PathN)Registry)Unresolvablec                   @   s   e Zd Zdd ZdS )SuiteNotFoundc                 C   s   	 dS )NzCannot 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   h/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/referencing/tests/test_referencing_suite.py__str__   s   zSuiteNotFound.__str__N)__name__
__module____qualname__r	   r   r   r   r   r      s    r   REFERENCING_SUITEtestszsuite/testszspecifications.json	test_pathc                 C   s*   g | ]}t j||jj d |j dqS )-)id)pytestparamparentnamestem).0eachr   r   r   
<listcomp>!   s    r   z*/**/*.jsonc           	   
      s  t | tjd  }tj| t| 	 }|d }t
  fdd|d  D }|d D ]}|j|d d| jv rCtd |j|d	d
d}|drott ||d  W d    n1 siw   Y  nF||d }|j|d ksJ |d}|r|j||d |j|d }|j|d ksJ W d    n1 sw   Y  |d}|sW d    n1 sw   Y  q0d S )Nr   registryc                 3   s"    | ]\}}|  |fV  qd S )N)create_resource)r   uricontentsspecificationr   r   	<genexpr>+   s
    
z)test_referencing_suite.<locals>.<genexpr>r   )testnormalizationz+APIs need to change for proper URL support.base_uri )r#   errorreftargetthen)r!   r(   )DIALECT_IDSrelative_toSUITEpartsreferencing
jsonschemaspecification_withjsonloads	read_textr   with_resourcesitemsr!   r   r   xfailresolvergetraisesr   lookupr   )	r   subtests
dialect_idloadedr   r!   r6   resolvedr(   r   r   r   test_referencing_suite   s>   





r>   )pathlibr   r0   osr   r-   r   referencing.exceptionsr   referencing.jsonschema	Exceptionr   environr+   __file__r   is_dirr1   joinpathr2   r)   markparametrizeglobr>   r   r   r   r   <module>   s*    

