$L i`ddlmZddlZddlZddlmZmZmZddlm Z ddl m Z GddZ y)) lru_cacheN)RegistryResource exceptions) DRAFT202012)to_cached_resourcec$eZdZdZdZdZdZy)TestToCachedResourcec:ddi}tj|gtfd}t|}t j |}|j d}|j|k(sJ|j d}|j|jusJy)N$schema,https://json-schema.org/draft/2020-12/schemac$jSNpopuristacks f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/referencing/tests/test_retrieval.pyretrievezITestToCachedResource.test_it_caches_retrieved_resources..retrieve99; rurn:example:schemajsondumpsrrr from_contentsget_or_retrievevalueselfcontentsrregistryexpectedgotagainrs @r"test_it_caches_retrieved_resourcesz7TestToCachedResource.test_it_caches_retrieved_resources sMNH%&     X.))(3&&';<yyH$$$(()=>{{cii'''rcLddi}tj|dddgtdfd}t|}t j |}|j d}|j|k(sJ|j d}|j|jusJy) Nr r c8tj|dddS)Nr*)rloads)ss rz9TestToCachedResource.test_custom_loader..#sDJJq2w,?r)r,c$jSrrrs rrz9TestToCachedResource.test_custom_loader..retrieve#rrrrrr!s @rtest_custom_loaderz'TestToCachedResource.test_custom_loadersMNH%dd+, "? @  A X.))(3&&';<yyH$$$(()=>{{cii'''rcVi}tj|gttjfd}t |}tj|}|j d}|j|k(sJ|j d}|j|jusJy)N)rc$jSrrrs rrz@TestToCachedResource.test_custom_from_contents..retrieve6rrrr)rrrrcreate_resourcerrr r!s @rtest_custom_from_contentsz.TestToCachedResource.test_custom_from_contents2sH%& +*E*E F  G X...x8&&';<yyH$$$(()=>{{cii'''rcddi}t|dt|dt|ddjDcic]\}}|tj|}}}t t d fd }t | }|jd }|j|d k(sJ|jd j|jusJ|jd j|jusJ|jd }|j|d k(sJ|jd j|jusJ|jd j|jusJ|jd}|j|dk(sJ|jdj|jusJ|jdj|jusJtjtj5|jd dddycc}}w#1swYyxYw)Nr r )foo) urn:example:1 urn:example:2 urn:example:3)maxsize)cachecLtjj|Sr)rrr)rmappings rrz8TestToCachedResource.test_custom_cache..retrieveRs::gkk#./ /rrr:r;r<) dictitemsrrrrrrr pytestraisesr Unretrievable) r"schemarr# resourcesrr$r&r@s @rtest_custom_cachez&TestToCachedResource.test_custom_cacheEs KL!&a0!&a0!&a0 ") X ''1 1  )A"6 7 0 8 0X.&&7yyIo6666''8>>#))KKK''8>>#))KKK&&7yyIo6666''8>>#))KKK''8>>#))KKK&&7yyIo6666''8>>#))KKK''8>>#))KKK]]:33 4 6  $ $_ 5 6 69 8 6 6s H0H66H?N)__name__ __module__ __qualname__r(r0r4rHrrr r s(&(&(&%6rr ) functoolsrrrC referencingrrrreferencing.jsonschemarreferencing.retrievalrr rLrrrQs& 66.4_6_6r