
    Of|:                       d Z ddlZddlmZ d Z G d d          Z G d de          Z G d	 d
e          Z G d de          Z G d de          Z	 G d dej
                  Z G d de          Z G d dej
                  Z G d dee          Z G d dej
                  Z G d dee          Z G d dej
                  Z G d dej
                  Z G d d e          Z G d! d"ej
                  ZdS )#zAdapter registry tests
    N)OptimizationTestMixinc            	      $   ddl m}   G d d|           } G d d|          } G d d|          } G d	 d
||          } G d d||          } G d d|           } G d d|          } G d d|           } G d d|          }	|||||||||	f	S )Nr   	Interfacec                       e Zd ZdS )_makeInterfaces.<locals>.IB0N__name__
__module____qualname__     S/var/www/html/env/lib/python3.11/site-packages/zope/interface/tests/test_adapter.pyIB0r              r   r   c                       e Zd ZdS )_makeInterfaces.<locals>.IB1Nr	   r   r   r   IB1r      r   r   r   c                       e Zd ZdS )_makeInterfaces.<locals>.IB2Nr	   r   r   r   IB2r   !   r   r   r   c                       e Zd ZdS )_makeInterfaces.<locals>.IB3Nr	   r   r   r   IB3r   $   r   r   r   c                       e Zd ZdS )_makeInterfaces.<locals>.IB4Nr	   r   r   r   IB4r   '   r   r   r   c                       e Zd ZdS )_makeInterfaces.<locals>.IF0Nr	   r   r   r   IF0r   *   r   r   r    c                       e Zd ZdS )_makeInterfaces.<locals>.IF1Nr	   r   r   r   IF1r"   -   r   r   r#   c                       e Zd ZdS )_makeInterfaces.<locals>.IR0Nr	   r   r   r   IR0r%   0   r   r   r&   c                       e Zd ZdS )_makeInterfaces.<locals>.IR1Nr	   r   r   r   IR1r(   3   r   r   r)   )zope.interfacer   )
r   r   r   r   r   r   r    r#   r&   r)   s
             r   _makeInterfacesr+      s   ((((((    i       c       c       c3       c3       i       c       i       c    S#sCc366r   c                   <    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
dS )	CustomDataTypeBaseNc                     | j         |         S N_dataselfnames     r   __getitem__zCustomDataTypeBase.__getitem__?   s    z$r   c                     || j         |<   d S r/   r0   )r3   r4   values      r   __setitem__zCustomDataTypeBase.__setitem__B   s     
4r   c                     | j         |= d S r/   r0   r2   s     r   __delitem__zCustomDataTypeBase.__delitem__E   s    Jtr   c                 *    t          | j                  S r/   )lenr1   r3   s    r   __len__zCustomDataTypeBase.__len__H   s    4:r   c                     || j         v S r/   r0   r2   s     r   __contains__zCustomDataTypeBase.__contains__K   s    tz!!r   c                 n    || u rdS t          |          t          |           urdS |j        | j        k    S )NTF)typer1   r3   others     r   __eq__zCustomDataTypeBase.__eq__N   s;    D==4;;d4jj((5{dj((r   c                 *    t          | j                  S r/   )reprr1   r=   s    r   __repr__zCustomDataTypeBase.__repr__V   s    DJr   )r
   r   r   r1   r5   r8   r:   r>   r@   rE   rH   r   r   r   r-   r-   <   s        E     ! ! !    " " ") ) )         r   r-   c                       e Zd ZddZdS )CustomMappingNc                     i | _         |r| j                             |           | j         j        | _        | j         j        | _        d S r/   )r1   updategetitemsrC   s     r   __init__zCustomMapping.__init__[   sB    
 	%Je$$$:>Z%


r   r/   r
   r   r   rO   r   r   r   rJ   rJ   Z   s(        & & & & & &r   rJ   c                       e Zd ZddZdS )CustomSequenceNc                 n    g | _         |r| j                             |           | j         j        | _        d S r/   )r1   extendappendrC   s     r   rO   zCustomSequence.__init__d   s7    
 	%Je$$$j'r   r/   rP   r   r   r   rR   rR   c   s(        ( ( ( ( ( (r   rR   c                       e Zd ZdS )CustomLeafSequenceNr	   r   r   r   rW   rW   k           Dr   rW   c                       e Zd ZdS )CustomProvidedNr	   r   r   r   rZ   rZ   o   rX   r   rZ   c                      e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd-dZd-dZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d  Z!d! Z"d" Z#d# Z$d$ Z%d% Z&d& Z'd' Z(d( Z)d) Z*d* Z+d+ Z,d, Z-dS ).BaseAdapterRegistryTestsNc                     ddl m} |S )Nr   BaseAdapterRegistryzope.interface.adapterr_   )r3   r_   s     r   _getBaseAdapterRegistryz0BaseAdapterRegistryTests._getBaseAdapterRegistryw   s    >>>>>>""r   c                     |                                  } G d d|          }|j        D ]$}t          |j        |t	                                 %|S )Nc                   (    e Zd Z G d d          ZdS )6BaseAdapterRegistryTests._getTargetClass.<locals>._CUTc                   .    e Zd ZdxZZd Zd Zd Zd ZdS )BBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClassr   c                     d S r/   r   )r3   regs     r   rO   zKBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.__init__   s    Dr   c                 (    | xj         |fz  c_         d S r/   _changed)r3   origs     r   changedzJBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.changed   s    MMdW,MMMMr   c                 (    | xj         |fz  c_         d S r/   )
_extendorsr3   provideds     r   add_extendorzOBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.add_extendor   s    OO{2OOOOr   c                 R    t          fd| j        D                       | _        d S )Nc                      g | ]
}|k    |S r   r   ).0xrr   s     r   
<listcomp>zfBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendor.<locals>.<listcomp>   s)     -? -? -?101X ./0=r   )tuplerp   rq   s    `r   remove_extendorzRBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendor   sA    &+ -? -? -? -? -? -? -? '@ '@DOOOr   N)	r
   r   r   rl   rp   rO   rn   rs   rz   r   r   r   LookupClassrg      s_        (**:  - - -3 3 3@ @ @ @ @r   r{   N)r
   r   r   r{   r   r   r   _CUTre   ~   sF        @ @ @ @ @ @ @ @ @ @r   r|   )rb   
_delegatedsetattrr{   object)r3   r_   r|   r4   s       r   _getTargetClassz(BaseAdapterRegistryTests._getTargetClass{   s|    "::<<	@ 	@ 	@ 	@ 	@& 	@ 	@ 	@$ (2 	6 	6DD$dFHH5555r   c                 :     |                                              S r/   r   r=   s    r   _makeOnez!BaseAdapterRegistryTests._makeOne   s    %t##%%'''r   c                     t           S r/   dictr=   s    r   _getMappingTypez(BaseAdapterRegistryTests._getMappingType       r   c                     t           S r/   r   r=   s    r   _getProvidedTypez)BaseAdapterRegistryTests._getProvidedType   r   r   c                     t           S r/   )listr=   s    r   _getMutableListTypez,BaseAdapterRegistryTests._getMutableListType   r   r   c                     t           S r/   )ry   r=   s    r   _getLeafSequenceTypez-BaseAdapterRegistryTests._getLeafSequenceType   s    r   c                     |                                  } |            }|j        D ]9}|                     t          ||          t          |j        |                     :d S r/   )r   r}   assertIsgetattr	_v_lookup)r3   CUTregistryr4   s       r   test_lookup_delegationz/BaseAdapterRegistryTests.test_lookup_delegation   sp    ""$$355N 	 	DMM$''1CT)J)J   	 	r   c                 d    |                                  }|                     |j        d           d S N   )r   assertEqual_generationr3   r   s     r   "test__generation_on_first_creationz;BaseAdapterRegistryTests.test__generation_on_first_creation   s.    ==??-q11111r   c                     |                                  }t                      }|                    |           |                     |j        d           |                     |j        j        ||f           d S N   )r   r   rn   r   r   r   rl   )r3   r   rm   s      r   &test__generation_after_calling_changedz?BaseAdapterRegistryTests.test__generation_after_calling_changed   sl    ==??xx-q111+4x6GHHHHHr   c                      G d d          }|                                  }|f|_        |                     |j        d           d S )Nc                       e Zd ZdS )QBaseAdapterRegistryTests.test__generation_after_changing___bases__.<locals>._BaseNr	   r   r   r   _Baser              Dr   r   r   )r   	__bases__r   r   )r3   r   r   s      r   )test__generation_after_changing___bases__zBBaseAdapterRegistryTests.test__generation_after_changing___bases__   s`    	 	 	 	 	 	 	 	==??#X-q11111r   r   c                    |                      t          |j                  |           |                     |j        |                                            |                                 }|j        D ]}|                     ||           |                      |j        d          |                       |                     |j        d         |           |                      t          |j        |dz
                     d           d S Nr   r   )r   r<   	_adaptersassertIsInstancer   r   r3   r   expected_orderMTmappings        r   _check_basic_types_of_adaptersz7BaseAdapterRegistryTests._check_basic_types_of_adapters   s    "##^	
 	
 	
 	h0$2J2J2L2LMMM!!##) 	/ 	/G!!'2....+A.555h03R888X/0BCDDaHHHHHr   c                    |                      t          |j                  |           |                     |j        |                                            |                                 }|j        D ]}|                     ||           |r}|                      |j        d          |                       |                     |j        d         |           |                      t          |j        |dz
                     d           d S d S r   )r   r<   _subscribersr   r   r   r   s        r   !_check_basic_types_of_subscribersz:BaseAdapterRegistryTests._check_basic_types_of_subscribers   s   %&&	
 	
 	
 	!4#;#;#=#=	
 	
 	
 !!##, 	/ 	/G!!'2.... 	PX215rrtt<<<!!("7":B???S!6~7I!JKKQOOOOO	P 	Pr   c                    t                      \	  }}}}}}}}}	|                                 }
|
                    |g|dd           |                     |
                    |g|d          d           |                     |
j        d           |                     |
           |                                 }|                     |
j        d          || || |ddi          i          i                     | 	                                }|                     |
j
         ||di                     t          |
                                          }|                     ||f|ddfg           d S )N A1r   r   )r+   r   registerr   
registeredr   r   r   r   r   	_providedr   allRegistrations)r3   r   r   r   r   r   r    r#   r&   r)   r   r   PTr   s                 r   test_registerz&BaseAdapterRegistryTests.test_register   s    	
c3S#sC==??3%b$///,,cUC<<dCCC-q111++H555!!##+A.RRT
^^  4
 1 1 	 	 	
 ""$$+RR1
 . . 	 	 	 (335566
F	'
 & 	 	 	 	 	r   c                   
 t                      \	  
}}}|                                 }|                    g dd           |                    g dd           |                    
gdd           |                    
gdd           |                    
gdd           |                    
gdd           |                    
gdd           |                    
gdd           |                    
gd	d           |                    
gdd           
fd
}|                     |j         ||                                 |                                                      t          |                                          }|                     |dddfdddf
fddf
fddf
fddf
fddf
fddf
fddf
fd	df
fddfg
           |                                 }|D ]} |j        |  |                     |j        |j                   |                     |j	        |j	                   t          |_        t          |_        t          |_        t           |_        d }	|	|_        |                                 |                     |j         |t          t                               d S )Nr   r   name1A2name2A3name3A4name4c                     |  | |ddd          i           | | |ddd           |ddd          i          i           | | | |ddi          i           | |d	di           |d
di          i           | |ddi          i          i          i          g          S )Nr   r   )r   r   )r   r   r   r   )r   r   r   r   r   r   )Lr   r   r   r   r   r&   r)   s     r   build_adapterszXBaseAdapterRegistryTests.test_register_multiple_allRegistrations.<locals>.build_adapters	  s{   1 !%      RR $%)! !   RR $%)! !  	 	 	   RRRJ!   RRWdO!4!4WdO!4!4!   RRRJ!      -$ $ $ $r   )r   r   r   c                 T    | | nt                      } |                     |           | S r/   rW   rU   existingnews     r   addValuezRBaseAdapterRegistryTests.test_register_multiple_allRegistrations.<locals>.addValueP  3    $06H6J6J  OOC   Or   )r+   r   r   r   r   r   r   sortedr   r   rJ   _mappingTyperW   _leafSequenceTyperR   _sequenceTyperZ   _providedType_addValueToLeafrebuild)r3   r   r    r#   r   r   r   	registry2argsr   r   r   r   r   r&   r)   s             @@@@@@r   'test_register_multiple_allRegistrationsz@BaseAdapterRegistryTests.test_register_multiple_allRegistrations   s    	
c3S#sC==??"c2t,,,"c7D1113%b$///3%gt4443%b$///3%gt4443*c2t4443*c7D9993*c7D9993*c2t444%	 %	 %	 %	 %	 %	 %	 %	 %	 %	N 	+'$*B*B*D*D+/+?+?+A+AC C C	D 	D 	D H557788
b$gt$VS"d#VS'4(VS"d#VS'4(3Zb$'3Zgt,3Zgt,3Zb$'&
 	 	 	 MMOO	 	& 	&DI%%%,h.@AAA,h.@AAA !.%7"!/!/	 	 	 $, +'- -  	 	 	 	 	r   c           	         t                      \	  }}}}}}}}}	|                                 }
|                     t                    5  |
                    |g|t                      d           d d d            d S # 1 swxY w Y   d S Nr   )r+   r   assertRaises
ValueErrorr   r   r3   r   r   r   r   r   r    r#   r&   r)   r   s              r   test_register_with_invalid_namez8BaseAdapterRegistryTests.test_register_with_invalid_namea  s     	
c3S#sC==??z** 	: 	:seS&((D999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s   &A::A>A>c           	         t                      \	  }}}}}}}}}	|                                 }
|
                    d g|dd           |
                    d g|dd            |                     t	          |
j                  d           |                     |
j        |                                            t          |
	                                          }|                     |g            d S )Nr   r   r   )
r+   r   r   r   r<   r   r   r   r   r   )r3   r   r   r   r   r   r    r#   r&   r)   r   r   s               r   )test_register_with_value_None_unregisterszBBaseAdapterRegistryTests.test_register_with_value_None_unregistersi  s     	
c3S#sC==??4&#r40004&#r4000X/00!444h0$2J2J2L2LMMM(335566
R(((((r   c                 ~   ddl m} t                      \	  }}}}}}}}	}
|                                 }t	                      }|                    d g|	d|           |j        }|                    d g|	d|           |                     |j        |           |                     |           | 	                                }|                     |j
        d          || ||	 |d|i          i          i                     t          |                                          }|                     ||f|	d|fg           d S )Nr   r   r   r   )r*   r   r+   r   r   r   r   r   r   r   r   r   r   )r3   r   r   r   r   r   r   r    r#   r&   r)   r   _value_beforer   r   s                   r   test_register_with_same_valuez6BaseAdapterRegistryTests.test_register_with_same_valueu  s   ,,,,,, 	
c3S#sC==??4&#r6222&4&#r6222-w777++H555!!##+A.22RRV-- 1
 1
 	 	 	 (335566
L	'
 & 	 	 	 	 	r   c                     |                                  }|                     |                    d gd d          d            t          |                                          }|                     |g            d S Nr   )r   r   r   r   r   )r3   r   r   s      r   test_registered_emptyz.BaseAdapterRegistryTests.test_registered_empty  sn    ==??,,dVT2>>EEE(335566
R(((((r   c           	          t                      \	  }}}}}}}}}	|                                 }
|
                    |gd dd           |                     |
                    |gd d          d            d S Nr   r   )r+   r   r   r   r   r   s              r   test_registered_non_empty_missz7BaseAdapterRegistryTests.test_registered_non_empty_miss  s~     	
c3S#sC==??3%r4000,,cUD"==tDDDDDr   c                     |                                  }|                    d gd dd           |                     |                    d gd d          d           d S r   )r   r   r   r   r   s     r   test_registered_non_empty_hitz6BaseAdapterRegistryTests.test_registered_non_empty_hit  s[    ==??4&$D111,,dVT2>>EEEEEr   c                    |                                  }|                    d gd d           |                     |                    d gd d          d            |                     t	          |j                  d           d S )Nr   r   )r   
unregisterr   r   r<   r   r   s     r   test_unregister_emptyz.BaseAdapterRegistryTests.test_unregister_empty  sz    ==??TFD"---,,dVT2>>EEEX/00!44444r   c                 b   t                      \	  }}}}}}}}}	|                                 }
|
                    |gd dd           |
                    |gd d           |                     |
                    |gd d          d           |                     |
           |                                 }|                     |
j        d          || |d  |ddi          i          i                     | 	                                }|                     |
j
         |d di                     d S )Nr   r   r   r+   r   r   r   r   r   r   r   r   r   r   r3   r   r   r   r   r   r    r#   r&   r)   r   r   r   s                r   *test_unregister_non_empty_miss_on_requiredzCBaseAdapterRegistryTests.test_unregister_non_empty_miss_on_required  se    	
c3S#sC==??3%r4000SE4,,,,,cUD"==tDDD++H555!!##+A.RRbb"dnn 1
 1
 	 	 	 ""$$+RR!1
 . . 	 	 	 	 	r   c                 b   t                      \	  }}}}}}}}}	|                                 }
|
                    |gd dd           |
                    |gd d           |                     |
                    |gd d          d           |                     |
           |                                 }|                     |
j        d          || |d  |ddi          i          i                     | 	                                }|                     |
j
         |d di                     d S )Nr   r   nonesuchr   r   r   s                r   &test_unregister_non_empty_miss_on_namez?BaseAdapterRegistryTests.test_unregister_non_empty_miss_on_name  se    	
c3S#sC==??3%r4000SE4444,,cUD"==tDDD++H555!!##+A.RRbb"dnn 1
 1
 	 	 	 ""$$+RR!1
 . . 	 	 	 	 	r   c           	      R   t                      \	  }}}}}}}}}	|                                 }
t                      }t                      }|
                    |gd d|           |
                    |gd d|           |                     |
                    |gd d          |           d S r   )r+   r   r   r   r   r   r   r3   r   r   r   r   r   r    r#   r&   r)   r   rm   nomatchs                r   (test_unregister_with_value_not_None_misszABaseAdapterRegistryTests.test_unregister_with_value_not_None_miss  s     	
c3S#sC==??xx((3%r4000SE4W555h))3%r::DAAAAAr   c                    t                      \	  }}}}}}}}}	|                                 }
t                      }t                      }|
                    ||gd d|           |
                    ||gd d|           |                     |
d           |                     ||
j        d         |                    |                     ||
j        d         |                    |                                 }|                     |
j        d          || || |d  |d|i          i          | |d  |d|i          i          i          i                     | 	                                }|                     |
j
         |d di                     |
                    ||gd d|           |                     ||
j        d         |                    |                     ||
j        d         |                    |                     |
j        d          || || |d  |d|i          i          i          i                     |                     |
j
         |d di                     d S )Nr      r   r   r   )r+   r   r   r   r   assertInr   r   r   r   r   r   assertNotIn)r3   r   r   r   r   r   r    r#   r&   r)   r   oneanotherr   r   s                  r   .test_unregister_hit_clears_empty_subcomponentszGBaseAdapterRegistryTests.test_unregister_hit_clears_empty_subcomponents  s    	
c3S#sC==??hh((3*dB4443*dB888++HQ+GGGc8-a05666c8-a05666!!##+A.RRRRrr2s)}} 566RRrr2w-'8'8 9:: 	1
 	1
 		 		 		 ""$$+RR!1
 . . 	 	 	 	S#Jb':::c8-a05666h03C8999+A.RRRRrr2s)}} 566 1
 1
 	 	 	 	+RR!1
 . . 	 	 	 	 	r   c                     |                                  }|                    d gd d           |                     |                    d gd d          d            |                     |d           d S )Nr   r   r   )r   unsubscriber   r   r   r   s     r   test_unsubscribe_emptyz/BaseAdapterRegistryTests.test_unsubscribe_empty  sr    ==??dVT2...,,dVT2>>EEE..x.JJJJJr   c                    t                      \	  }}}}}}}}}	|                                 }
t                      }|
                    |gd |           |                                 }|                                 }|                                 }|                     |
           |                     |
j	        d          || |d  |d ||f          i          i          i                     |                     |
j
         |i                      |
                    |gd |           |                     t          |
j	                  d           |                     |
j
         |i                      d S )Nr   r   r   )r+   r   r   	subscriber   r   r   r   r   r   r   r  r<   )r3   r   r   r   r   r   r    r#   r&   r)   r   rm   r   r   r   s                  r   test_unsubscribe_hitz-BaseAdapterRegistryTests.test_unsubscribe_hit  s    	
c3S#sC==??xxC5$---!!##%%''""$$..x888.q122bb4'

    7
 4 4 	 	 	 	+RRVV444cUD$///X233Q777+RRVV44444r   c                 2    |                      ||           dS )a  
        Implementations may choose to use new, immutable objects
        instead of mutating existing subscriber leaf objects, or vice versa.

        The default implementation uses immutable tuples, so they are never
        the same. Other implementations may use persistent lists so they
        should be the same and mutated in place. Subclasses testing this
        behaviour need to override this method.
        N)assertIsNotr3   leaf1leaf2s      r   assertLeafIdentityz+BaseAdapterRegistryTests.assertLeafIdentity0  s      	&&&&&r   c                    t                      \	  }}}}}}}}}	|                                 }
t                      }t                      }t                      }t                      }|
                    |gd |           |
                    |gd |           |
                    |g||           |
                    |g||           |                     |
d           |                                 }|                                 }|                                 }|                     |
j	        d          || |d  |d |||f          i          | |d |||f          i          i          i                     |                     |
j
         ||di                     |
j	        d         |         |         d         }|
j	        d         |         d          d         }|
                    |gd |           |
                    |g||           |                     |
j	        d          || |d  |d ||f          i          | |d ||f          i          i          i                     |                     |
j
         ||di                     |
j	        d         |         |         d         }|
j	        d         |         d          d         }|                     ||           |                     ||           |
                    |gd |           |
                    |g||           |                     t          |
j	                  d           |                     t          |
j
                  d           d S )Nr   r   r   r   r   )r+   r   r   r  r   r   r   r   r   r   r   r  r  r<   )r3   r   r   r   r   r   r    r#   r&   r)   r   firstsecondthirdfourthr   r   r   IR0_leaf_origNon_leaf_origIR0_leaf_newNon_leaf_news                         r   test_unsubscribe_after_multiplez8BaseAdapterRegistryTests.test_unsubscribe_after_multiple<  s    	
c3S#sC==??C5$...C5$///C5#u---C5#v.....x.JJJ!!##%%''""$$.q122bb"aa00122RRQQv//011  7
 4 4 	 	 	 	+RR1
 . . 	 	 	
 !-a05c:2> -a05d;B?cUD%000cUC///.q122bb"aa	ll+,,RRQQy\\*++  7
 4 4 	 	 	 	+RR1
 . . 	 	 	  ,Q/4S9"=,Q/4T:2>|<<<|<<<cUD&111cUC000X233Q777X/00!44444r   c                 .   t                      \	  }}}}}}}}}	|                                 }
t                      }|
                    |g||           |
                    |g||           |                                 }|                                 }|                                 }|                     |
j        d          || || |d |||f          i          i          i                     |                     |
j	         ||di                     |

                    |g||           |

                    |g||           |                     t          |
j                  d           |                     |
j	         |                       d S Nr   r   r   r   r+   r   r   r  r   r   r   r   r   r   r  r<   )r3   r   r   r   r   r   r    r#   r&   r)   r   r  r   r   r   s                  r   5test_subscribe_unsubscribe_identical_objects_providedzNBaseAdapterRegistryTests.test_subscribe_unsubscribe_identical_objects_providedr  s    	
c3S#sC==??C5#u---C5#u---!!##%%''""$$.q122RRQQu~../00  7
 4 4 	 	 	
 	+RR1
 . . 	 	 	 	cUC///cUC///X233Q777+RRTT22222r   c                 J   t                      \	  }}}}}}}}}	|                                 }
t                      }t                      }|
                    |g||           |
                    |g||           |                                 }|                                 }|                                 }|                     |
j        d          || || |d |||f          i          i          i                     |                     |
j	         ||di                     |

                    |g||           |

                    |g||           |                     t          |
j                  d           |                     |
j	         |                       d S r  r  )r3   r   r   r   r   r   r    r#   r&   r)   r   r  r  r   r   r   s                   r   4test_subscribe_unsubscribe_nonequal_objects_providedzMBaseAdapterRegistryTests.test_subscribe_unsubscribe_nonequal_objects_provided  s    	
c3S#sC==??C5#u---C5#v...!!##%%''""$$.q122RRQQv//011  7
 4 4 	 	 	
 	+RR1
 . . 	 	 	 	cUC///cUC000X233Q777+RRTT22222r   c                     |                                  }|                     |                    d gd d                     t          |                                          }|                     |g            d S r   )r   assertIsNone
subscribedr   allSubscriptionsr   )r3   r   r"  s      r   test_subscribed_emptyz.BaseAdapterRegistryTests.test_subscribed_empty  sl    ==??(--tfdB??@@@(335566
R(((((r   c           	         t                      \	  }}}}}}}}}	|                                 }
|
                    |g|d           |                     |
                    |g|d                     |                     |
                    |g|d                     |                     |
                    |g|d                     d S )Nr   r   )r+   r   r  r!  r"  r   s              r   test_subscribed_non_empty_missz7BaseAdapterRegistryTests.test_subscribed_non_empty_miss  s     	
c3S#sC==??C5#t,,,(--seS"==>>>(--seS"==>>>(--seS"==>>>>>r   c           	          t                      \	  }}}}}}}}}	|                                 }
|
                    |g|d           |                     |
                    |g|d          d           d S r   )r+   r   r  r   r"  r   s              r   test_subscribed_non_empty_hitz6BaseAdapterRegistryTests.test_subscribed_non_empty_hit  s|     	
c3S#sC==??C5#t,,,,,cUC>>EEEEEr   c           	         t                      \	  }}}}}}}}}	|                                 }
t                      }t                      }|
                    |gd |           |
                    |gd |           |                     |
d           |
                    |gd            |                     t          |
j                  d           d S )Nr   r   r   )	r+   r   r   r  r   r  r   r<   r   )r3   r   r   r   r   r   r    r#   r&   r)   r   r  r  s                r   &test_unsubscribe_w_None_after_multiplez?BaseAdapterRegistryTests.test_unsubscribe_w_None_after_multiple  s     	
c3S#sC==??C5$...C5$///..x.JJJcUD)))X233Q77777r   c                 "   t                      \	  }}}}}}}}}	|                                 }
|
                    |gd d           |                     |
d           |
                    |gd d           |                     t          |
j                  d           |                                 }| 	                                }|                     |
j        d          || |d  |d |d          i          i          i                     d S )Nr   r   r   r   r   r   
r+   r   r  r   r  r   r<   r   r   r   r3   r   r   r   r   r   r    r#   r&   r)   r   r   r   s                r   +test_unsubscribe_non_empty_miss_on_requiredzDBaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_required  s3    	
c3S#sC==??C5$---..x.JJJcUD"---X233Q777!!##%%''.q122bb"aajj)**  7
 4 4 	 	 	 	 	r   c                 "   t                      \	  }}}}}}}}}	|                                 }
|
                    |gd d           |                     |
d           |
                    |gd d           |                     t          |
j                  d           |                                 }| 	                                }|                     |
j        d          || |d  |d |d          i          i          i                     d S )Nr   r   r   r   r   r   r,  r-  r.  s                r   (test_unsubscribe_non_empty_miss_on_valuezABaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_value  s3    	
c3S#sC==??C5$---..x.JJJcUD$///X233Q777!!##%%''.q122bb"aajj)**  7
 4 4 	 	 	 	 	r   c           	      F   t                      \	  }}}}}}}}}	|                                 }
t                      }t                      }|
                    |gd |           |
                    |gd |           |                     t          |
j                  d           d S r   )r+   r   r   r  r  r   r<   r   r   s                r   )test_unsubscribe_with_value_not_None_misszBBaseAdapterRegistryTests.test_unsubscribe_with_value_not_None_miss  s     	
c3S#sC==??xx((C5$---cUD'222X233Q77777r   c                 0    |                      d           d S )Nz*Example method, not intended to be called.failr=   s    r   _instance_method_notify_targetz7BaseAdapterRegistryTests._instance_method_notify_target  s    		>?????r   c           	      r   t                      \	  }}}}}}}}}	|                                 }
|                     t          |
j                  d           |
                    |gd | j                   |
                    |gd | j                   |                     t          |
j                  d           d S Nr   )r+   r   r   r<   r   r  r7  r  r   s              r    test_unsubscribe_instance_methodz9BaseAdapterRegistryTests.test_unsubscribe_instance_method  s     	
c3S#sC==??X233Q777C5$(KLLLcUD$*MNNNX233Q77777r   c                 :   t                      \	  }}}|                                 }|                    g d           |                    g d           |                    gd           |                    gd           |                    gd           |                    gd           |                    gd           |                    gd           |                    gd           |                    gd           fd}|                     |j         ||                                 |                                 |                                                      fd}|                     |j         || 	                                                     t          |                                          }|                     |d	dfd	dffdffdffdffdffdffdffdffdfg
           |                                 }|D ]}	 |j        |	  |                     |j        |j                   |                     |j        |j                   t          |_        t          |_        t           |_        t$          |_        d
 }
|
|_        |                                 |                     |j         |t           t          t                               d S )Nr   r   r   r   c                     |  | |d |ddg          i          i           | | |d |ddg          i           |d |ddg          i          i          i           | | | |d |dg          i          i           | |d |dg          i           |d |dg          i          i           | |d |dg          i          i          i          i          g          S )Nr   r   r   r   r   r   )	r   Fr   r   r   r   r   r&   r)   s	      r   build_subscribersz\BaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.build_subscribers   s   1AAtTlOO     RR4,!   RR4,!  	  	 	 	 RRRD6O!4!4!   RRRD6O!4!4RD6O!4!4!   RRRD6O!4!4!      '! ! ! !r   )r   r=  r   c                 "     | ddi          S )N      r   )Pr&   r)   s    r   build_providedzYBaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.build_providedK  s&    1QQ   r   )rB  r   c                 T    | | nt                      } |                     |           | S r/   r   r   s     r   r   zSBaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.addValuep  r   r   )r+   r   r  r   r   r   r   r   r   r   r   r#  rJ   r   rW   r   rR   r   rZ   r   r   r   )r3   r   r    r#   r   r>  rC  r   r   r   r   r   r   r   r   r&   r)   s              @@@@@@r   (test_subscribe_multiple_allRegistrationszABaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations  s    	
c3S#sC==??2sD)))2sD)))C5#t,,,C5#t,,,C5#t,,,C5#t,,,C:sD111C:sD111C:sD111C:sD111"	 "	 "	 "	 "	 "	 "	 "	 "	 "	H 	.**#7799#88:: $ 4 4 6 6  	 	 		 	 	 	 	 	 	+'$*?*?*A*ABBB	D 	D 	D H557788
dOdOVS$VS$VS$VS$3Zd#3Zd#3Zd#3Zd#&
 	 	 	 MMOO	 	' 	'DI&&&/1FGGG,h.@AAA !.%7"!/!/	 	 	 $, .**-1 -  	 	 	 	 	r   )r   ).r
   r   r   maxDiffrb   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  r  r  r$  r&  r(  r*  r/  r1  r3  r7  r:  rE  r   r   r   r\   r\   s   s       G# # #  2( ( (          2 2 2
I I I2 2 2
I 
I 
I 
IP P P P  8i i iV: : :
) 
) 
)  <) ) )E E EF F F
5 5 5  0  0	B 	B 	B* * *XK K K5 5 5.
' 
' 
'45 45 45l3 3 363 3 38) ) )? ? ?F F F8 8 8  "  "	8 	8 	8@ @ @	8 	8 	8s s s s sr   r\   c                   6    e Zd ZdZd Zd Zd Zd Zd Zd Z	dS )	#CustomTypesBaseAdapterRegistryTestsz
    This class may be extended by other packages to test their own
    adapter registries that use custom types. (So be cautious about
    breaking changes.)

    One known user is ``zope.component.persistentregistry``.
    c                     t           S r/   )rJ   r=   s    r   r   z3CustomTypesBaseAdapterRegistryTests._getMappingType  s    r   c                     t           S r/   )rZ   r=   s    r   r   z4CustomTypesBaseAdapterRegistryTests._getProvidedType      r   c                     t           S r/   )rR   r=   s    r   r   z7CustomTypesBaseAdapterRegistryTests._getMutableListType  rK  r   c                     t           S r/   )rW   r=   s    r   r   z8CustomTypesBaseAdapterRegistryTests._getLeafSequenceType  s    !!r   c                 8     ddl m  G  fdd          }|S )Nr   r^   c                       e Zd Z                                Z                                Z                                Z	                                Z
d Z fdZdS )ZCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistryc                 \    |s|                                  }|                    |           |S r/   )r   rU   )r3   existing_leaf_sequencenew_items      r   r   zjCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistry._addValueToLeaf  s7    - F-1-C-C-E-E*&--h777--r   c                 P                         | ||          }||d d <   ||vsJ |S r/   )_removeValueFromLeaf)r3   rR  	to_removewithout_removedr_   s       r   rU  zoCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistry._removeValueFromLeaf  sJ    "5"J"J*# # -<&qqq) (>>>>>--r   N)r
   r   r   r   r   r   r   r   r   r   r   r   rU  )r_   r3   s   r   CustomAdapterRegistryrP    s        //11L 4466M $ 9 9 ; ; 1133M. . .. . . . . . .r   rX  r`   )r3   rX  r_   s   ` @r   rb   z;CustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry  sX    >>>>>>	. 	. 	. 	. 	. 	. 	. 	.$7 	. 	. 	.* %$r   c                 2    |                      ||           d S r/   )r   r  s      r   r  z6CustomTypesBaseAdapterRegistryTests.assertLeafIdentity  s    eU#####r   N)
r
   r   r   __doc__r   r   r   r   rb   r  r   r   r   rH  rH    sx               " " "% % %4$ $ $ $ $r   rH  c                        e Zd Zd ZeZ	 ddZd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z fdZd Zd Zd Zd Zd Z xZ S )LookupBaseFallbackTestsc                     ddl m} |S )Nr   )LookupBaseFallback)ra   r^  )r3   r^  s     r   _getFallbackClassz)LookupBaseFallbackTests._getFallbackClass  s    ======!!r   Nc                     d d d  G fdd|                                            } |            S )Nc                     d S r/   r   r3   requiredrr   r4   s       r   	uc_lookupz3LookupBaseFallbackTests._makeOne.<locals>.uc_lookup      r   c                     t                      r/   NotImplementedErrorr3   rc  rr   s      r   uc_lookupAllz6LookupBaseFallbackTests._makeOne.<locals>.uc_lookupAll      )+++r   c                     t                      r/   rg  ri  s      r   uc_subscriptionsz:LookupBaseFallbackTests._makeOne.<locals>.uc_subscriptions  rk  r   c                       e Zd Z ZZZdS )1LookupBaseFallbackTests._makeOne.<locals>.DerivedN)r
   r   r   _uncached_lookup_uncached_lookupAll_uncached_subscriptions)rd  rj  rm  s   r   Derivedro    s#        (".&6###r   rs  r   )r3   rd  rj  rm  rs  s    ``` r   r   z LookupBaseFallbackTests._makeOne  s        , , , #, , ,	7 	7 	7 	7 	7 	7 	7 	7 	7d**,, 	7 	7 	7
 wyyr   c                     d }|                      |          }|                     t                    5  |                    ddt	                                 d d d            d S # 1 swxY w Y   d S )Nc                 0    |                      d           d S NzThis should never be calledr5  rb  s       r   _lookupzCLookupBaseFallbackTests.test_lookup_w_invalid_name.<locals>._lookup      II344444r   rd  AB)r   r   r   lookupr   r3   rw  lbs      r   test_lookup_w_invalid_namez2LookupBaseFallbackTests.test_lookup_w_invalid_name  s    	5 	5 	5 ]]W]--z** 	- 	-IIfc688,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-   $A%%A),A)c                     g fd}|                      |          }|                    ddd          }|                     |           |                     dg           d S )Nc                 8                         |||f           d S r/   rU   r3   rc  rr   r4   _called_withs       r   rw  zDLookupBaseFallbackTests.test_lookup_miss_no_default.<locals>._lookup  $    8T :;;;;;r   ry  rz  r|  Crz  r|  r  )r   r}  r!  r   r3   rw  r  foundr  s       @r   test_lookup_miss_no_defaultz3LookupBaseFallbackTests.test_lookup_miss_no_default  s    	< 	< 	< 	< 	< ]]W]--		&#s++%   (:';<<<<<r   c                     g t                      }fd}|                     |          }|                    ddd|          }|                     ||           |                     dg           d S )Nc                 8                         |||f           d S r/   r  r  s       r   rw  zCLookupBaseFallbackTests.test_lookup_miss_w_default.<locals>._lookup  r  r   ry  rz  r|  r  r  r   r   r}  r   r   r3   _defaultrw  r  r  r  s        @r   test_lookup_miss_w_defaultz2LookupBaseFallbackTests.test_lookup_miss_w_default  s    88	< 	< 	< 	< 	< ]]W]--		&#sH55eX&&&(:';<<<<<r   c                 \   g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                     ||           |                     dg           |                     ||g           d S )Nc                 ^                         |||f                               d          S r9  rU   popr3   rc  rr   r4   r  _resultss       r   rw  z?LookupBaseFallbackTests.test_lookup_not_cached.<locals>._lookup  .    8T :;;;<<??"r   ry  rz  r|  r  r  r  	r3   abcrw  r  r  r  r  s	          @@r   test_lookup_not_cachedz.LookupBaseFallbackTests.test_lookup_not_cached  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--		&#s++eQ(:';<<<Aq6*****r   c                    g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                    ddd          }|                     ||           |                     dg           |                     ||g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  z;LookupBaseFallbackTests.test_lookup_cached.<locals>._lookup  r  r   ry  rz  r|  r  r  r  r  s	          @@r   test_lookup_cachedz*LookupBaseFallbackTests.test_lookup_cached  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--		&#s++		&#s++eQ(:';<<<Aq6*****r   c                 \   g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                     ||           |                     dg           |                     ||g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  zNLookupBaseFallbackTests.test_lookup_not_cached_multi_required.<locals>._lookup  r  r   ry  r{  Dr|  r  r  r|  r  r  r  s	          @@r   %test_lookup_not_cached_multi_requiredz=LookupBaseFallbackTests.test_lookup_not_cached_multi_required  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--		*c3//eQ(>'?@@@Aq6*****r   c                    g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                    ddd          }|                     ||           |                     dg           |                     ||g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  zJLookupBaseFallbackTests.test_lookup_cached_multi_required.<locals>._lookup+  r  r   ry  r  r|  r  r  r  r  s	          @@r   !test_lookup_cached_multi_requiredz9LookupBaseFallbackTests.test_lookup_cached_multi_required&  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--		*c3//		*c3//eQ(>'?@@@Aq6*****r   c                    g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                    |           |                    ddd          }|                     ||           |                     ddg           |                     |g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  zMLookupBaseFallbackTests.test_lookup_not_cached_after_changed.<locals>._lookup;  r  r   ry  rz  r|  r  r  )r   r   r}  rn   r   r   r  s	          @@r   $test_lookup_not_cached_after_changedz<LookupBaseFallbackTests.test_lookup_not_cached_after_changed6  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--		&#s++


2		&#s++eQ,.@A	C 	C 	CA3'''''r   c                     d }|                      |          }|                     t                    5  |                    ddt	                                 d d d            d S # 1 swxY w Y   d S )Nc                 0    |                      d           d S rv  r5  rb  s       r   rw  zDLookupBaseFallbackTests.test_lookup1_w_invalid_name.<locals>._lookupJ  rx  r   ry  r{  r|  )r   r   r   lookup1r   r~  s      r   test_lookup1_w_invalid_namez3LookupBaseFallbackTests.test_lookup1_w_invalid_nameH  s    	5 	5 	5 ]]W]--z** 	+ 	+JJsC***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+r  c                     g fd}|                      |          }|                    ddd          }|                     |           |                     dg           d S )Nc                 8                         |||f           d S r/   r  r  s       r   rw  zELookupBaseFallbackTests.test_lookup1_miss_no_default.<locals>._lookupT  r  r   ry  r{  r|  r  r  )r   r  r!  r   r  s       @r   test_lookup1_miss_no_defaultz4LookupBaseFallbackTests.test_lookup1_miss_no_defaultQ  s    	< 	< 	< 	< 	< ]]W]--

3S))%   (:';<<<<<r   c                     g t                      }fd}|                     |          }|                    ddd|          }|                     ||           |                     dg           d S )Nc                 8                         |||f           d S r/   r  r  s       r   rw  zDLookupBaseFallbackTests.test_lookup1_miss_w_default.<locals>._lookup`  r  r   ry  r{  r|  r  r  r   r   r  r   r   r  s        @r   test_lookup1_miss_w_defaultz3LookupBaseFallbackTests.test_lookup1_miss_w_default\  s    88	< 	< 	< 	< 	< ]]W]--

3S(33eX&&&(:';<<<<<r   c                 D   g t                      }fd}|                     |          }|                    ddd|          }|                     ||           |                    ddd|          }|                     ||           |                     dg           d S )Nc                 8                         |||f           d S r/   r  r  s       r   rw  zSLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cache.<locals>._lookupl  r  r   ry  r{  r|  r  r  r  r  s        @r   *test_lookup1_miss_w_default_negative_cachezBLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cacheh  s    88	< 	< 	< 	< 	< ]]W]--

3S(33eX&&&

3S(33eX&&&(:';<<<<<r   c                 \   g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                     ||           |                     dg           |                     ||g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  z@LookupBaseFallbackTests.test_lookup1_not_cached.<locals>._lookup{  r  r   ry  r{  r|  r  r  r  r  s	          @@r   test_lookup1_not_cachedz/LookupBaseFallbackTests.test_lookup1_not_cachedv  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--

3S))eQ(:';<<<Aq6*****r   c                    g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                    ddd          }|                     ||           |                     dg           |                     ||g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  z<LookupBaseFallbackTests.test_lookup1_cached.<locals>._lookup  r  r   ry  r{  r|  r  r  r  r  s	          @@r   test_lookup1_cachedz+LookupBaseFallbackTests.test_lookup1_cached  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--

3S))

3S))eQ(:';<<<Aq6*****r   c                    g t                      t                      t                      }}}|||gfd}|                     |          }|                    ddd          }|                    |           |                    ddd          }|                     ||           |                     ddg           |                     |g           d S )Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  zNLookupBaseFallbackTests.test_lookup1_not_cached_after_changed.<locals>._lookup  r  r   ry  r{  r|  r  r  )r   r   r  rn   r   r   r  s	          @@r   %test_lookup1_not_cached_after_changedz=LookupBaseFallbackTests.test_lookup1_not_cached_after_changed  s    ((FHHfhha1q!9	# 	# 	# 	# 	# 	# ]]W]--

3S))


2

3S))eQ,.@A	C 	C 	CA3'''''r   c                    t                      t                      }}|                                 }|                     t                    5  |                    ||t                                 d d d            d S # 1 swxY w Y   d S r/   )r   r   r   r   adapter_hook)r3   reqprvr  s       r    test_adapter_hook_w_invalid_namez8LookupBaseFallbackTests.test_adapter_hook_w_invalid_name  s    88VXXS]]__z** 	0 	0OOCfhh///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   $A<<B B c                     t                      t                      }}|                                 }|                    ||d          }|                     |           d S r   )r   r   r  r!  )r3   r  r  r  r  s        r   !test_adapter_hook_miss_no_defaultz9LookupBaseFallbackTests.test_adapter_hook_miss_no_default  sO    88VXXS]]__S"--%     r   c                     t                      t                      t                      }}}|                                 }|                    ||d|          }|                     ||           d S r   )r   r   r  r   )r3   r  r  r  r  r  s         r    test_adapter_hook_miss_w_defaultz8LookupBaseFallbackTests.test_adapter_hook_miss_w_default  sY    #XXvxx(S]]__S"h77eX&&&&&r   c                 ,   g fdfd}t                      t                      t                      }}}|                     |          }|                    ||d|          }|                     ||           |                     |g           d S )Nc                 2                         |            d S r/   r  context_f_called_withs    r   _factoryzTLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._factory  s    !!'*****r   c                     S r/   r   r3   rc  rr   r4   r  s       r   rw  zSLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._lookup      Or   ry  r  r   r   r  r   r   )	r3   rw  r  r  r  r  adaptedr  r  s	          @@r   *test_adapter_hook_hit_factory_returns_NonezBLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None  s    	+ 	+ 	+ 	+ 	+	 	 	 	 	 $XXvxx(S]]W]--//#sC::gx(((#/////r   c                 L  	 g t                      fd		fd}t                      t                      t                      }}}|                     |          }|                    ||d|          }|                     |           |                     |g           d S )Nc                 2                         |            S r/   r  r  _adapterr  s    r   r  zWLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._factory      !!'***Or   c                     S r/   r   r  s       r   rw  zVLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._lookup  r  r   ry  r  r  
r3   rw  r  r  r  r  r  r  r  r  s
          @@@r   -test_adapter_hook_hit_factory_returns_adapterzELookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter      88	 	 	 	 	 		 	 	 	 	 $XXvxx(S]]W]--//#sC::gx(((#/////r   c                    g fddfd	}t                      }t                      }|                     |          }|                    ||          }|                     ||            |                     | g           d S )Nc                 2                         |            | S r/   r  r  s    r   r  zILookupBaseFallbackTests.test_adapter_hook_super_unwraps.<locals>._factory  s    !!'***Nr   r   c                     S r/   r   r  s       r   rw  zHLookupBaseFallbackTests.test_adapter_hook_super_unwraps.<locals>._lookup  r  r   ry  )r   )superr   r   r  r   r   )	r3   rw  rc  rr   r  r  r  r  	__class__s	         @@r   test_adapter_hook_super_unwrapsz7LookupBaseFallbackTests.test_adapter_hook_super_unwraps  s    	 	 	 	 		 	 	 	 	 	 7788]]W]--//(H55gt$$$$00000r   c                 L  	 g t                      fd		fd}t                      t                      t                      }}}|                     |          }|                    ||d|          }|                     |           |                     |g           d S )Nc                 2                         |            S r/   r  r  s    r   r  z;LookupBaseFallbackTests.test_queryAdapter.<locals>._factory  r  r   c                     S r/   r   r  s       r   rw  z:LookupBaseFallbackTests.test_queryAdapter.<locals>._lookup  r  r   ry  r  )r   r   queryAdapterr   r   r  s
          @@@r   test_queryAdapterz)LookupBaseFallbackTests.test_queryAdapter  r  r   c                 8   g t                      t                      t                      gfd}|                     |          }|                    dd          }|                     |t	                               |                     dg           d S )Nc                 P                         ||f           t                    S r/   rU   ry   r3   rc  rr   r  r  s      r   
_lookupAllzCLookupBaseFallbackTests.test_lookupAll_uncached.<locals>._lookupAll  (    8 4555??"r   rj  r{  r|  rz  r|  r   r   	lookupAllr   ry   r3   r  r  r  r  r  s       @@r   test_lookupAll_uncachedz/LookupBaseFallbackTests.test_lookupAll_uncached  s    HHfhh1	# 	# 	# 	# 	# 	# ]]
]33S#&&h00077777r   c                 d   g t                      t                      t                      gfd}|                     |          }|                    dd          }|                    dd          }|                     |t	                               |                     dg           d S )Nc                 P                         ||f           t                    S r/   r  r  s      r   r  zALookupBaseFallbackTests.test_lookupAll_cached.<locals>._lookupAll  r  r   r  r{  r|  r  r  r  s       @@r   test_lookupAll_cachedz-LookupBaseFallbackTests.test_lookupAll_cached  s    HHfhh1	# 	# 	# 	# 	# 	# ]]
]33S#&&S#&&h00077777r   c                 8   g t                      t                      t                      gfd}|                     |          }|                    dd          }|                     |t	                               |                     dg           d S )Nc                 P                         ||f           t                    S r/   r  r  s      r   _subscriptionszKLookupBaseFallbackTests.test_subscriptions_uncached.<locals>._subscriptions  r  r   rm  r{  r|  r  r   r   subscriptionsr   ry   r3   r  r  r  r  r  s       @@r   test_subscriptions_uncachedz3LookupBaseFallbackTests.test_subscriptions_uncached  s    HHfhh1	# 	# 	# 	# 	# 	# ]]N];;  c**h00077777r   c                 d   g t                      t                      t                      gfd}|                     |          }|                    dd          }|                    dd          }|                     |t	                               |                     dg           d S )Nc                 P                         ||f           t                    S r/   r  r  s      r   r  zILookupBaseFallbackTests.test_subscriptions_cached.<locals>._subscriptions'  r  r   r   r{  r|  r  r  r  s       @@r   test_subscriptions_cachedz1LookupBaseFallbackTests.test_subscriptions_cached#  s    HHfhh1	# 	# 	# 	# 	# 	# ]]N];;  c**  c**h00077777r   NNN)!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  r  r  r  __classcell__r  s   @r   r\  r\    s       " " " (O CG   4- - -	= 	= 	=
= 
= 
=+ + ++ + + + + ++ + + ( ( ($+ + +	= 	= 	=
= 
= 
== = =+ + ++ + + ( ( ($0 0 0! ! !' ' '0 0 00 0 0"1 1 1 1 1"0 0 0"8 8 88 8 88 8 88 8 8 8 8 8 8r   r\  c                       e Zd Zd ZdS )LookupBaseTestsc                     ddl m} |S )Nr   )
LookupBase)ra   r  )r3   r  s     r   r   zLookupBaseTests._getTargetClass5  s    555555r   Nr
   r   r   r   r   r   r   r  r  2  s#            r   r  c                   N    e Zd Zd ZeZ	 	 ddZd Zd Zd Zd Z	d Z
d	 Zd
 ZdS )VerifyingBaseFallbackTestsc                     ddl m} |S )Nr   )VerifyingBaseFallback)ra   r  )r3   r  s     r   r_  z,VerifyingBaseFallbackTests._getFallbackClass<  s    @@@@@@$$r   Nc                     d d d  G fdd|                                            } ||          }|                    |           |S )Nc                     t                      r/   rg  rb  s       r   rd  z6VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupG  rk  r   c                     t                      r/   rg  ri  s      r   rj  z9VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupAllL  rk  r   c                     t                      r/   rg  ri  s      r   rm  z=VerifyingBaseFallbackTests._makeOne.<locals>.uc_subscriptionsQ  rk  r   c                   ,     e Zd ZZZZ fdZ xZS )4VerifyingBaseFallbackTests._makeOne.<locals>.Derivedc                 V    t                                                       || _        d S r/   )r  rO   	_registry)r3   r   r  s     r   rO   z=VerifyingBaseFallbackTests._makeOne.<locals>.Derived.__init__Y  s$      """!)r   )r
   r   r   rp  rq  rr  rO   r	  )r  rd  rj  rm  s   @r   rs  r  T  sK        (".&6#* * * * * * * * *r   rs  )r   rn   )r3   r   rd  rj  rm  rs  deriveds     ```  r   r   z#VerifyingBaseFallbackTests._makeOneB  s     , , , , , , #, , ,	* 	* 	* 	* 	* 	* 	* 	* 	*d**,, 	* 	* 	* '(##   r   c                 R     G d d           G fdd          } ||          S )Nc                       e Zd ZdZdS )@VerifyingBaseFallbackTests._makeRegistry.<locals>.WithGenerationr   N)r
   r   r   r   r   r   r   WithGenerationr  c  s        KKKr   r   c                       e Zd Z fdZdS ):VerifyingBaseFallbackTests._makeRegistry.<locals>.Registryc                 H    fdt          |          D             | _        d S )Nc                 $    g | ]}             S r   r   )rv   ir   s     r   rx   zWVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__.<locals>.<listcomp>h  s!    BBB>>++BBBr   )rangero)r3   depthr   s     r   rO   zCVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__g  s(    BBBBU5\\BBBr   NrP   )r   s   r   Registryr"  f  s5        C C C C C C Cr   r)  r   )r3   r(  r)  r   s      @r   _makeRegistryz(VerifyingBaseFallbackTests._makeRegistrya  sw    	 	 	 	 	 	 	 		C 	C 	C 	C 	C 	C 	C 	C 	C 	C xr   c                   	 g t                      t                      t                      }}}|||g		fd}|                     d          }|                     ||          }|                    ddd          }|                    ddd          }|                     ||           |                     dg           |                     	||g           |j        d         xj        dz  c_        |                    ddd          }|                     ||           |                     ddg           |                     	|g           d S )	Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  z7VerifyingBaseFallbackTests.test_lookup.<locals>._lookupq  r  r   r   ry  rz  r|  r  r  r   )r   r*  r   r}  r   r   r'  r   
r3   r  r  r  rw  ri   r  r  r  r  s
           @@r   test_lookupz&VerifyingBaseFallbackTests.test_lookupl  sn   ((FHHfhha1q!9	# 	# 	# 	# 	# 	#   ##]]3']22		&#s++		&#s++eQ(:';<<<Aq6***q	"		&#s++eQ,.@A	C 	C 	CA3'''''r   c                   	 g t                      t                      t                      }}}|||g		fd}|                     d          }|                     ||          }|                    ddd          }|                    ddd          }|                     ||           |                     dg           |                     	||g           |j        d         xj        dz  c_        |                    ddd          }|                     ||           |                     ddg           |                     	|g           d S )	Nc                 ^                         |||f                               d          S r9  r  r  s       r   rw  z8VerifyingBaseFallbackTests.test_lookup1.<locals>._lookup  r  r   r   ry  r{  r|  r  r  r   )r   r*  r   r  r   r   r'  r   r-  s
           @@r   test_lookup1z'VerifyingBaseFallbackTests.test_lookup1  sn   ((FHHfhha1q!9	# 	# 	# 	# 	# 	#   ##]]3']22

3S))

3S))eQ(:';<<<Aq6***q	"

3S))eQ,.@A	C 	C 	CA3'''''r   c                     t                      t                      t                      g\  }fd}fd} fd}|||gfd}t                      t                      t                      }}}                     d          }	                     |	|          }
|
                    ||d|          }                     |           |
                    ||d|          }                     |           |	j        d         xj        dz  c_        |
                    ||d|          }                     |           d S )	Nc                     S r/   r   r  r  s    r   	_factory1z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory1      Hr   c                     S r/   r   r  r  s    r   	_factory2z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory2  r6  r   c                 2                         d           d S rv  r5  r  r3   s    r   	_factory3z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory3      II344444r   c                 .                         d          S r9  r  r3   rc  rr   r4   
_factoriess       r   rw  z=VerifyingBaseFallbackTests.test_adapter_hook.<locals>._lookup      >>!$$$r   r   ry  r  r   )r   r*  r   r  r   r'  r   r3   _cr5  r9  r<  rw  r  r  r  ri   r  r  rA  r  r  s   `           @@@r   test_adapter_hookz,VerifyingBaseFallbackTests.test_adapter_hook  z   HHfhh11b	 	 	 	 		 	 	 	 		5 	5 	5 	5 	5  I6
	% 	% 	% 	% 	% $XXvxx(S  ##]]3']22//#sC::gq!!!//#sC::gq!!!q	"//#sC::gq!!!!!r   c                     t                      t                      t                      g\  }fd}fd} fd}|||gfd}t                      t                      t                      }}}                     d          }	                     |	|          }
|
                    ||d|          }                     |           |
                    ||d|          }                     |           |	j        d         xj        dz  c_        |
                    ||d|          }                     |           d S )	Nc                     S r/   r   r4  s    r   r5  z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory1  r6  r   c                     S r/   r   r8  s    r   r9  z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory2  r6  r   c                 2                         d           d S rv  r5  r;  s    r   r<  z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory3  r=  r   c                 .                         d          S r9  r?  r@  s       r   rw  z=VerifyingBaseFallbackTests.test_queryAdapter.<locals>._lookup  rB  r   r   ry  r  r   )r   r*  r   r  r   r'  r   r  rC  s   `           @@@r   r  z,VerifyingBaseFallbackTests.test_queryAdapter  rF  r   c                    t                      t                      t                      g}t                      t                      t                      g}||gfd}|                     d          }|                     ||          }|                    dd          }|                     |t          |                     |                    dd          }|                     |t          |                     |j        d         xj        dz  c_        |                    dd          }|                     |t          |                     d S )Nc                 H    t                              d                    S r9  ry   r  r3   rc  rr   r  s      r   r  z=VerifyingBaseFallbackTests.test_lookupAll.<locals>._lookupAll      a)))r   r   r  r{  r|  r   )r   r*  r   r  r   ry   r'  r   )r3   
_results_1
_results_2r  ri   r  r  r  s          @r   test_lookupAllz)VerifyingBaseFallbackTests.test_lookupAll  s3   hh&((3
hh&((3

+	* 	* 	* 	* 	*   ##]]3Z]88S#&&j 1 1222S#&&j 1 1222q	"S#&&j 1 122222r   c                    t                      t                      t                      g}t                      t                      t                      g}||gfd}|                     d          }|                     ||          }|                    dd          }|                     |t          |                     |                    dd          }|                     |t          |                     |j        d         xj        dz  c_        |                    dd          }|                     |t          |                     d S )Nc                 H    t                              d                    S r9  rN  rO  s      r   r  zEVerifyingBaseFallbackTests.test_subscriptions.<locals>._subscriptions  rP  r   r   r   r{  r|  r   )r   r*  r   r  r   ry   r'  r   )r3   rQ  rR  r  ri   r  r  r  s          @r   test_subscriptionsz-VerifyingBaseFallbackTests.test_subscriptions  s9   hh&((3
hh&((3

+	* 	* 	* 	* 	*   ##]]3]@@  c**j 1 1222  c**j 1 1222q	"  c**j 1 122222r   r  )r
   r   r   r_  r   r   r*  r.  r1  rE  r  rS  rV  r   r   r   r  r  :  s        % % % (O>B"&   >	 	 	( ( (.( ( (." " "8" " "83 3 3$3 3 3 3 3r   r  c                       e Zd Zd ZdS )VerifyingBaseTestsc                     ddl m} |S )Nr   )VerifyingBase)ra   rZ  )r3   rZ  s     r   r   z"VerifyingBaseTests._getTargetClass  s    888888r   Nr  r   r   r   rX  rX    s#            r   rX  c                        e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z fdZd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z' xZ(S )&AdapterLookupBaseTestsc                     ddl m} |S )Nr   )AdapterLookupBase)ra   r^  )r3   r^  s     r   r   z&AdapterLookupBaseTests._getTargetClass  s    <<<<<<  r   c                 <     |                                  |          S r/   r   r   s     r   r   zAdapterLookupBaseTests._makeOne  s    %t##%%h///r   c                 0     G d d          } |            S )Nc                       e Zd Zd ZdS )<AdapterLookupBaseTests._makeSubregistry.<locals>.Subregistryc                 "    g | _         g | _        d S r/   )r   r   r=   s    r   rO   zEAdapterLookupBaseTests._makeSubregistry.<locals>.Subregistry.__init__  s    !#$&!!!r   NrP   r   r   r   Subregistryrb  
  s#        ' ' ' ' 'r   rd  r   )r3   rr   rd  s      r   _makeSubregistryz'AdapterLookupBaseTests._makeSubregistry  s8    	' 	' 	' 	' 	' 	' 	' 	'
 {}}r   c                 2     G d d          } ||          S )Nc                       e Zd Zd ZdS )6AdapterLookupBaseTests._makeRegistry.<locals>.Registryc                 "    || _         g | _        d S r/   )r   r'  rq   s     r   rO   z?AdapterLookupBaseTests._makeRegistry.<locals>.Registry.__init__  s    !)r   NrP   r   r   r   r)  rh    s#            r   r)  r   )r3   rr   r)  s      r   r*  z$AdapterLookupBaseTests._makeRegistry  s<    	 	 	 	 	 	 	 	
 x!!!r   c                     |                                  }|                     |          }|                     |j        i            d S r/   )r*  r   r   rp   )r3   r   albs      r   test_ctor_empty_registryz/AdapterLookupBaseTests.test_ctor_empty_registry  sB    %%''mmH%%,,,,,r   c                 <   ddl m} ddlm}  |d          } |d|f          }|                     ||          }|                     |          }|                     t          |j        	                                          t          |||g                     |                     |j        |         ||g           |                     |j        |         |g           |                     t          |j        |                   t          ||g                     d S Nr   r   InterfaceClassIFooIBar)
r*   r   zope.interface.interfacerp  r*  r   r   r   rp   keysr3   r   rp  rq  rr  r   rk  s          r   test_ctor_w_registry_providedz4AdapterLookupBaseTests.test_ctor_w_registry_provided  s2   ,,,,,,;;;;;;~f%%~ftg..%%dD11mmH%% 3 3 5 566tY 788	: 	: 	:-d|<<<-v666y 9::t--	/ 	/ 	/ 	/ 	/r   c                      G d d          } G d d|                                  |          }|                                 } ||          }|                    |           d S )Nc                       e Zd Zd ZdS )AAdapterLookupBaseTests.test_changed_empty_required.<locals>.Mixinc                     d S r/   r   rC   s     r   rn   zIAdapterLookupBaseTests.test_changed_empty_required.<locals>.Mixin.changed1  re  r   Nr
   r   r   rn   r   r   r   Mixinry  0  #            r   r|  c                       e Zd ZdS )CAdapterLookupBaseTests.test_changed_empty_required.<locals>.DerivedNr	   r   r   r   rs  r  4  r   r   rs  )r   r*  rn   )r3   r|  rs  r   rk  s        r   test_changed_empty_requiredz2AdapterLookupBaseTests.test_changed_empty_required-  s    	 	 	 	 	 	 	 		 	 	 	 	d**,,e 	 	 	 %%''ghCr   c                     G d d          } G d d|                                  |          } G d d          } |d          } |d          }|                                 } ||          }d	|j        |<   d	|j        |<   |                    |           |                     t          |j                  d
           |                     |j        d            |                     |j        |           d S )Nc                       e Zd Zd ZdS )=AdapterLookupBaseTests.test_changed_w_required.<locals>.Mixinc                     d S r/   r   rC   s     r   rn   zEAdapterLookupBaseTests.test_changed_w_required.<locals>.Mixin.changed?  re  r   Nr{  r   r   r   r|  r  >  r}  r   r|  c                       e Zd ZdS )?AdapterLookupBaseTests.test_changed_w_required.<locals>.DerivedNr	   r   r   r   rs  r  B  r   r   rs  c                   $    e Zd ZdZd Zd Zd ZdS )CAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakrefNc                     || _         d S r/   _here)r3   heres     r   rO   zLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__init__H  s    !


r   c                     | j         r| nd S r/   r  r=   s    r   __call__zLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__call__K  s    #z3ttt3r   c                     || _         d S r/   )_unsub)r3   targets     r   r  zOAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.unsubscribeN  s    $r   )r
   r   r   r  rO   r  r  r   r   r   FauxWeakrefr  E  sF        F" " "4 4 4% % % % %r   r  FTr   r   )r   r*  	_requiredrn   r   r<   r  )r3   r|  rs  r  goner  r   rk  s           r   test_changed_w_requiredz.AdapterLookupBaseTests.test_changed_w_required;  sJ   	 	 	 	 	 	 	 		 	 	 	 	d**,,e 	 	 	
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% {5!!{4  %%''ghddCS]++Q///d+++c*****r   c                 r   ddl m} ddlm}  |d          } |d|f          }|                                 }|                     |          }||g|_        |                                 |                     t          |j
                                                  t          |||g                     |                     |j
        |         ||g           |                     |j
        |         |g           |                     t          |j
        |                   t          ||g                     d S rn  )r*   r   rs  rp  r*  r   r   init_extendorsr   r   rp   rt  ru  s          r   )test_init_extendors_after_registry_updatez@AdapterLookupBaseTests.test_init_extendors_after_registry_update\  sL   ,,,,,,;;;;;;~f%%~ftg..%%''mmH%%"D\ 3 3 5 566tY 788	: 	: 	:-d|<<<-v666y 9::t--	/ 	/ 	/ 	/ 	/r   c                    ddl m} ddlm}  |d          } |d|f          }|                                 }|                     |          }|                    |           |                    |           |                     t          |j	        
                                          t          |||g                     |                     |j	        |         ||g           |                     |j	        |         |g           |                     t          |j	        |                   t          ||g                     d S rn  )r*   r   rs  rp  r*  r   rs   r   r   rp   rt  ru  s          r   test_add_extendorz(AdapterLookupBaseTests.test_add_extendorl  sV   ,,,,,,;;;;;;~f%%~ftg..%%''mmH%% 3 3 5 566tY 788	: 	: 	:-d|<<<-v666y 9::t--	/ 	/ 	/ 	/ 	/r   c                 b   ddl m} ddlm}  |d          } |d|f          }|                     ||          }|                     |          }|                    |           |                     t          |j	        
                                          t          |||g                     |                     |j	        |         |g           |                     |j	        |         |g           |                     t          |j	        |                   t          |g                     d S rn  )r*   r   rs  rp  r*  r   rz   r   r   rp   rt  ru  s          r   test_remove_extendorz+AdapterLookupBaseTests.test_remove_extendor|  s@   ,,,,,,;;;;;;~f%%~ftg..%%dD11mmH%%D!!! 3 3 5 566tY 788	: 	: 	:-v666-v666y 9::	) 	) 	) 	) 	)r   c                    ddl m}  |d          } |d|f          }|                                 }|                     |          }|                    |f|          }|                     |d            |                     t          |j                  d           |                     |	                                |j                   d S Nr   ro  rq  rr  r   )
rs  rp  r*  r   rp  r   r<   r  r   weakrefr3   rp  rq  rr  r   rk  results          r   test__uncached_lookup_empty_roz5AdapterLookupBaseTests.test__uncached_lookup_empty_ro  s    ;;;;;;~f%%~ftg..%%''mmH%%%%tgt44&&&S]++Q///dllnncm44444r   c                 N   ddl m}  |d          } |d|f          }|                     ||          }|                                 }|j                            |           |                     |          }|                    |f|          }|                     |d            d S Nr   ro  rq  rr  )	rs  rp  r*  re  r'  rU   r   rp  r   r3   rp  rq  rr  r   subrrk  r  s           r    test__uncached_lookup_order_missz7AdapterLookupBaseTests.test__uncached_lookup_order_miss  s    ;;;;;;~f%%~ftg..%%dD11$$&&4   mmH%%%%tgt44&&&&&r   c                 j   ddl m}  |d          } |d|f          }|                                 }|                                 }i i g|_        |j                            |           |                     |          }||_        |	                    |f|          }| 
                    |d            d S r  )rs  rp  r*  re  r   r'  rU   r   r   rp  r   r  s           r   $test__uncached_lookup_extendors_missz;AdapterLookupBaseTests.test__uncached_lookup_extendors_miss  s    ;;;;;;~f%%~ftg..%%''$$&&b4   mmH%%%%tgt44&&&&&r   c                    ddl m}  |d          } |d|f          } |d          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }	|                     |	d            d S Nr   ro  rq  rr  IQuxr   rs  rp  r*  re  r   r   r'  rU   r   r   rp  r   
r3   rp  rq  rr  r  r   r  
irrelevantrk  r  s
             r   1test__uncached_lookup_components_miss_wrong_ifacezHAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_iface  s    ;;;;;;~f%%~ftg..~f%%%%dD11$$&&XX
2z*
 	4   mmH%%%%tgt44&&&&&r   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }|                     |d            d S Nr   ro  rq  rr  	wrongnamer  	r3   rp  rq  rr  r   r  r  rk  r  s	            r   0test__uncached_lookup_components_miss_wrong_namezGAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_name  s    ;;;;;;~f%%~ftg..%%dD11$$&&HH	;	2
 	4   mmH%%%%tgt44&&&&&r   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }|                     ||           d S Nr   ro  rq  rr  r   rs  rp  r*  re  r   r   r'  rU   r   r   rp  r   )	r3   rp  rq  rr  r   r  	_expectedrk  r  s	            r    test__uncached_lookup_simple_hitz7AdapterLookupBaseTests.test__uncached_lookup_simple_hit  s    ;;;;;;~f%%~ftg..%%dD11$$&&HH	D2y/*+
 	4   mmH%%%%tgt44fi(((((r   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }|
                    |f|          }	|                     ||           |                     |	|           d S r  r  )
r3   rp  rq  rr  r   r  r  rk  r  result2s
             r   "test__uncached_lookup_repeated_hitz9AdapterLookupBaseTests.test__uncached_lookup_repeated_hit  s   ;;;;;;~f%%~ftg..%%dD11$$&&HH	D2y/*+
 	4   mmH%%%%tgt44&&w55fi(((gy)))))r   c                    ddl m} ddlm}  |d          } |d|f          } ||           G d d                      } |            }|                                 }|                                 }i i g|_        |j                            |           | 	                    |          }	|	j
        |	_        |	|_        t                      }
|	                    |f||
          }|                     ||
           d S )	Nr   implementerro  rq  rr  c                       e Zd ZdS )FAdapterLookupBaseTests.test_queryMultiAdaptor_lookup_miss.<locals>.FooNr	   r   r   r   Foor            Dr   r  default)zope.interface.declarationsr  rs  rp  r*  re  r   r'  rU   r   rp  r}  r   r   queryMultiAdapterr   )r3   r  rp  rq  rr  r  foor   r  rk  r  r  s               r   "test_queryMultiAdaptor_lookup_missz9AdapterLookupBaseTests.test_queryMultiAdaptor_lookup_miss   s<   ;;;;;;;;;;;;~f%%~ftg..	T			 	 	 	 	 	 	 
		 cee%%''$$&&
 	4   mmH%%)
88&&vtX&FFfh'''''r   c                     ddl m} ddlm}  |d          |                                 }|                     |          j        _        fd}|                    | |d           d S )Nr   ro  )MissingSomeAttrsrq  c                 2                         | f          S r/   )r  )obrq  rk  s    r   testzVAdapterLookupBaseTests.test_queryMultiAdapter_errors_on_attribute_access.<locals>.test'  s#    ((  r   r  )expected_missing)	rs  rp  zope.interface.testsr  r*  r   rp  r}  test_raises)r3   rp  r  r   r  rq  rk  s        @@r   1test_queryMultiAdapter_errors_on_attribute_accesszHAdapterLookupBaseTests.test_queryMultiAdapter_errors_on_attribute_access  s     	<;;;;;999999~f%%%%''mmH%%)
	 	 	 	 	 	 	$$T4+$NNNNNr   c                 L   ddl m} ddlm}  |d          } |d|f          } ||           G d d                      } |            }|                     ||          }|                                 }g fd}	i ||d	|	iiig|_        |j                            |           | 	                    |          }
|
j
        |
_        |
|_        t                      }|
                    |f||
          }|                     ||           |                     |g           d S )Nr   r  ro  rq  rr  c                       e Zd ZdS )GAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>.FooNr	   r   r   r   r  r  5  r  r   r  c                 2                         |            d S r/   r  )r  r  s    r   r  zLAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>._factory>  s    (((((r   r   r  )r  r  rs  rp  r*  re  r   r'  rU   r   rp  r}  r   r   r  r   r   )r3   r  rp  rq  rr  r  r  r   r  r  rk  r  r  r  s                @r   #test_queryMultiAdaptor_factory_missz:AdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss/  s   ;;;;;;;;;;;;~f%%~ftg..	T			 	 	 	 	 	 	 
		 cee%%dD11$$&&	) 	) 	) 	) 	) D2x.)*
 	4   mmH%%)
88&&vtX&FFfh'''u-----r   c                 l   ddl m} ddlm}  |d          } |d|f          } ||           G d d                      } |            }|                     ||          }|                                 }t                      g fd}	i ||d	|	iiig|_        |j        	                    |           | 
                    |          }
|
j        |
_        |
|_        t                      }|
                    |f||
          }|                     |           |                     |g           d S )Nr   r  ro  rq  rr  c                       e Zd ZdS )FAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>.FooNr	   r   r   r   r  r  T  r  r   r  c                 2                         |            S r/   r  )r  r  r  s    r   r  zKAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>._factory^  s    (((r   r   r  )r  r  rs  rp  r*  re  r   r   r'  rU   r   rp  r}  r   r  r   r   )r3   r  rp  rq  rr  r  r  r   r  r  rk  r  r  r  r  s                @@r   "test_queryMultiAdaptor_factory_hitz9AdapterLookupBaseTests.test_queryMultiAdaptor_factory_hitN  s   ;;;;;;;;;;;;~f%%~ftg..	T			 	 	 	 	 	 	 
		 cee%%dD11$$&&HH		 	 	 	 	 	
 D2x.)*
 	4   mmH%%)
88&&vtX&FFfi(((u-----r   c                    |                      |                                           }fd}d ||_        t                      ddt                      g}|                    |d           }|                     || dd| f           d S )Nc                      S r/   r   )r   factorys    r   r}  zKAdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps.<locals>.lookupr  s    Nr   c                      | S r/   r   )r   s    r   r  zLAdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps.<locals>.factoryu  s    Kr   *   abc)r   r*  r}  r  r  r   )r3   rk  r}  objectsr  r  r  s        @r   $test_queryMultiAdapter_super_unwrapsz;AdapterLookupBaseTests.test_queryMultiAdapter_super_unwrapso  s    mmD..0011	 	 	 	 		 	 	 
 GGGG	
 &&w55	"
 	 	 	 	 	r   c                    ddl m}  |d          } |d|f          }|                                 }|                     |          }|                    |f|          }|                     |d           |                     t          |j                  d           |                     |	                                |j                   d S )Nr   ro  rq  rr  r   r   )
rs  rp  r*  r   rq  r   r<   r  r   r  r  s          r   !test__uncached_lookupAll_empty_roz8AdapterLookupBaseTests.test__uncached_lookupAll_empty_ro  s    ;;;;;;~f%%~ftg..%%''mmH%%(($$77$$$S]++Q///dllnncm44444r   c                 \   ddl m}  |d          } |d|f          }|                     ||          }|                                 }|j                            |           |                     |          }||_        |                    |f|          }| 	                    |d           d S Nr   ro  rq  rr  r   )
rs  rp  r*  re  r'  rU   r   r   rq  r   r  s           r   #test__uncached_lookupAll_order_missz:AdapterLookupBaseTests.test__uncached_lookupAll_order_miss  s    ;;;;;;~f%%~ftg..%%dD11$$&&4   mmH%%(($$77$$$$$r   c                 j   ddl m}  |d          } |d|f          }|                                 }|                                 }i i g|_        |j                            |           |                     |          }||_        |	                    |f|          }| 
                    |d           d S r  )rs  rp  r*  re  r   r'  rU   r   r   rq  r   r  s           r   'test__uncached_lookupAll_extendors_missz>AdapterLookupBaseTests.test__uncached_lookupAll_extendors_miss  s    ;;;;;;~f%%~ftg..%%''$$&&b4   mmH%%(($$77$$$$$r   c                    ddl m}  |d          } |d|f          } |d          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }	|                     |	d           d S )Nr   ro  rq  rr  r  r   r   )rs  rp  r*  re  r   r   r'  rU   r   r   rq  r   r  s
             r   (test__uncached_lookupAll_components_missz?AdapterLookupBaseTests.test__uncached_lookupAll_components_miss  s    ;;;;;;~f%%~ftg..~f%%%%dD11$$&&XX
D2z*+,
 	4   mmH%%(($$77$$$$$r   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 }t	                      }t	                      }i ||||diig|_        |j                            |           |                     |          }||_	        |
                    |f|          }	|                     t          |	          d|fd|fg           d S Nr   ro  rq  rr  )r   namedr   r  )rs  rp  r*  re  r   r   r'  rU   r   r   rq  r   r   
r3   rp  rq  rr  r   r  r  _namedrk  r  s
             r   #test__uncached_lookupAll_simple_hitz:AdapterLookupBaseTests.test__uncached_lookupAll_simple_hit  s   ;;;;;;~f%%~ftg..%%dD11$$&&HH	Dy6::;<
 	4   mmH%%(($$772y/GV;L)MNNNNNr   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 }t	                      }t	                      }i ||||diig|_        |j                            |           |                     |          }|j	        |_
        ||_        |                    |f|          }	|                     t          |	          ddg           d S r  )rs  rp  r*  re  r   r   r'  rU   r   rq  r  r   namesr   r   r  s
             r   
test_namesz!AdapterLookupBaseTests.test_names  s   ;;;;;;~f%%~ftg..%%dD11$$&&HH	Dy6::;<
 	4   mmH%%/D7D))"g77777r   c                    ddl m}  |d          } |d|f          }|                                 }|                     |          }|                    |f|          }|                     |g            |                     t          |j                  d           |                     |	                                |j                   d S r  )
rs  rp  r*  r   rr  r   r<   r  r   r  r  s          r   %test__uncached_subscriptions_empty_roz<AdapterLookupBaseTests.test__uncached_subscriptions_empty_ro  s    ;;;;;;~f%%~ftg..%%''mmH%%,,dWd;;$$$S]++Q///dllnncm44444r   c                 \   ddl m}  |d          } |d|f          }|                     ||          }|                                 }|j                            |           |                     |          }||_        |                    |f|          }| 	                    |g            d S r  )
rs  rp  r*  re  r'  rU   r   r   rr  r   r  s           r   'test__uncached_subscriptions_order_missz>AdapterLookupBaseTests.test__uncached_subscriptions_order_miss  s    ;;;;;;~f%%~ftg..%%dD11$$&&4   mmH%%,,dWd;;$$$$$r   c                 j   ddl m}  |d          } |d|f          }|                                 }|                                 }i i g|_        |j                            |           |                     |          }||_        |	                    |f|          }| 
                    |g            d S r  )rs  rp  r*  re  r   r'  rU   r   r   rr  r   r  s           r   +test__uncached_subscriptions_extendors_misszBAdapterLookupBaseTests.test__uncached_subscriptions_extendors_miss  s    ;;;;;;~f%%~ftg..%%''$$&&H4   mmH%%,,dWd;;$$$$$r   c                    ddl m}  |d          } |d|f          } |d          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }	|                     |	g            d S r  rs  rp  r*  re  r   r   r'  rU   r   r   rr  r   r  s
             r   8test__uncached_subscriptions_components_miss_wrong_ifacezOAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_iface  s    ;;;;;;~f%%~ftg..~f%%%%dD11$$&&XX
D2z*+,
 	4   mmH%%,,dWd;;$$$$$r   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 }t	                      }i ||d|iiig|_        |j                            |           |                     |          }||_	        |
                    |f|          }|                     |g            d S r  r  r  s	            r   7test__uncached_subscriptions_components_miss_wrong_namezNAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_name  s    ;;;;;;~f%%~ftg..%%dD11$$&&HH	D;	234
 	4   mmH%%,,dWd;;$$$$$r   c                    ddl m}  |d          } |d|f          }|                     ||          }|                                 } G d d          } |             |            }}i ||d||fiiig|_        |j                            |           |                     |          }	|	|_        |		                    |f|          }
| 
                    t          |
          t          ||g                     d S )Nr   ro  rq  rr  c                       e Zd Zd ZdS )KAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.Fooc                     dS )NTr   rC   s     r   __lt__zRAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.Foo.__lt__4  s    tr   N)r
   r   r   r  r   r   r   r  r  2  s#            r   r  r   )rs  rp  r*  re  r   r'  rU   r   r   rr  r   r   )r3   rp  rq  rr  r   r  r  _exp1_exp2rk  r  s              r   'test__uncached_subscriptions_simple_hitz>AdapterLookupBaseTests.test__uncached_subscriptions_simple_hit+  s3   ;;;;;;~f%%~ftg..%%dD11$$&&	 	 	 	 	 	 	 	
 suucceeuD2u~./0
 	4   mmH%%,,dWd;;)?)?@@@@@r   c                 n   ddl m} ddlm}  |d          } |d|f          } ||           G d d                      } |            }|                     ||          }|                     ||          }|                                 }i fd}	fd	}
i |d d
|	|
fiiig|_        |j                            |           | 	                    |          }|j
        |_        ||_        |                    |fd           }|                     |d           |                     |g|gd           d S )Nr   r  ro  rq  rr  c                       e Zd ZdS )@AdapterLookupBaseTests.test_subscribers_wo_provided.<locals>.FooNr	   r   r   r   r  r  H  r  r   r  c                 Z                         dg                               |            d S Nr5  
setdefaultrU   r  _calleds    r   r5  zFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory1R  -    {B//66w?????r   c                 Z                         dg                               |            d S Nr9  r  r  s    r   r9  zFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory2U  r  r   r   r   )r5  r9  )r  r  rs  rp  r*  re  r   r'  rU   r   rr  r  r   subscribersr   )r3   r  rp  rq  rr  r  r  r   r  r5  r9  rk  r  r  s                @r   test_subscribers_wo_providedz3AdapterLookupBaseTests.test_subscribers_wo_providedB  s   ;;;;;;;;;;;;~f%%~ftg..	T			 	 	 	 	 	 	 
		 cee%%dD11%%dD11$$&&	@ 	@ 	@ 	@ 	@	@ 	@ 	@ 	@ 	@ D2	95678
 	4   mmH%%7#..$$$SE"J"JKKKKKr   c                    ddl m} ddlm}  |d          } |d|f          } ||           G d d                      } |            }|                     ||          }|                     ||          }|                                 }i t                      t                      cfd}	fd	}
fd
}i ||d|	|
|fiiig|_        |j        	                    |           | 
                    |          }|j        |_        ||_        |                    |f|          }|                     |g           |                     |g|g|gd           d S )Nr   r  ro  rq  rr  c                       e Zd ZdS )?AdapterLookupBaseTests.test_subscribers_w_provided.<locals>.FooNr	   r   r   r   r  r  j  r  r   r  c                 Z                         dg                               |            S r  r  )r  r  r  s    r   r5  zEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory1u  ,    {B//66w???Lr   c                 Z                         dg                               |            S r  r  )r  r  r	  s    r   r9  zEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory2y  r  r   c                 Z                         dg                               |            d S )N_side_effect_onlyr  r  s    r   r   zMAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._side_effect_only}  s.    2B77>>wGGGGGr   r   )r5  r9  r   )r  r  rs  rp  r*  re  r   r   r'  rU   r   rr  r  r   r  r   )r3   r  rp  rq  rr  r  r  r   r  r5  r9  r   rk  r  r  r  r	  s                 @@@r   test_subscribers_w_providedz2AdapterLookupBaseTests.test_subscribers_w_providedd  s   ;;;;;;;;;;;;~f%%~ftg..	T			 	 	 	 	 	 	 
		 cee%%dD11%%dD11$$&&xxu	 	 	 	 	 		 	 	 	 	 		H 	H 	H 	H 	H D2	96GHIJK
 	4   mmH%%7#..%000!U!U&)U 	
 	
 	
 	
 	
r   ))r
   r   r   r   r   re  r*  rl  rv  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
  r  r!  r	  r
  s   @r   r\  r\    sc       ! ! !0 0 0  " " "- - -
/ / /  + + +B/ / / / / / ) ) )"	5 	5 	5	' 	' 	'' ' '' ' ',' ' ',) ) )"* * *&( ( (2O O O,. . .>. . .B    4	5 	5 	5
% 
% 
%% % %% % %$O O O$8 8 8&	5 	5 	5
% 
% 
%% % %% % %$% % %"A A A. L  L  LD,
 ,
 ,
 ,
 ,
 ,
 ,
r   r\  c                        e Zd Zd Zd Zd ZdS )VerifyingAdapterRegistryTestsc                     ddl m} |S )Nr   )VerifyingAdapterRegistry)ra   r%  )r3   r%  s     r   r   z-VerifyingAdapterRegistryTests._getTargetClass  s    CCCCCC''r   c                 6     |                                  |i |S r/   r   )r3   r   kws      r   r   z&VerifyingAdapterRegistryTests._makeOne  s#    %t##%%t2r222r   c                 ^    ddl m} ddlm} |                                 } |||           d S )Nr   )IAdapterRegistry)verifyObject)zope.interface.interfacesr)  zope.interface.verifyr*  r   )r3   r)  r*  r   s       r   ,test_verify_object_provides_IAdapterRegistryzJVerifyingAdapterRegistryTests.test_verify_object_provides_IAdapterRegistry  sL    >>>>>>666666==??%x00000r   N)r
   r   r   r   r   r-  r   r   r   r#  r#    sA        ( ( (3 3 31 1 1 1 1r   r#  c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	AdapterRegistryTestsc                     ddl m} |S )Nr   )AdapterRegistry)ra   r1  )r3   r1  s     r   r   z$AdapterRegistryTests._getTargetClass  s    ::::::r   c                 ~    |                                  }|                     t          |j                  d           d S r9  )r   r   r<   _v_subregistries)r3   ars     r   test_ctor_no_basesz'AdapterRegistryTests.test_ctor_no_bases  s6    ]]__R011155555r   c                 0   |                                  }|                      |g          }|                     t          |j                  d           |                     t          |j                  d           |                     ||j                   d S r   )r   r   r<   r3  r   )r3   basesubs      r   test_ctor_w_basesz&AdapterRegistryTests.test_ctor_w_bases  s    }}mmTF##S122A666T233Q777c4011111r   c                 h   |                                  }|                                  }|                      |g          }|g|_        |                     t          |j                  d           |                     t          |j                  d           |                     ||j                   d S r   r   r   r   r<   r3  r   r3   beforeafterr8  s       r   ,test__setBases_removing_existing_subregistryzAAdapterRegistryTests.test__setBases_removing_existing_subregistry  s    mmVH%%V455q999U344a888c5122222r   c                    |                                  }|                                  }|                                  }|                      |g          }|j        d                             |           |g|_        |                     t          |j                  d           |                     t          |j                  d           |                     ||j                   d S )Nr   r   r   )r   __dict__rU   r   r   r<   r3  r   )r3   r=  strayr>  r8  s        r   test__setBases_wo_stray_entryz2AdapterRegistryTests.test__setBases_wo_stray_entry  s    mmVH%%[!((///V455q999U344a888c5122222r   c                    |                                  }|                                  }|                      |g          }||g|_        |                     t          |j                  d           |                     t          |j                  d           |                     ||j                   |                     ||j                   d S r   r;  r<  s       r   *test__setBases_w_existing_entry_continuingz?AdapterRegistryTests.test__setBases_w_existing_entry_continuing  s    mmVH%%V455q999U344a888c62333c5122222r   c                 v   |                                  } G d d          } |             |            }}|                    |           |                    |           t                      }|                    |           |                     |j        |           |                     |j        |           d S )Nc                       e Zd ZdZd ZdS )BAdapterRegistryTests.test_changed_w_subregistries.<locals>.DerivedNc                     || _         d S r/   rk   )r3   originally_changeds     r   rn   zJAdapterRegistryTests.test_changed_w_subregistries.<locals>.Derived.changed  s     2r   )r
   r   r   rl   rn   r   r   r   rs  rH    s(        H3 3 3 3 3r   rs  )r   _addSubregistryr   rn   r   rl   )r3   r7  rs  derived1derived2rm   s         r   test_changed_w_subregistriesz1AdapterRegistryTests.test_changed_w_subregistries  s    }}	3 	3 	3 	3 	3 	3 	3 	3 %WYY		(X&&&X&&&xxTh'...h'.....r   N)
r
   r   r   r   r5  r9  r?  rC  rE  rN  r   r   r   r/  r/    s}          6 6 62 2 23 3 3	3 	3 	33 3 3/ / / / /r   r/  c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )
Test_utilsc                 \    ddl m} ddlm} |                      |d           |           d S )Nr   _convert_None_to_Interfacer   )ra   rS  rs  r   r   )r3   rS  r   s      r   &test__convert_None_to_Interface_w_Nonez1Test_utils.test__convert_None_to_Interface_w_None  sL    EEEEEE6666660066	BBBBBr   c                 l    ddl m} t                      }|                      ||          |           d S )Nr   rR  )ra   rS  r   r   )r3   rS  rD   s      r   'test__convert_None_to_Interface_w_otherz2Test_utils.test__convert_None_to_Interface_w_other  sC    EEEEEE0077?????r   c                     ddl m} d}d} ||          }|                     ||           |                     |t	          |                     d S )Nr   _normalize_names   strstr)ra   rY  r   r   rB   )r3   rY  STRUNICODEnorms        r   test__normalize_name_strz#Test_utils.test__normalize_name_str  se    ::::::s##w'''dDMM22222r   c                 T    ddl m} d}|                      ||          |           d S )Nr   rX  ustr)ra   rY  r   )r3   rY  USTRs      r   test__normalize_name_unicodez'Test_utils.test__normalize_name_unicode  s?    ::::::..55555r   c                 x    ddl m} dddg i t                      fD ]}|                     t          ||           d S )Nr   rX  r   g      ?r   )ra   rY  r   r   	TypeError)r3   rY  rD   s      r   test__normalize_name_otherz%Test_utils.test__normalize_name_other	  s]    ::::::RR1 	A 	AEi%@@@@	A 	Ar   N)r
   r   r   rT  rV  r^  rb  re  r   r   r   rP  rP    sj        C C C
@ @ @
3 3 36 6 6A A A A Ar   rP  )rZ  unittestr  r   r+   r-   rJ   rR   rW   rZ   TestCaser\   rH  r\  r  r  rX  r\  r#  r/  rP  r   r   r   <module>rh     s     6 6 6 6 6 67 7 7H               <& & & & && & & &( ( ( ( (' ( ( (	 	 	 	 	 	 	 		 	 	 	 	] 	 	 	M M M M Mx0 M M M`0$ 0$ 0$ 0$ 0$*B 0$ 0$ 0$fy8 y8 y8 y8 y8h/ y8 y8 y8x    -+  z3 z3 z3 z3 z3!2 z3 z3 z3z    3.  Q

 Q

 Q

 Q

 Q

X. Q

 Q

 Q

h1 1 1 1 1H$5 1 1 1*@/ @/ @/ @/ @/8 @/ @/ @/FA A A A A" A A A A Ar   