+
     hޓ  c                   s0   ^ RI Ht ^ RIt^ RIHtHtHtHtHt ^ RI	H
t
 ]! RR R R R	 R
7      tR t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      t]P$                  P'                  R]]]]]P(                  .4      R 4       tR# )i    )HashTrieMapN)AnchorRegistryResourceSpecification
exceptions)DRAFT202012zid-and-childrenc                 s$    V P                  R 4      # )IDgetcontents   &@/usr/lib/python3.14/site-packages/referencing/tests/test_core.py<lambda>r   	   s    8<<-    c                 s&    V P                  R . 4      # )childrenr   r
   r   r   r   r   
   s    X\\*b%Ar   c                 s    VP                  R / 4      P                  4        UUu. uF"  w  r#\        VV P                  VR7      R7      NK$  	  upp# u uppi )anchorsr
   )nameresource)r	   Zitemsr   create_resource)specificationr   r   eachs   &&  r   r   r      sW    
 #,,y"5;;=0
 >JD	 	"22D2A	
 >0 0s   (Ac                 s    \        V 4      ^,          '       gZ   \        ;QJ d#    R V R,           4       F  '       d   K   RM	  RM! R V R,           4       4      '       d   VP                  V4      # T# )   c              3   s*   "   T F	  qR 8H  x  K  	  R# 5ir   N )Z.0r      & r   Z	<genexpr>Z<lambda>.<locals>.<genexpr>   s     =}t
"}s   :NNr   FT)ZlenZallin_subresourceZsegmentsresolverZsubresource   &&&r   r   r      sY    8}q  C=x}=CCC=x}=== 	, 	 	r   r   Zid_ofZsubresources_ofZ
anchors_inZmaybe_in_subresourcec                s    \        R4      h)zI
A retriever suitable for use in tests which expect it never to be used.
z2This retrieve function expects to never be called!)ZRuntimeErrorurir   r   blow_upr"      s     K
LLr   c                   s:  a  ] tR t^"t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2R0t3V t4R1# )2TestRegistryc                sp    \         P                  ! RR/R7      pRp\        4       P                  W!R7      pR# )zA
Adding a resource to the registry then allows re-retrieving it.
foobarr
   urn:exampler!   r   Nr   opaquer   with_resourceselfr   r!   registry   &   r   test_with_resourceZTestRegistry.test_with_resource#   s0    
 ??UEN;:+++Gr   c                s    \         P                  ! / R7      p\        RR/\        R7      p\        4       P	                  RV3RV3.4      pR# )zD
Adding multiple resources to the registry is like adding each one.
r
   r$   r%   r   r   http://example.com/1http://example.com/foo/barN)r   r)   ID_AND_CHILDRENr   with_resourcesr,   onetwor-   r.   r   test_with_resourcesZ TestRegistry.test_with_resources-   sI    
 oor*oN:,,'--s3
r   c                s^    R p\         P                  RVR^/4      pV\        4       ,          pR# )zurn:example:resourcer   r$   Nr3   r   r   r,   r!   r   r-   r.   r   test_matmul_resourceZ!TestRegistry.test_matmul_resourceB   s,    $"22D#ub3IJhj(r   c                s    R p\         P                  RVR^/4      pRp\         P                  RVR^/4      pW$.\        4       ,          pR# )zurn:example:oner   r$   zurn:example:twoNr9   )r,   Zone_urir6   Ztwo_urir7   r-      &     r   test_matmul_many_resourcesZ'TestRegistry.test_matmul_many_resourcesH   sL    #--tWeR.HI#--tWeR.HI:
*r   c                s    \         P                  ! R R/R7      p\        P                  ! \        P
                  4      ;_uu_ 4       pV\        4       ,           RRR4       R#   + '       g   i     R# ; ir$   r%   r
   N)r   r)   pytestraisesr   ZNoInternalIDr   )r,   r   e   &  r   test_matmul_resource_without_idZ,TestRegistry.test_matmul_resource_without_idT   sD    ??UEN;]]:2233qxz! 4333s   A""A3	c                sj    R pRR/p\        4       P                  W3.4      p\        V\        R7      pR# )r&   $schema,https://json-schema.org/draft/2020-12/schemar0   N)r   with_contentsr   r   )r,   r!   schemar-   expected   &    r   #test_with_contents_from_json_schemaZ0TestRegistry.test_with_contents_from_json_schemaZ   s4    KL:++c]O<V;Gr   c                sf    R p\        4       P                  VRR/3.\        P                  R7      pR# )r&   r$   r%   Zdefault_specificationN)r   rF   r   OPAQUE)r,   r!   r-   rB   r   ,test_with_contents_and_default_specificationZ9TestRegistry.test_with_contents_and_default_specificationb   s6    :++E5>"#"/"6"6 , 
r   c                s    ^p\        4       P                  \        V4       Uu. uF  p\        V4      RR/3NK  	  up\        P
                  R7      pR# u upi )i   r$   r%   rK   Nr   rF   ZrangeZstrr   rL   )r,   Ztotalir-   r.   r   test_lenZTestRegistry.test_lenj   sM    :++/4U|<|!c!fuen%|<"/"6"6 , 
<s   Ac                    R # Nr   r,   r   r   test_bool_emptyZTestRegistry.test_bool_emptyr       r   c                s    \        4       P                  \        ^4       Uu. uF  p\        V4      RR/3NK  	  up\        P
                  R7      pR# u upi )i   r$   r%   rK   NrN   r,   rO   r-   rB   r   test_bool_not_emptyZ TestRegistry.test_bool_not_emptyu   H    :++/4Qx8x!c!fuen%x8"/"6"6 , 
8   Ac                s    \        4       P                  \        ^4       Uu. uF  p\        V4      RR/3NK  	  up\        P
                  R7      pR# u upi )   r$   r%   rK   NrN   rV   rB   r   	test_iterZTestRegistry.test_iter|   rX   rY   c                sn    \         P                  ! R R/4      pRp\        W!/4      P                  4       pR# r$   r%   r&   N)r   r)   r   crawlr+   r.   r   'test_crawl_still_has_top_level_resourceZ4TestRegistry.test_crawl_still_has_top_level_resource   s.    ??E5>2SO,224r   c           	     s&   R p\         P                  RRRRVR^/./4      pV\        4       ,          p\        P                  ! \
        4      ;_uu_ 4        W1,           RRR4       \         P                  RVR^/4      pR#   + '       g   i     L+; i)	urn:childr   urn:rootr   r$   N)r3   r   r   r?   r@   ZLookupError)r,   Zchild_idrootr-   rH   rI   r   test_crawl_finds_a_subresourceZ+TestRegistry.test_crawl_finds_a_subresource   s{    ..:zT8UB,G+HI
 (*$]];'' ( #22D(E23NO ('s   	B  B	c                s^    \         P                  R RRR^//4      pV\        4       ,          pR# )r   urn:barr   r$   Nr9   r,   r   r-   rB   r    test_crawl_finds_anchors_with_idZ-TestRegistry.test_crawl_finds_anchors_with_id   s0    "229i%5
 hj(r   c                sl    \         P                  R R^//4      p\        4       P                  RV4      pR# )r   r$   r`   N)r3   r   r   r*   rd   rB   r   test_crawl_finds_anchors_no_idZ+TestRegistry.test_crawl_finds_anchors_no_id   s/    "22Ir{3KL:++JAr   c                sl    \         P                  ! R R/4      pRp\        4       P                  W!4      pR# r\   r(   r+   r.   r   test_contentsZTestRegistry.test_contents   s+    ??E5>2:++C:r   c                h    R p\         P                  RVR,           /4      pV\        4       ,          pR# http://example.com/r   #Nr9   r:   r.   r   #test_getitem_strips_empty_fragmentsZ0TestRegistry.test_getitem_strips_empty_fragments   ,    #"22D#)3DEhj(r   c                rh   ri   r9   r:   r.   r   $test_contents_strips_empty_fragmentsZ1TestRegistry.test_contents_strips_empty_fragments   rm   r   c                s    \        4       p\        P                  ! \        P                  4      ;_uu_ 4       pVP                  R 4       RRR4       R#   + '       g   i     R# ; i)r&   N)r   r?   r@   r   NoSuchResourcer   r,   r-   rA   rB   r   "test_contents_nonexistent_resourceZ/TestRegistry.test_contents_nonexistent_resource   s=    :]]:4455m, 6555s   AA$	c                s    \         P                  R RR//4      p\        4       P                  RV4      pVP	                  RR4      pR# )r   r$   r%   r&   N)r3   r   r   r*   anchor)r,   r   r-   Z	retrievedr.   r   test_crawled_anchorZ TestRegistry.test_crawled_anchor   s?    "22Iu~3NO:++M8DOOM59	r   c                s    \        4       p\        P                  ! \        P                  4      ;_uu_ 4       pVP                  R R4       RRR4       R#   + '       g   i     R# ; i)r&   r$   N)r   r?   r@   r   ro   rr   rp   rB   r   #test_anchor_in_nonexistent_resourceZ0TestRegistry.test_anchor_in_nonexistent_resource   s=    :]]:4455OOM51 6555s   AA%	c                    \         P                  ! / R 7      p\        P                  RR/4      p\	        RVRV/4      pR# r
   r$   r%   r1   r2   Nr   r)   r3   r   r   r5   r.   r   	test_initZTestRegistry.test_init   s=    oor*--uen=&,c
r   c                s    \         P                  ! / R7      p\        P                  RR/4      p\	        RV/4      P                  RV4      pR# )zm
Passing a `dict` to `Registry` gets converted to a `HashTrieMap`.

So continuing to use the registry works.
r
   r$   r%   r1   r2   Nr   r)   r3   r   r   r*   r5   r.   r   test_dict_conversionZ!TestRegistry.test_dict_conversion   sH     oor*--uen=#S)

-4c
: 	r   c                s    \        4       p\        P                  ! \        P                  4      ;_uu_ 4       pVR ,           RRR4       R#   + '       g   i     R# ; i)zurn:bigboomN)r   r?   r@   r   ro   rp   rB   r   test_no_such_resourceZ"TestRegistry.test_no_such_resource  s7    :]]:4455]# 6555s   
AA	c                s~   \         P                  ! / R 7      p\        P                  RR/4      p\        P                  RR/4      p\        P                  RR^//4      p\	        RV/4      p\	        4       P                  RV4      p\	        RVRV/4      p\	        4       P                  R	V4      P                  4       pR
# )r
   r$   r%   bazquuxr   r1   r2   http://example.com/bazzhttp://example.com/foo/quuxN)r   r)   r3   r   r   r*   r]   )	r,   r6   r7   threeZfourfirstsecondthirdfourth	   &        r   test_combineZTestRegistry.test_combine  s    oor*--uen=//@..	E2;/GH0#67))*FL&(%
 J]- UW 	r   c                s     \        RR/4      pR# )z
Combining a registry with itself short-circuits.

This is a performance optimization -- otherwise we do lots more work
(in jsonschema this seems to correspond to making the test suite take
 *3x* longer).
urn:foor%   N)r   r,   r-   r   r   test_combine_selfZTestRegistry.test_combine_self.  s     Y./r   c                s`   \         P                  ! / R 7      p\        P                  RR/4      p\        P                  RR/4      p\	        4       P                  RV4      p\	        4       P                  RV4      p\	        RVRV/4      p\	        RV3RV3RV3.4      pVP                  WV4      pR# )	r
   r$   r%   r|   r}   r1   r2   r~   N)r   r)   r3   r   r   r*   combine)	r,   r6   r7   r   r   r   r   rH   Zcombinedr   r   %test_combine_with_uncrawled_resourcesZ2TestRegistry.test_combine_with_uncrawled_resources:  s    oor*--uen=//@
(()?E))*FL&(%
 '--s3)51
 ==/r   c                s6   \         P                  ! / R 7      p\        P                  RR/4      p\        P                  RR/4      pR p\	        4       P                  RV4      p\	        VR7      P                  RV4      p\	        4       P                  R	V4      pR
# )r
   r$   r%   r|   r}   c                 rQ   rR   r   r    r   r   retrieveZ@TestRegistry.test_combine_with_single_retrieve.<locals>.retrieveW      r   r1   r   http://example.com/2http://example.com/3Nry   r,   r6   r7   r   r   r   r   r      &       r   !test_combine_with_single_retrieveZ.TestRegistry.test_combine_with_single_retrieveR  s    oor*--uen=//@	 
(()?E

-.
4 	 
(()?Gr   c                s>   \         P                  ! / R 7      p\        P                  RR/4      p\        P                  RR/4      pR p\	        VR7      P                  RV4      p\	        VR7      P                  RV4      p\	        VR7      P                  R	V4      pR
# )r
   r$   r%   r|   r}   c                 rQ   rR   r   r    r   r   r   Z@TestRegistry.test_combine_with_common_retrieve.<locals>.retrievex  r   r   r   r1   r   r   Nry   r   r   r   !test_combine_with_common_retrieveZ.TestRegistry.test_combine_with_common_retrieves  s    oor*--uen=//@	 (+99"
 

-.
4 	 (+99"
r   c                s   \         P                  ! / R 7      p\        P                  RR/4      p\        P                  RR/4      pR pR p\	        VR7      P                  RV4      p\	        4       P                  R	V4      p\	        VR7      P                  R
V4      p\        P                  ! \        RR7      ;_uu_ 4        VP                  Wx4       RRR4       R#   + '       g   i     R# ; i)r
   r$   r%   r|   r}   c                 rQ   rR   r   r    r   r   foo_retrieveZDTestRegistry.test_combine_conflicting_retrieve.<locals>.foo_retrieve  r   r   c                 rQ   rR   r   r    r   r   bar_retrieveZDTestRegistry.test_combine_conflicting_retrieve.<locals>.bar_retrieve  r   r   r   r1   r   r   zconflict.*retrievZmatchN)
r   r)   r3   r   r   r*   r?   r@   	Exceptionr   )	r,   r6   r7   r   r   r   r   r   r   r   r   !test_combine_conflicting_retrieveZ.TestRegistry.test_combine_conflicting_retrieve  s    oor*--uen=//@		 ,/=="
 ))*@#F,/=="

 ]]9,?@@MM&( A@@@s   CC/	c                ru   r
   r$   r%   r   rc   Nrw   r5   r.   r   test_removeZTestRegistry.test_remove  s7    oor*--uen=YY<=r   c                    \         P                  ! / R 7      p\        P                  RR/4      p\	        4       P                  RV3RV3.4      pR# r   r   r)   r3   r   r   r4   r5   r.   r   test_remove_uncrawledZ"TestRegistry.test_remove_uncrawled  sH    oor*--uen=:,,	3/0
r   c                s    \         P                  ! / R 7      p\        P                  RRR//4      p\	        4       P                  RV3RV3.4      P                  4       pR# )r
   r   r$   r%   r   rc   N)r   r)   r3   r   r   r4   r]   r5   r.   r   test_remove_with_anchorsZ%TestRegistry.test_remove_with_anchors  sX    oor*--y5%..IJJ^S!Is#34 UW 	r   c                s    \         P                  ! \        P                  4      ;_uu_ 4       p\	        4       P                  R 4       RRR4       R#   + '       g   i     R# ; i)zurn:doesNotExistN)r?   r@   r   ro   r   Zremove)r,   rA   r   r   test_remove_nonexistent_uriZ(TestRegistry.test_remove_nonexistent_uri  s9    ]]:4455J01 6555s   AA"	c                sX   a \         P                  ! R R/4      o\        V3R lR7      pR# )r$   r%   c                    < S# rR   r   r!   r$      &r   r   Z,TestRegistry.test_retrieve.<locals>.<lambda>  s    r   r   N)r   r)   r   )r,   r-   r$   s   & @r   test_retrieveZTestRegistry.test_retrieve  s    oouen-_5r   c                  a \         P                  ! R R/4      oV3R lp\        VR7      p\        P                  ! \
        P                  4      ;_uu_ 4        VP                  R4       RRR4       R#   + '       g   i     R# ; i)r$   r%   c                 s,   < V R 8X  d   S# \        R4      h)urn:succeedzOh no!)r   r   r   r   r   Z@TestRegistry.test_retrieve_arbitrary_exception.<locals>.retrieve  s    m#
H%%r   r   urn:uhohN)r   r)   r   r?   r@   r   Unretrievableget_or_retriever,   r   r-   r$      &  @r   !test_retrieve_arbitrary_exceptionZ.TestRegistry.test_retrieve_arbitrary_exception  sX    oouen-	&
 X.]]:3344$$Z0 5444   A44B	c                r   )r$   r%   c                 sD   < V R 8X  d   S# \         P                  ! V R7      h)r   )ref)r   ro   r   r   r   r   Z=TestRegistry.test_retrieve_no_such_resource.<locals>.retrieve  s!    m#
++44r   r   r   N)r   r)   r   r?   r@   r   ro   r   r   r   r   test_retrieve_no_such_resourceZ+TestRegistry.test_retrieve_no_such_resource  sX    oouen-	5
 X.]]:4455$$Z0 6555r   c                s    R  p\        VR7      p\        P                  ! \        P                  4      ;_uu_ 4        VP                  R4       RRR4       R#   + '       g   i     R# ; i)c                 s.    \         P                  ! / 4      # rR   r   from_contentsr    r   r   r   ZKTestRegistry.test_retrieve_cannot_determine_specification.<locals>.retrieve  s    ))"--r   r   r   N)r   r?   r@   r   CannotDetermineSpecificationr   )r,   r   r-   rB   r   ,test_retrieve_cannot_determine_specificationZ9TestRegistry.test_retrieve_cannot_determine_specification  sF    	. X.]]:BBCC$$Z0 DCCCs   AA)	c                s\    \         P                  ! R R/4      p\        RV/\        R7      pR# )r$   r%   r&   r   N)r   r)   r   r"   )r,   r$   r-   rB   r   (test_retrieve_already_available_resourceZ5TestRegistry.test_retrieve_already_available_resource  s%    oouen-]C07Cr   c                s    \         P                  R RR^/4      p\         P                  RVP                  ./4      p\        \        R7      P                  RV4      pR# )r   r_   r$   r   r   r`   N)r3   r   r   r   r"   r*   )r,   Zchildra   r-   r.   r   -test_retrieve_first_checks_crawlable_resourceZ:TestRegistry.test_retrieve_first_checks_crawlable_resource	  sN    //{E20NO..
U^^<L/MNW-;;JMr   c                sr    \         P                  ! / R 7      p\        RV/4      pVP                  RR7      pR# )r
   http://example.com)Zbase_uriNr   r)   r   r   )r,   r6   r-   r   r.   r   test_resolverZTestRegistry.test_resolver  s4    oor*1378$$.B$Cr   c                sf    \         P                  R R/4      p\        4       P                  V4      pR# )r   r   N)r3   r   r   resolver_with_rootr,   ra   r   rB   r   "test_resolver_with_root_identifiedZ/TestRegistry.test_resolver_with_root_identified  s*    ..6J/KL:006r   c                sf    \         P                  ! / R 7      p\        4       P                  V4      pR# )r
   N)r   r)   r   r   r   rB   r   $test_resolver_with_root_unidentifiedZ1TestRegistry.test_resolver_with_root_unidentified  s"    +:006r   c                r   rv   r   r5   r.   r   	test_reprZTestRegistry.test_repr   sK    oor*--uen=:,,'--s3
r   c                s    \         P                  ! / R 7      p\        P                  RR/4      p\	        RV/4      P                  4       P                  RVR7      pR# )r
   r$   r%   r1   r2   r'   N)r   r)   r3   r   r   r]   r*   r5   r.   r   test_repr_mixed_crawledZ$TestRegistry.test_repr_mixed_crawled,  sQ    oor*--uen='- UW];c]J 	r   c                sf    \        4       P                  R \        P                  ! / R7      R7      pR# )r1   r
   r'   N)r   r*   r   r)   r   r   r   test_repr_one_resourceZ#TestRegistry.test_repr_one_resource8  s(    :++&__b1 , 
r   c                rQ   rR   r   rS   r   r   test_repr_emptyZTestRegistry.test_repr_empty?  rU   r   r   N)5__name__
__module____qualname____firstlineno__r/   r8   r;   r=   rC   rJ   rM   rP   rT   rW   r[   r^   rb   re   rf   rg   rl   rn   rq   rs   rt   rx   rz   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__Z__classdict__   @r   r#   r#   "   s    )
*C

E)@&;)
6	

8@
G6G
*
0G$;L
6,0
B%
N)0H	

(L
D
111D63>>

D
IE> >r   r#   c                   sz   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tRtV tR# )TestResourceiC  c                :    R R/p\         P                  ! V4      pR# rD   rE   Nr   r,   rG   r   rB   r   #test_from_contents_from_json_schemaZ0TestResource.test_from_contents_from_json_schemaD  s    KL))&1r   c                s    \         P                  ! \        P                  4      ;_uu_ 4        \        P
                  ! RR/4       RRR4       R#   + '       g   i     R# ; i)z
Creating a resource with no discernible way to see what
specification it belongs to (e.g. no ``$schema`` keyword for JSON
Schema) raises an error.
r$   r%   N)r?   r@   r   r   r   r   rS   r   r   2test_from_contents_with_no_discernible_informationZ?TestResource.test_from_contents_with_no_discernible_informationI  s;     ]]:BBCC""E5>2 DCCC   AA!	c                V    \         P                  ! R R/\        P                  R7      pR# r$   r%   rK   Nr   r   r   rL   r,   r   r   r   >test_from_contents_with_no_discernible_information_and_defaultZKTestResource.test_from_contents_with_no_discernible_information_and_defaultS  "    ))EN"/"6"6
r   c                sZ    R R/p\         P                  ! V\        P                  R7      pR# )rD   rE   rK   Nr   r   rB   r   #test_from_contents_unneeded_defaultZ0TestResource.test_from_contents_unneeded_defaultZ  s)    KL))"/"6"6
r   c                s>    \         P                  ! R \        R7      pR# )TrK   N)r   r   r3   r   r   r   test_non_mapping_from_contentsZ+TestResource.test_non_mapping_from_contentse  s    ))"1
r   c                r   r   r   r   r   r    test_from_contents_with_fallbackZ-TestResource.test_from_contents_with_fallbacko  r   r   c                sL    \        R R R R R R7      p\        RR/VR7      pR	# )
 c                 rQ   zurn:fixedIDr   r
   r   r   r   ATestResource.test_id_delegates_to_specification.<locals>.<lambda>y      =r   c                     . # rR   r   r
   r   r   r   r   z      Rr   c                 r   rR   r   r   r      &&r   r   r   {      rr   c                     V# rR   r   r   r   r   r   r   }      r   r   r$   r|   r0   N)r   r   r,   r   r   rB   r   "test_id_delegates_to_specificationZ/TestResource.test_id_delegates_to_specificationv  s1    %0/9@
 U^'
r   c                sF    R p\         P                  RVR,           /4      pR# ri   r3   r   )r,   r!   ra   rB   r   test_id_strips_empty_fragmentZ*TestResource.test_id_strips_empty_fragment  s     #..cCi/@Ar   c                s8    \         P                  R / ^./4      pR# r   r   r   r   r   ,test_subresources_delegates_to_specificationZ9TestResource.test_subresources_delegates_to_specification  s    "22JR3IJr   c                s>    R R/p\         P                  RV./4      pR# )rD   rE   r   Nr   r   rB   r   -test_subresource_with_different_specificationZ:TestResource.test_subresource_with_different_specification  s$    KL"22J3IJr   c           	     s@    \         P                  R R/ R^RR//4      pR# )r   r$   r%   r|   r   Nr   r   r   r   'test_anchors_delegates_to_specificationZ4TestResource.test_anchors_delegates_to_specification  s'    "22E1eR89
r   c                sh    \         P                  ! R R/R7      p\        4       P                  4       pR# r$   r|   r
   Nr   r,   r   r   rB   r   test_pointer_to_mappingZ$TestResource.test_pointer_to_mapping  s$    ??UEN;:&&(r   c                sn    \         P                  ! R R^.//R7      p\        4       P                  4       pR# r>   r   r   rB   r   test_pointer_to_arrayZ"TestResource.test_pointer_to_array  s+    ??UUQCL,AB:&&(r   c                sl    R R/p\         P                  ! VR7      p\        4       P                  4       pR# r   r   )r,   r   r   r   r.   r   test_root_pointerZTestResource.test_root_pointer  s)    5>??H5:&&(r   c                s    R R/pR# r$   r%   Nr   )r,   r   r   r   test_opaqueZTestResource.test_opaque  s    5>r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   C  s[     P
3D	

D.  



M
O
L
 
r   r   c                   s   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tRtV tR# )TestResolveri  c                s    \         P                  ! R R/R7      p\        RV/4      P                  4       pVP	                  R4      pR# )r$   r|   r
   r1   Nr   r)   r   r   lookup)r,   r   r   resolvedr.   r   test_lookup_exact_uriZ"TestResolver.test_lookup_exact_uri  s<    ??UEN;3X>?HHJ??#9:r   c           	     s    \         P                  R RRR RR^/./4      pV\        4       ,          pVP                  4       P	                  R4      pR# )r   rj   r   zhttp://example.com/ar$   Nr3   r   r   r   r   r,   ra   r-   r   r.   r   test_lookup_subresourceZ$TestResolver.test_lookup_subresource  sZ    ..+15"=
 (*$$$&--.DEr   c                s    \         P                  R RRR^//4      pV\        4       ,          pVP                  4       P	                  R4      pR# )r   rj   r   r$   zhttp://example.com/#fooNr   r   r.   r   test_lookup_anchor_with_idZ'TestResolver.test_lookup_anchor_with_id  sN    ..+E2;
 (*$$$&--.GHr   c                s    \         P                  R R^//4      p\        4       P                  RV4      P	                  4       pVP                  R4      pR# )r   r$   r&   zurn:example#fooN)r3   r   r   r*   r   r   )r,   ra   r   r   r.   r   test_lookup_anchor_without_idZ*TestResolver.test_lookup_anchor_without_id  sG    ..	E2;/GH:++M4@IIK??#45r   c                s    \        4       P                  4       pR p\        P                  ! \        P
                  4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i)z!http://example.com/does/not/existN)r   r   r?   r@   r   Unresolvabler   )r,   r   r   rA   r.   r   test_lookup_unknown_referenceZ*TestResolver.test_lookup_unknown_reference  sI    :&&(1]]:2233qOOC  4333s   A##A4	c                s$   \         P                  ! R / /4      p\        RV/4      P                  4       pRp\        P
                  ! \        P                  4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i)r$   r1   zhttp://example.com/1#/foo/barN	r   r)   r   r   r?   r@   r   r   r   r,   r   r   r   rA   rI   r    test_lookup_non_existent_pointerZ-TestResolver.test_lookup_non_existent_pointer  sd    ??E2;/3X>?HHJ-]]:2233qOOC  4333   "A>>B	c                s$   \         P                  ! . RO4      p\        RV/4      P                  4       pRp\        P
                  ! \        P                  4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i)   r1   zhttp://example.com/1#/10N)r  r   i   rZ   r   r   rI   r   /test_lookup_non_existent_pointer_to_array_indexZ<TestResolver.test_lookup_non_existent_pointer_to_array_index  s`    ??<03X>?HHJ(]]:2233qOOC  4333r   c                sd    \        4       P                  \        P                  ! R / /4      4      pR# )r   N)r   r   r   r)   )r,   r   r   r   #test_lookup_pointer_to_empty_stringZ0TestResolver.test_lookup_pointer_to_empty_string  s!    :00"b1JKr   c                s    \         P                  ! R / /4      p\        4       P                  V4      p\        P
                  ! \        P                  RR7      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     R# ; i)r$   z+^'/' does not exist within {'foo': {}}.*'#'r   z#/N)	r   r)   r   r   r?   r@   r   r   r   )r,   r   r   rA   r.   r   0test_lookup_non_existent_pointer_to_empty_stringZ=TestResolver.test_lookup_non_existent_pointer_to_empty_string  si    ??E2;/:00:]]##?
 
 OOD!	
 
 
 
s    A<<B	c                s^   \         P                  R / /4      p\        4       P                  RV4      P	                  4       pVP                  R4      pRp\        P                  ! \        P                  4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i)r   r&   zurn:example#noSuchAnchorN)
r3   r   r   r*   r   r   r?   r@   r   r   )r,   ra   r   r   r   rA   r<   r   test_lookup_non_existent_anchorZ,TestResolver.test_lookup_non_existent_anchor  sz    ..	2?:++M4@IIK??=1 )]]:2233qOOC  4333s   ?BB,	c           	     s@   \        4       P                  \        P                  R RRR^//4      4      pVP	                  R4      p\
        P                  ! \        P                  4      ;_uu_ 4       pVP	                  R4       RRR4       R#   + '       g   i     R# ; i)r   rj   r$   r%   z	#/foo/barz#foo/barN)	r   r   r3   r   r   r?   r@   r   ZInvalidAnchor)r,   r   ZvalidrA   r.   r   *test_lookup_invalid_JSON_pointerish_anchorZ7TestResolver.test_lookup_invalid_JSON_pointerish_anchor  sz    :00++/E2;
 , ]]:3344OOJ' 5444s   0BB	c                s   a \         P                  ! R R/R7      o\        V3R lR7      P                  4       pVP	                  R4      pR# )r$   r|   r
   c                 r   rR   r   r'   r   r   r   Z=TestResolver.test_lookup_retrieved_resource.<locals>.<lambda>1  s    r   r   rj   Nr   )r,   r   r   r   r   r   test_lookup_retrieved_resourceZ+TestResolver.test_lookup_retrieved_resource/  s8    ??UEN;%9:CCE??#89r   c                s   Rp\        \        R7      p\        P                  ! \        P
                  4      ;_uu_ 4        VP                  V4       RRR4       VP                  4       p\        P                  ! \        P                  4      ;_uu_ 4        VP                  V4       RRR4       R#   + '       g   i     Lh; i  + '       g   i     R# ; i)z<
Unretrievable exceptions are also wrapped in Unresolvable.
rj   r   N)
r   r"   r?   r@   r   r   r   r   r   r   )r,   r!   r-   r   r.   r   %test_lookup_failed_retrieved_resourceZ2TestResolver.test_lookup_failed_retrieved_resource5  s    
 $W-]]:3344$$S) 5 $$&]]:2233OOC  43	 54 433s   B1C1C	C	c                s   a \         P                  ! RR/R7      pV.oV3R lp\        VR7      P                  4       pVP	                  R4      pVP                  P	                  R4      pR# )zS
A (custom-)retrieved resource is added to the registry returned by
looking it up.
r$   r|   r
   c                 $   < SP                  4       # rR   Zpopr!   oncer   r   r   ZKTestResolver.test_repeated_lookup_from_retrieved_resource.<locals>.retrieveL      88:r   r   rj   Nr   r,   r   r   r   r   r     &    @r   ,test_repeated_lookup_from_retrieved_resourceZ9TestResolver.test_repeated_lookup_from_retrieved_resourceD  s`    
 ??UEN;z	 X.779??#89 $$++,ABr   c                s   a \         P                  ! R R/R7      pV.oV3R lp\        VR7      P                  4       pVP	                  R4      pVP                  P	                  R4      pR# )r$   r|   r
   c                 r	  rR   r
  r  r   r   r   ZRTestResolver.test_repeated_anchor_lookup_from_retrieved_resource.<locals>.retrieveZ  r  r   r   rj   rk   Nr   r  r  r   3test_repeated_anchor_lookup_from_retrieved_resourceZ@TestResolver.test_repeated_anchor_lookup_from_retrieved_resourceV  s]    ??UEN;z	 X.779??#89 $$++C0r   c           
     s    \         P                  R RRR RRR R/././4      pV\        4       ,          pVP                  4       pVP	                  R4      p\
        P                  ! \        P                  4      ;_uu_ 4        VP                  P	                  R4       RRR4       VP                  P                  \         P                  VP                  R,          ^ ,          4      4      pVP	                  R4      pR#   + '       g   i     Li; i)r   rj   r   child/
grandchildN)r3   r   r   r   r   r?   r@   r   r   r   r   )r,   ra   r-   r   r   Zsubr      &      r   test_in_subresourceZ TestResolver.test_in_subresourceg  s    ..+h"dL%9$:

 (*$$$& 56 ]]:2233NN!!,/ 4 nn++++ENN:,Fq,IJ
 L) 43s    C==D	c           
     s   \         P                  R RRR RRR R/././4      pV\        4       ,          pVP                  4       pVP	                  R4      p\
        P                  ! \        P                  4      ;_uu_ 4        VP                  P	                  R4       RRR4       VP                  P	                  R4      pVP                  P	                  R4      pR#   + '       g   i     LH; i)r   rj   r   r  r  N#/children/0)	r3   r   r   r   r   r?   r@   r   r   )r,   ra   r-   r   r   r   r   r  r   test_in_pointer_subresourceZ(TestResolver.test_in_pointer_subresource  s    ..+h"dL%9$:

 (*$$$& 56 ]]:2233NN!!,/ 4 &&~6&&|4	 43s    CC,	c           
     s   \         P                  R RRR RRR R/././4      p\         P                  R RRR R/./4      pW.\        4       ,          pVP                  4       pVP	                  R4      pVP                  P	                  R4      pVP                  P	                  R4      pVP                  P	                  R4      pR# )	r   rj   r   r  r  zhttp://example.com/twoz
two-child/r  Nr   )	r,   r6   r7   r-   r   r   r   r   r   r   r   test_dynamic_scopeZTestResolver.test_dynamic_scope  s    --+h"dL%9$:

 --.dL12
 :
*$$& 56&&~6&&|4&&'?@r   r   N)r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   r   r   r     sf     6N	'';
N	
4

 ."6!6$6"7662%: %:r   r   c                   s\   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )TestSpecificationi  c                sV    \        R R R R R R7      pVP                  RR/R7      pR	# )
r   c                 rQ   r   r   r
   r   r   r   8TestSpecification.test_create_resource.<locals>.<lambda>  r   r   c                 r   rR   r   r
   r   r   r   r    r   r   c                 r   rR   r   r   r   r   r   r    r   r   c                 r   rR   r   r   r   r   r   r    r   r   r   r$   r|   r
   N)r   r   r   rB   r   test_create_resourceZ&TestSpecification.test_create_resource  s4    %0/9@
 !005%.0Ir   c                r   r   )r   detectr,   rG   r   rB   r   test_detect_from_json_schemaZ.TestSpecification.test_detect_from_json_schema  s    KL%,,V4r   c                s    \         P                  ! \        P                  4      ;_uu_ 4        \        P
                  ! R R/4       RRR4       R#   + '       g   i     R# ; ir   r?   r@   r   r   r   r  rS   r   r   +test_detect_with_no_discernible_informationZ=TestSpecification.test_detect_with_no_discernible_information  s9    ]]:BBCC  %0 DCCCr   c                s    \         P                  ! \        P                  4      ;_uu_ 4        \        P
                  ! R ^%/4       RRR4       R#   + '       g   i     R# ; i)rD   Nr  rS   r   r   test_detect_with_non_URI_schemaZ1TestSpecification.test_detect_with_non_URI_schema  s9    ]]:BBCC  )R1 DCCCr   c                H    \         P                  P                  R R/4      pR# r   r   rL   r  r,   r   r   r   7test_detect_with_no_discernible_information_and_defaultZITestSpecification.test_detect_with_no_discernible_information_and_default      %,,33UENCr   c                sL    R R/p\         P                  P                  V4      pR# r   r#  r  rB   r   test_detect_unneeded_defaultZ.TestSpecification.test_detect_unneeded_default  s#    KL%,,33F;r   c                s    \         P                  ! \        P                  4      ;_uu_ 4        \        P
                  ! R 4       RRR4       R#   + '       g   i     R# ; iTNr  rS   r   r   test_non_mapping_detectZ)TestSpecification.test_non_mapping_detect  s5    ]]:BBCC  & DCCCs   AA	c                s0    \         P                  R 4      pR# r(  )r3   r  r$  r   r   $test_non_mapping_detect_with_defaultZ6TestSpecification.test_non_mapping_detect_with_default  s    '..t4r   c                r"  r   r#  r$  r   r   test_detect_with_fallbackZ+TestSpecification.test_detect_with_fallback  r&  r   c                rQ   rR   r   rS   r   r   r   ZTestSpecification.test_repr  rU   r   r   N)r   r   r   r   r  r  r   r!  r%  r'  r)  r*  r+  r   r   r   r   r   r   r  r    s<     .",
125,
'05
 
r   r  c                   s  a  ] tR tRt o RR/R^%R]! 4       .t]P                  P                  R]4      R 4       t	]P                  P                  R]4      R 4       t
]P                  P                  R]4      R 4       tR	tV tR
# )TestOpaqueSpecificationi  r$   r%   Tthingc                    R# )z
An arbitrary thing has no ID.
Nr   r,   r-  r   r   
test_no_idZ"TestOpaqueSpecification.test_no_id   rU   r   c                r.  )z)
An arbitrary thing has no subresources.
Nr   r/  r   r   test_no_subresourcesZ,TestOpaqueSpecification.test_no_subresources  rU   r   c                r.  )z$
An arbitrary thing has no anchors.
Nr   r/  r   r   test_no_anchorsZ'TestOpaqueSpecification.test_no_anchors  rU   r   r   N)r   r   r   r   ZobjectZTHINGSr?   markparametrizer0  r1  r2  r   r   r   r   r   r,  r,    s     endBvx8F[[Wf-9 .9 [[Wf-G .G [[Wf-B .Br   r,  clsc                 s    \         P                  ! \        R R7      ;_uu_ 4         ! R RV 4      pRRR4       R#   + '       g   i     R# ; i)z(?i)subclassingr   c                   s    ] tR tRtRtR# )"test_nonsubclassable.<locals>.Boomi   r   N)r   r   r   r   r   r   r   r   Boomr6     s    r   r7  N)r?   r@   r   )r5  r7  r   r   test_nonsubclassabler8    s1    
 
y(9	:	:	3 	 
;	:	:	:s	   ;A	)Zrpdsr    r?   Zreferencingr   r   r   r   r   Zreferencing.jsonschemar   r3   r"   r#   r   r   r  r,  r3  r4  ZPointerToNowherer8  r   r   r   <module>r9     s      M M .	
-A(M^> ^>Bt
 t
nF: F:R7
 7
tB B8 	Xx
0K0KL	r   