| Server IP : 88.99.149.37 / Your IP : 216.73.216.141 Web Server : nginx/1.31.2 System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64 User : muralimurth ( 1015) PHP Version : 8.4.23 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.12/site-packages/referencing/tests/__pycache__/ |
Upload File : |
�
�% g� � �` � d dl mZ d dlZd dlZd dlmZmZmZ d dlm Z d dl
mZ G d� d� Zy)� )� lru_cacheN)�Registry�Resource�
exceptions)�DRAFT202012)�to_cached_resourcec �$ � e Zd Zd� Zd� Zd� Zd� Zy)�TestToCachedResourcec �: �� ddi}t j |� g�t � �fd�� }t |�� }t j
|� }|j
d� }|j |k( sJ �|j
d� }|j |j u sJ �y )N�$schema�,https://json-schema.org/draft/2020-12/schemac �$ �� �j � S �N��pop��uri�stacks ��E/usr/lib/python3.12/site-packages/referencing/tests/test_retrieval.py�retrievezITestToCachedResource.test_it_caches_retrieved_resources.<locals>.retrieve � �� ��9�9�;�� �r �urn:example:schema��json�dumpsr r r �
from_contents�get_or_retrieve�value��self�contentsr �registry�expected�got�againr s @r �"test_it_caches_retrieved_resourcesz7TestToCachedResource.test_it_caches_retrieved_resources s� �� ��M�N�����H�%�&�� � � �
� � �X�.���)�)�(�3���&�&�';�<���y�y�H�$�$�$� �(�(�)=�>���{�{�c�i�i�'�'�'r c �L �� ddi}t j |� d d d� g�t d� �� �fd�� }t |�� }t j
|� }|j
d� }|j |k( sJ �|j
d� }|j |j u sJ �y ) Nr r
���c �8 � t j | d d d� � S )Nr* )r �loads)�ss r �<lambda>z9TestToCachedResource.test_custom_loader.<locals>.<lambda># s � �D�J�J�q��2��w�,?r )r, c �$ �� �j � S r r r s �r r z9TestToCachedResource.test_custom_loader.<locals>.retrieve# r r r r r r! s @r �test_custom_loaderz'TestToCachedResource.test_custom_loader s� �� ��M�N�����H�%�d��d�+�,�� �"?� @� �
A� � �X�.���)�)�(�3���&�&�';�<���y�y�H�$�$�$� �(�(�)=�>���{�{�c�i�i�'�'�'r c �V �� i }t j |� g�t t j �� �fd�� }t |�� }t j |� }|j
d� }|j |k( sJ �|j
d� }|j |j u sJ �y )N)r c �$ �� �j � S r r r s �r r z@TestToCachedResource.test_custom_from_contents.<locals>.retrieve6 r r r r )r r r r �create_resourcer r r r! s @r �test_custom_from_contentsz.TestToCachedResource.test_custom_from_contents2 s� �� ������H�%�&�� �+�*E�*E� F� �
G� � �X�.���.�.�x�8���&�&�';�<���y�y�H�$�$�$� �(�(�)=�>���{�{�c�i�i�'�'�'r c � �� ddi}t |d�� t |d�� t |d�� d���j � D ��ci c] \ }}|t j |� �� }}}t t d�� � � �fd
�� }t
|�� }|j d� }|j |d k( sJ �|j d� j |j u sJ �|j d� j |j u sJ �|j d
� }|j |d
k( sJ �|j d
� j |j u sJ �|j d
� j |j u sJ �|j d� }|j |d k( sJ �|j d� j |j u sJ �|j d� j |j u sJ �t j t j � 5 |j d� d d d � y c c}}w # 1 sw Y y xY w)Nr r
� )�foo� � )�
urn:example:1�
urn:example:2�
urn:example:3)�maxsize)�cachec �L �� t j �j | � � S r )r r r )r �mappings �r r z8TestToCachedResource.test_custom_cache.<locals>.retrieveR s �� ��:�:�g�k�k�#�.�/�/r r r: r; r<