
    Jfͻ                       d Z ddlZddlmZ ddlmZ ddlmZ  G d dej                        Z	 G d d	e	      Z
 G d
 dej                        Z G d dej                        Z G d dej                        Z G d dej                        Z G d de      Z G d de      Z G d dee      Z G d dee      Z G d dej                        Z G d de      Z G d de      Z G d  d!      Zy)"zComponent Registry Tests    N	Interface)VerifyingAdapterRegistry
Componentsc                       e Zd Zd Zdsd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  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. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZG fdFZH fdGZIdH ZJdI ZKdJ ZLdK ZMdL ZNdM ZO fdNZPdO ZQdP ZRdQ ZSdR ZTdS ZUdT ZVdU ZWdV ZXdW ZYdX ZZdY Z[dZ Z\d[ Z]d\ Z^d] Z_d^ Z`d_ Zad` Zbda Zcdb Zddc Zedd Zfde Zgdf Zhdg Zidh Zjdi Zkdj Zldk Zmdl Zndm Zodn Zpdo Zq	 dtdpZrdq Zsdr Zt xZuS )uComponentsTestsc                     t         S Nr   selfs    ]/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/zope/interface/tests/test_registry.py_getTargetClasszComponentsTests._getTargetClass   s        c                 6     | j                         |g|i |S r   r   )r   nameargskws       r   _makeOnezComponentsTests._makeOne   s"    %t##%d8T8R88r   c                 @    ddl m} g fd}t        ||      }|fS )Nr   )registryc                  ,    j                  | |f       y r   append)r   r   _eventss     r   _notifyz,ComponentsTests._wrapEvents.<locals>._notify#   s    NND":&r   )notify)zope.interfacer   _Monkey)r   r   r   _monkeyr   s       @r   _wrapEventszComponentsTests._wrapEvents   s)    +	' (73r   c                    ddl m} | j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  t        |j                  |             | j                  t        |j                  |             | j                  |j                  j
                  d       | j                  |j                  j
                  d       | j                  |j                  i        | j                  |j                  i        | j                  |j                  g        | j                  |j                  g        y )Nr   )AdapterRegistrytesting )zope.interface.adapterr$   r   assertEqual__name__	__bases__
assertTrue
isinstanceadapters	utilities_utility_registrations_adapter_registrations_subscription_registrations_handler_registrations)r   r$   comps      r   test_ctor_no_basesz"ComponentsTests.test_ctor_no_bases)   s    :}}Y'	2,
4==/BC
4>>?CD00"5112644b944b9992>44b9r   c                    | j                  d      }| j                  d|f      }| j                  |j                  d       | j                  |j                  |f       | j                  |j                  j                  |j                  f       | j                  |j
                  j                  |j
                  f       y )Nbaser%   )r   r(   r)   r*   r-   r.   )r   r6   r3   s      r   test_ctor_w_basez ComponentsTests.test_ctor_w_base7   s    }}V$}}Y0	2$1004==2BC11DNN3DEr   c                 \    | j                  d      }| j                  t        |      d       y )Nr%   z<Components testing>r   r(   reprr   r3   s     r   test___repr__zComponentsTests.test___repr__?   s%    }}Y'd%;<r   c                    | j                  d      }| j                  d      }| j                         }||f|_        | j                  |j                  ||f       | j                  |j                  j                  |j                  |j                  f       | j                  |j                  j                  |j                  |j                  f       y )Nbase1base2)r   r*   r(   r-   r.   )r   r>   r?   r3   s       r   test_assign_to___bases__z(ComponentsTests.test_assign_to___bases__E   s    g&g&}}%800..%..9	;11//5??;	=r   c                    ddl m} ddl m}  G d d|      } |d      } |d       G d d             } |       }d	}| j                         }|j	                  |||
       | j                  |j                  |df   ||d f       y )Nr   InterfaceClassnamedc                       e Zd Zy)FComponentsTests.test_registerUtility_with_component_name.<locals>.IFooNr)   
__module____qualname__r&   r   r   IFoorG   T       r   rK   fooc                       e Zd Zy)EComponentsTests.test_registerUtility_with_component_name.<locals>.FooNrH   r&   r   r   FoorO   Y       r   rP   inforR   )zope.interface.declarationsrC   rE   r   registerUtilityr(   r/   )	r   rC   rE   rK   ifoorP   rM   _infor3   s	            r   (test_registerUtility_with_component_namez8ComponentsTests.test_registerUtility_with_component_nameP   s    >5	> 	 F|	u	 	 
	 e}}S$U3''e4%	 r   c                     d }t               }| j                         }| j                  t        |j                  ||       y )Nc                      t               r   NotImplementedErrorr&   r   r   _factoryzQComponentsTests.test_registerUtility_both_factory_and_component.<locals>._factoryg       %''r   	componentfactory)objectr   assertRaises	TypeErrorrU   r   r]   _to_regr3   s       r   /test_registerUtility_both_factory_and_componentz?ComponentsTests.test_registerUtility_both_factory_and_componentf   s;    	((}})T%9%9$+X 	 	?r   c                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}t               }| j                         }	| j                         \  }
}|
5  |	j                  ||||       d d d        | j                  |	j                  j                  d   |   |   |u        | j                  |	j                  ||f   ||d f       | j                  |	j                  j                  d   |   d	   |f       | j                  t!        |      d
       |d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j                  |             | j                  |j                  j$                  |	u        | j                  |j                  j&                  |u        | j                  |j                  j(                  |u        | j                  |j                  j*                  |u        | j                  |j                  j,                  |u        | j                  |j                  j.                  d u        y # 1 sw Y   xY w)Nr   rB   
RegisteredUtilityRegistrationc                       e Zd Zy)>ComponentsTests.test_registerUtility_w_component.<locals>.IFooNrH   r&   r   r   rK   rn   s   rL   r   rK   rR   r       )rT   rC   zope.interface.interfacesrj   zope.interface.registryrl   rb   r   r"   rU   r+   r.   	_adaptersr(   r/   _subscriberslenr,   r   providedr   r`   rR   ra   )r   rC   rj   rl   rK   rV   rW   _namerf   r3   r!   r   r   r   events                  r    test_registerUtility_w_componentz0ComponentsTests.test_registerUtility_w_componentn   s    >8?	> 	 F|(}}++- 	>  $u=	>003D9%@GKL44T5[A!5$/	144Q7=bAG:NWq)1:bR 
5*56
5<<1DEF--56--56))U23..'9:))U23,,45#	> 	>s   II(c                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}t               fd	}| j                         }	| j                         \  }
}|
5  |	j                  d ||||
       d d d        | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |	u        | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  u        | j                  |j                  j$                  |u        | j                  |j                  j&                  |u        y # 1 sw Y   nxY w)Nr   rB   ri   rk   c                       e Zd Zy)<ComponentsTests.test_registerUtility_w_factory.<locals>.IFooNrH   r&   r   r   rK   r|      rL   r   rK   rR   r   c                       S r   r&   rf   s   r   r]   z@ComponentsTests.test_registerUtility_w_factory.<locals>._factory       Nr   ra   rp   )rT   rC   rq   rj   rr   rl   rb   r   r"   rU   r(   ru   r+   r,   r   rv   r   r`   rR   ra   )r   rC   rj   rl   rK   rV   rW   rw   r]   r3   r!   r   r   r   rx   rf   s                  @r   test_registerUtility_w_factoryz.ComponentsTests.test_registerUtility_w_factory   s   >8?	> 	 F|(	 }}++- 	M  tUE8 L	MWq)1:bR 
5*56
5<<1DEF--56--56))U23..'9:))U23,,89	M 	Ms   G""G,c                      G d d      }d}d} |       }| j                         }| j                  t        |j                  |d ||       y )Nc                       e Zd Zy)GComponentsTests.test_registerUtility_no_provided_available.<locals>.FooNrH   r&   r   r   rP   r      rL   r   rP   rR   r   )r   rc   rd   rU   )r   rP   rW   rw   rf   r3   s         r   *test_registerUtility_no_provided_availablez:ComponentsTests.test_registerUtility_no_provided_available   sL    	 	 %}})..ue	Mr   c                    ddl m} ddl m} ddlm} ddlm}  G d d|      } G d d	      } |d      }d
}d}	 |       }
 ||
|       | j                         }| j                         \  }}|5  |j                  |
d |	|       d d d        | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  |	u        | j                  |j                  j$                  |
u        | j                  |j                  j&                  |u        | j                  |j                  j(                  d u        y # 1 sw Y   nxY w)Nr   rB   directlyProvidesri   rk   c                       e Zd Zy)>ComponentsTests.test_registerUtility_wo_provided.<locals>.IFooNrH   r&   r   r   rK   r      rL   r   rK   c                       e Zd Zy)=ComponentsTests.test_registerUtility_wo_provided.<locals>.FooNrH   r&   r   r   rP   r      rL   r   rP   rR   r   rp   )rT   rC   r   rq   rj   rr   rl   r   r"   rU   r(   ru   r+   r,   rb   r   rv   r   r`   rR   ra   )r   rC   r   rj   rl   rK   rP   rV   rW   rw   rf   r3   r!   r   r   r   rx   s                    r    test_registerUtility_wo_providedz0ComponentsTests.test_registerUtility_wo_provided   s   >@8?	> 		 	 F|%$'}}++- 	>  $u=	>Wq)1:bR 
5*56
5<<1DEF--56--56))U23..'9:))U23,,45	> 	>s   /G00G:c                 L   ddl m}  G d d|      } |d      }d}d}t               }| j                         }|j	                  ||||       | j                         \  }}	|5  |j	                  ||||       d d d        | j                  t        |	      d       y # 1 sw Y   %xY w)Nr   rB   c                       e Zd Zy)JComponentsTests.test_registerUtility_duplicates_existing_reg.<locals>.IFooNrH   r&   r   r   rK   r      rL   r   rK   rR   r   )rT   rC   rb   r   rU   r"   r(   ru   
r   rC   rK   rV   rW   rw   rf   r3   r!   r   s
             r   ,test_registerUtility_duplicates_existing_regz<ComponentsTests.test_registerUtility_duplicates_existing_reg   s    >	> 	 F|(}}WdE59++- 	>  $u=	>Wq)	> 	>s   !BB#c                    ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       | j                         \  }	}
|	5  |j	                  ||||       d d d        | j                  t        |
      d       | j                  |j                  ||f   ||d f       | j                  |j                  j                  d   |   d	   |f       y # 1 sw Y   yxY w)
Nr   rB   c                       e Zd Zy)CComponentsTests.test_registerUtility_w_different_info.<locals>.IFooNrH   r&   r   r   rK   r      rL   r   rK   info1info2r      ro   rT   rC   rb   r   rU   r"   r(   ru   r/   r.   rt   )r   rC   rK   rV   _info1_info2rw   rf   r3   r!   r   s              r   %test_registerUtility_w_different_infoz5ComponentsTests.test_registerUtility_w_different_info   s    >	> 	 F|(}}WdE6:++- 	?  $v>	?Wq)44dE]C!640	244Q7=bA!	%	? 	?s   #C00C9c                 V   ddl m}  G d d|      } |d      }d}d}d}t               }t               }| j                         }	|	j	                  ||||       | j                         \  }
}|
5  |	j	                  ||||       d d d        | j                  t        |      d       | j                  |	j                  ||f   ||d f       | j                  |	j                  ||f   ||d f       | j                  |	j                  j                  d   |   d	   ||f       y # 1 sw Y   xY w)
Nr   rB   c                       e Zd Zy)SComponentsTests.test_registerUtility_w_different_names_same_component.<locals>.IFooNrH   r&   r   r   rK   r     rL   r   rK   rR   name1name2rp   ro   r   r   rC   rK   rV   rW   _name1_name2
_other_regrf   r3   r!   r   s               r   5test_registerUtility_w_different_names_same_componentzEComponentsTests.test_registerUtility_w_different_names_same_component  s.   >	> 	 F|X
(}}Zvu=++- 	?  $>	?Wq)44dF^D$eT2	444dF^D!5$/	144Q7=bA$g/	1	? 	?s   -DD(c                    ddl m} ddlm} ddlm} ddlm}  G d d|      } |d      }d}d	}t               t               }
}	| j                         }|j                  |	|||       | j                         \  }}|5  |j                  |
|||       d d d        | j                  t        |      d
       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |	u        | j                  |j                  j&                  |u        | j                  |j                  j(                  d u        |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |
u        | j                  |j                  j&                  |u        | j                  |j                  j(                  d u        y # 1 sw Y   xY w)Nr   rB   ri   Unregisteredrk   c                       e Zd Zy)HComponentsTests.test_registerUtility_replaces_existing_reg.<locals>.IFooNrH   r&   r   r   rK   r   $  rL   r   rK   rR   r   r   rp   )rT   rC   rq   rj   r   rr   rl   rb   r   rU   r"   r(   ru   r+   r,   r   rv   r   r`   rR   ra   )r   rC   rj   r   rl   rK   rV   rW   rw   _before_afterr3   r!   r   r   r   rx   s                    r   *test_registerUtility_replaces_existing_regz:ComponentsTests.test_registerUtility_replaces_existing_reg  s   >8:?	> 	 F| (FH}}WdE59++- 	=  ue<	=Wq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:))U23,,451:bR 
5*56
5<<1DEF--56--56))U23..&89))U23,,451	= 	=s   =MMc                 z   ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       | j                         \  }	}
|	5  |j	                  ||||       d d d        | j                  |j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rB   c                       e Zd Zy)DComponentsTests.test_registerUtility_w_existing_subscr.<locals>.IFooNrH   r&   r   r   rK   r   K  rL   r   rK   rR   r   r   ro   )	rT   rC   rb   r   rU   r"   r(   r.   rt   r   rC   rK   rV   rW   r   r   rf   r3   r!   r   s              r   &test_registerUtility_w_existing_subscrz6ComponentsTests.test_registerUtility_w_existing_subscrH  s    >	> 	 F|(}}WdFE:++- 	?  $>	?44Q7=bAG:N	? 	?s   #B11B:c                 &   ddl m}  G d d|      } |d      }d}d}t               }| j                         }| j	                         \  }}	|5  |j                  ||||d       d d d        | j                  t        |	      d       y # 1 sw Y   %xY w)Nr   rB   c                       e Zd Zy);ComponentsTests.test_registerUtility_wo_event.<locals>.IFooNrH   r&   r   r   rK   r   ]  rL   r   rK   rR   r   F)rT   rC   rb   r   r"   rU   r(   ru   r   s
             r   test_registerUtility_wo_eventz-ComponentsTests.test_registerUtility_wo_eventZ  s    >	> 	 F|(}}++- 	E  $ueD	EWq)	E 	Es   BBc                     G d d| j                               } |       }|j                  t               t               | j	                  t        t        |j                                     d        G d dt              }|j                  t               |       | j	                  t        t        |j                                     d       y )Nc                   "     e Zd ZdZ fdZ xZS )dComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Regr   c                     | xj                   dz  c_         t        |   |  | j                   dk(  rt        | j                        | _        y y )Nrp   )	reg_countsuperrU   dictr/   r   r   	__class__s     r   rU   ztComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Reg.registerUtilityp  sE    !#'.>>Q&26333D/ 'r   r)   rI   rJ   r   rU   __classcell__r   s   @r   CompThatChangesAfter1Regr   m  s    I r   r   rp   c                       e Zd Zy)PComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.IFooNrH   r&   r   r   rK   r   }  rL   r   rK   r   r   rU   rb   r   r(   ru   listregisteredUtilities)r   r   r3   rK   s       r   2test_registerUtility_changes_object_identity_afterzBComponentsTests.test_registerUtility_changes_object_identity_afterj  s    		t';';'= 		 ()VXy1T$":":"<=>B	9 	 	VXt,T$":":"<=>Br   c                 P    G d d| j                               } |       }|j                  t               t               | j	                  t        t        |j                                     d        G d dt              }|j                  t               |       | j	                  t        t        |j                                     d        G d dt              }|j                  t               |       | j	                  t        t        |j                                     d	       y )
Nc                   "     e Zd ZdZ fdZ xZS )eComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Regr   c                     | xj                   dz  c_         | j                   dk(  rt        | j                        | _        t        |   |  y )Nrp   r   )r   r   r/   r   rU   r   s     r   rU   zuComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Reg.registerUtility  sB    !#>>Q&26333D/ '.r   r   r   s   @r   CompThatChangesAfter2Regr     s    I/ /r   r   rp   c                       e Zd Zy)QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IFooNrH   r&   r   r   rK   r     rL   r   rK   r   c                       e Zd Zy)QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IBarNrH   r&   r   r   IBarr     rL   r   r      r   )r   r   r3   rK   r   s        r   3test_registerUtility_changes_object_identity_beforezCComponentsTests.test_registerUtility_changes_object_identity_before  s    
	/t';';'= 
	/ ()VXy1T$":":"<=>B	9 	 	VXt,T$":":"<=>B	9 	 	VXt,T$":":"<=>Br   c                 l    | j                         }| j                  t        |j                  d d d        y )N)r`   rv   ra   )r   rc   rd   unregisterUtilityr;   s     r   <test_unregisterUtility_wo_factory_nor_component_nor_providedzLComponentsTests.test_unregisterUtility_wo_factory_nor_component_nor_provided  s2    }})T%;%;$(4 	 	Gr   c                     d }t               }| j                         }| j                  t        |j                  ||       y )Nc                      t               r   r[   r&   r   r   r]   zSComponentsTests.test_unregisterUtility_both_factory_and_component.<locals>._factory  r^   r   r_   )rb   r   rc   rd   r   re   s       r   1test_unregisterUtility_both_factory_and_componentzAComponentsTests.test_unregisterUtility_both_factory_and_component  s;    	((}})T%;%;$+X 	 	?r   c                 ,   ddl m}  G d d|      } |d      }d}t               }| j                         }| j	                         \  }}|5  |j                  |||      }	d d d        | j                  	       | j                  |       y # 1 sw Y   ,xY w)Nr   rB   c                       e Zd Zy)EComponentsTests.test_unregisterUtility_w_component_miss.<locals>.IFooNrH   r&   r   r   rK   r     rL   r   rK   r   )rT   rC   rb   r   r"   r   assertFalse)
r   rC   rK   rV   rw   rf   r3   r!   r   unregs
             r   'test_unregisterUtility_w_component_missz7ComponentsTests.test_unregisterUtility_w_component_miss  s    >	> 	 F|(}}++- 	A**7D%@E	A!	A 	As   B

Bc                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}t               }| j                         }|j                  |||       | j                         \  }	}
|	5  |j                  |||      }d d d        | j                         | j                  |j                  j                         | j                  ||f|j                  v        | j                  |j                  j                          | j#                  t%        |
      d       |
d   \  }}|\  }| j#                  |i        | j                  t'        ||             | j                  t'        |j                  |             | j                  |j                  j(                  |u        | j                  |j                  j*                  |u        | j                  |j                  j,                  |u        | j                  |j                  j.                  |u        | j                  |j                  j0                  d u        y # 1 sw Y   xY w)	Nr   rB   r   rk   c                       e Zd Zy)@ComponentsTests.test_unregisterUtility_w_component.<locals>.IFooNrH   r&   r   r   rK   r     rL   r   rK   r   rp   )rT   rC   rq   r   rr   rl   rb   r   rU   r"   r   r+   r   r.   rs   r/   rt   r(   ru   r,   r   rv   r   r`   ra   )r   rC   r   rl   rK   rV   rw   rf   r3   r!   r   r   r   r   rx   s                  r   "test_unregisterUtility_w_componentz2ComponentsTests.test_unregisterUtility_w_component  s   >:?	> 	 F|(}}WdE2++- 	A**7D%@E	A112$$*E*EEF445Wq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:,,45!	A 	As   *H==Ic                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}t               fd	}| j                         }	|	j                  d ||||
       | j                         \  }
}|
5  |	j                  d |||
      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |	u        | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  u        | j                  |j                  j&                  |u        y # 1 sw Y   XxY w)Nr   rB   r   rk   c                       e Zd Zy)>ComponentsTests.test_unregisterUtility_w_factory.<locals>.IFooNrH   r&   r   r   rK   r     rL   r   rK   rR   r   c                       S r   r&   r~   s   r   r]   zBComponentsTests.test_unregisterUtility_w_factory.<locals>._factory  r   r   r   rp   )rT   rC   rq   r   rr   rl   rb   r   rU   r"   r   r+   r(   ru   r,   r   rv   r   r`   ra   )r   rC   r   rl   rK   rV   rW   rw   r]   r3   r!   r   r   r   r   rx   rf   s                   @r    test_unregisterUtility_w_factoryz0ComponentsTests.test_unregisterUtility_w_factory  s   >:?	> 	 F|(	 }}T4xH++- 	P**4uh*OE	PWq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:,,89	P 	Ps   5G!!G+c                 B   ddl m} ddl m} ddlm} ddlm}  G d d|      } G d d	      } |d      }d
}d}	 |       }
 ||
|       | j                         }|j                  |
||	|       | j                         \  }}|5  |j                  |
d |	      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |	u        | j                  |j                  j&                  |
u        | j                  |j                  j(                  |u        | j                  |j                  j*                  d u        y # 1 sw Y   xY w)Nr   rB   r   r   rk   c                       e Zd Zy)IComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   r     rL   r   rK   c                       e Zd Zy)HComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.FooNrH   r&   r   r   rP   r     rL   r   rP   rR   r   rp   rT   rC   r   rq   r   rr   rl   r   rU   r"   r   r+   r(   ru   r,   rb   r   rv   r   r`   rR   ra   r   rC   r   r   rl   rK   rP   rV   rW   rw   rf   r3   r!   r   r   r   r   rx   s                     r   +test_unregisterUtility_wo_explicit_providedz;ComponentsTests.test_unregisterUtility_wo_explicit_provided  s   >@:?	> 		 	 F|%$'}}WdE59++- 	A**7D%@E	AWq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:))U23,,45	A 	A   HHc                 B   ddl m} ddl m} ddlm} ddlm}  G d d|      } G d d	      } |d      }d
}d}	 |       }
 ||
|       | j                         }|j                  |
||	|       | j                         \  }}|5  |j                  ||	      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |	u        | j                  |j                  j&                  |
u        | j                  |j                  j(                  |u        | j                  |j                  j*                  d u        y # 1 sw Y   xY w)Nr   rB   r   r   rk   c                       e Zd Zy)LComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.IFooNrH   r&   r   r   rK   r   ,  rL   r   rK   c                       e Zd Zy)KComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.FooNrH   r&   r   r   rP   r   /  rL   r   rP   rR   r   rv   r   rp   r   r   s                     r   .test_unregisterUtility_wo_component_or_factoryz>ComponentsTests.test_unregisterUtility_wo_component_or_factory&  s   >@:?	> 		 	 F|%$'}}WdE59++- 	F**Du*EE	F 	Wq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:))U23,,45	F 	Fr   c                    ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       |j	                  ||||       | j                         \  }	}
|	5  |j                  |||       d d d        | j                  |j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rB   c                       e Zd Zy)FComponentsTests.test_unregisterUtility_w_existing_subscr.<locals>.IFooNrH   r&   r   r   rK   r   N  rL   r   rK   rR   r   r   ro   
rT   rC   rb   r   rU   r"   r   r(   r.   rt   r   s              r   (test_unregisterUtility_w_existing_subscrz8ComponentsTests.test_unregisterUtility_w_existing_subscrK  s    >	> 	 F|(}}WdFE:WdFE:++- 	:""7D&9	:44Q7=bAG:N	: 	:   7CCc                    ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       |j	                  ||||       | j                         \  }	}
|	5  |j                  |||       d d d        | j                  |j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rB   c                       e Zd Zy)SComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable.<locals>.IFooNrH   r&   r   r   rK   r  a  rL   r   rK   rR   r   r   ro   )
rT   rC   r   r   rU   r"   r   r(   r.   rt   r   s              r   5test_unregisterUtility_w_existing_subscr_non_hashablezEComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable^  s    >	> 	 F|&}}WdFE:WdFE:++- 	:""7D&9	:44Q7=bAG:N	: 	:r  c                    ddl m} ddlm}  G d d|      } |d      }d}d}d}t	               }| j                         }	|	j                  ||||       |	j                  ||||       | j                         \  }
}|
5  |	j                  |||       d d d        | j                  |	j                  j                  d   |   d	   |f       y # 1 sw Y   :xY w)
Nr   rB   )_UtilityRegistrationsc                       e Zd Zy)]ComponentsTests.test_unregisterUtility_w_existing_subs_non_hashable_fresh_cache.<locals>.IFooNrH   r&   r   r   rK   r	  w  rL   r   rK   rR   r   r   ro   )rT   rC   rr   r  r   r   rU   r"   r   r(   r.   rt   )r   rC   r  rK   rV   rW   r   r   rf   r3   r!   r   s               r   ?test_unregisterUtility_w_existing_subs_non_hashable_fresh_cachezOComponentsTests.test_unregisterUtility_w_existing_subs_non_hashable_fresh_cacheq  s     	?A	> 	 F|&}}WdFE:WdFE:++- 	:""7D&9	:44Q7=bAG:N	: 	:s   =C

Cc                    ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       |j	                  ||||       |j                  d       |j	                  ||||       | j                         \  }	}
|	5  |j                  |||       d d d        | j                  dt        |j                  j                               y # 1 sw Y   9xY w)	Nr   rB   c                       e Zd Zy)]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   rR   r   r   r6   )rT   rC   r   r   rU   __init__r"   r   r(   ru   r.   rt   r   s              r   ?test_unregisterUtility_w_existing_subscr_non_hashable_reinittedzOComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted  s     	?	> 	 F|&}}WdFE:WdFE: 	fWdFE:++- 	:""7D&9	: 	C ; ;<=	: 	:s   C((C1c                    ddl m}  G d d|      } |d      }d}d}d}t               }t               }| j                         }	|	j	                  ||||       |	j	                  ||||       | j                         \  }
}|
5  |	j                  |||       d d d        | j                  |	j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rB   c                       e Zd Zy)VComponentsTests.test_unregisterUtility_w_existing_subscr_other_component.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   rR   r   r   ro   r   r   s               r   8test_unregisterUtility_w_existing_subscr_other_componentzHComponentsTests.test_unregisterUtility_w_existing_subscr_other_component  s    >	> 	 F|X
(}}Zvu=WdFE:++- 	:""7D&9	:44Q7=bA$	(	: 	:   CCc                    ddl m}  G d d|      } |d      }d}d}d}t               }t               }| j	                         }	|	j                  ||||       |	j                  ||||       | j                         \  }
}|
5  |	j                  |||       d d d        | j                  |	j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rB   c                       e Zd Zy)[ComponentsTests.test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hash.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   rR   r   r   ro   )rT   rC   rb   r   r   rU   r"   r   r(   r.   rt   r   s               r   =test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hashzMComponentsTests.test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hash  s    >	> 	 F|X
&}}Zvu=WdFE:++- 	:""7D&9	:44Q7=bA$	(	: 	:r  c                 v    | j                         }| j                  t        |j                               g        y r   )r   r(   r   r   r;   s     r   test_registeredUtilities_emptyz.ComponentsTests.test_registeredUtilities_empty  s+    }}d66892>r   c                    ddl m} ddlm}  G d d|      } |d      }d}d}d}t	               }| j                         }	|	j                  ||||       |	j                  ||||       t        |	j                         d	 
      }
| j                  t        |
      d       | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |u        | j                  |
d   j                   |u        | j                  |
d   j"                  |u        | j                  |
d   j$                  d u        | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |u        | j                  |
d   j                   |u        | j                  |
d   j"                  |u        | j                  |
d   j$                  d u        y )Nr   rB   rk   c                       e Zd Zy)?ComponentsTests.test_registeredUtilities_notempty.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   rR   r   r   c                     | j                   S r   r   rs    r   <lambda>zCComponentsTests.test_registeredUtilities_notempty.<locals>.<lambda>  s
    qvv r   keyr   rp   )rT   rC   rr   rl   rb   r   rU   sortedr   r(   ru   r+   r,   r   rv   r   r`   rR   ra   )r   rC   rl   rK   rV   rW   r   r   rf   r3   regs              r   !test_registeredUtilities_notemptyz1ComponentsTests.test_registeredUtilities_notempty  s   >?	> 	 F|(}}WdFE:WdFE:T--/5EFS1%
3q6+>?@A4/0A4/0Av-.A((G34Au,-A$./
3q6+>?@A4/0A4/0Av-.A((G34Au,-A$./r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  |j	                  |      d u        y )Nr   rB   c                       e Zd Zy)?ComponentsTests.test_queryUtility_miss_no_default.<locals>.IFooNrH   r&   r   r   rK   r*    rL   r   rK   )rT   rC   r   r+   queryUtilityr   rC   rK   rV   r3   s        r   !test_queryUtility_miss_no_defaultz1ComponentsTests.test_queryUtility_miss_no_default  sC    >	> 	 F|}}))$/478r   c                     ddl m}  G d d|      } |d      }| j                         }t               }| j	                  |j                  ||      |u        y )Nr   rB   c                       e Zd Zy)>ComponentsTests.test_queryUtility_miss_w_default.<locals>.IFooNrH   r&   r   r   rK   r0    rL   r   rK   default)rT   rC   r   rb   r+   r+  )r   rC   rK   rV   r3   _defaults         r    test_queryUtility_miss_w_defaultz0ComponentsTests.test_queryUtility_miss_w_default  sO    >	> 	 F|}}8))$)AXMNr   c                     ddl m}  G d d|      } |d      }t               }| j                         }|j	                  ||       | j                  |j                  |      |u        y )Nr   rB   c                       e Zd Zy)3ComponentsTests.test_queryUtility_hit.<locals>.IFooNrH   r&   r   r   rK   r7    rL   r   rK   )rT   rC   rb   r   rU   r+   r+  r   rC   rK   rV   rf   r3   s         r   test_queryUtility_hitz%ComponentsTests.test_queryUtility_hit	  sZ    >	> 	 F|(}}Wd+))$/7:;r   c                     ddl m} ddlm}  G d d|      } |d      }| j	                         }| j                  ||j                  |       y )Nr   rB   ComponentLookupErrorc                       e Zd Zy)2ComponentsTests.test_getUtility_miss.<locals>.IFooNrH   r&   r   r   rK   r>    rL   r   rK   )rT   rC   rq   r<  r   rc   
getUtility)r   rC   r<  rK   rV   r3   s         r   test_getUtility_missz$ComponentsTests.test_getUtility_miss  sA    >B	> 	 F|}}.Fr   c                     ddl m}  G d d|      } |d      }t               }| j                         }|j	                  ||       | j                  |j                  |      |u        y )Nr   rB   c                       e Zd Zy)1ComponentsTests.test_getUtility_hit.<locals>.IFooNrH   r&   r   r   rK   rC  #  rL   r   rK   )rT   rC   rb   r   rU   r+   r?  r8  s         r   test_getUtility_hitz#ComponentsTests.test_getUtility_hit   sX    >	> 	 F|(}}Wd+-89r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t	        |j                  |            g        y )Nr   rB   c                       e Zd Zy)7ComponentsTests.test_getUtilitiesFor_miss.<locals>.IFooNrH   r&   r   r   rK   rG  /  rL   r   rK   )rT   rC   r   r(   r   getUtilitiesForr,  s        r   test_getUtilitiesFor_missz)ComponentsTests.test_getUtilitiesFor_miss,  sG    >	> 	 F|}}d224892>r   c                 "   ddl m}  G d d|      } |d      }d}d}t               }| j                         }|j	                  |||       |j	                  |||       | j                  t        |j                  |            ||f||fg       y )Nr   rB   c                       e Zd Zy)6ComponentsTests.test_getUtilitiesFor_hit.<locals>.IFooNrH   r&   r   r   rK   rL  9  rL   r   rK   r   r   r  )rT   rC   rb   r   rU   r(   r%  rH  r   rC   rK   rV   r   r   rf   r3   s           r   test_getUtilitiesFor_hitz(ComponentsTests.test_getUtilitiesFor_hit6  s    >	> 	 F|(}}Wd8Wd8 4 4T :;!7+fg->?	Ar   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t	        |j                  |            g        y )Nr   rB   c                       e Zd Zy)DComponentsTests.test_getAllUtilitiesRegisteredFor_miss.<locals>.IFooNrH   r&   r   r   rK   rQ  I  rL   r   rK   )rT   rC   r   r(   r   getAllUtilitiesRegisteredForr,  s        r   &test_getAllUtilitiesRegisteredFor_missz6ComponentsTests.test_getAllUtilitiesRegisteredFor_missF  sG    >	> 	 F|}}d??EFKr   c                    ddl m}  G d d|      } |d      }d}d}t               }| j                         }|j	                  |||       |j	                  |||       | j                  t        |j                  |            |g       y )Nr   rB   c                       e Zd Zy)CComponentsTests.test_getAllUtilitiesRegisteredFor_hit.<locals>.IFooNrH   r&   r   r   rK   rV  S  rL   r   rK   r   r   r  )rT   rC   rb   r   rU   r(   r   rR  rM  s           r   %test_getAllUtilitiesRegisteredFor_hitz5ComponentsTests.test_getAllUtilitiesRegisteredFor_hitP  s    >	> 	 F|(}}Wd8Wd8d??EF!	$r   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d       G d d	             }d
}| j                         }|j	                  ||f||       | j                  |j                  |f|df   ||f       y )Nr   rB   rD   c                       e Zd Zy)FComponentsTests.test_registerAdapter_with_component_name.<locals>.IFooNrH   r&   r   r   rK   rZ  d  rL   r   rK   r   rM   c                       e Zd Zy)EComponentsTests.test_registerAdapter_with_component_name.<locals>.FooNrH   r&   r   r   rP   r\  j  rQ   r   rP   rR   rS   )rT   rC   rE   r   registerAdapterr(   r0   )	r   rC   rE   rK   rV   ibarrP   rW   r3   s	            r   (test_registerAdapter_with_component_namez8ComponentsTests.test_registerAdapter_with_component_name`  s    >5	> 	 F|F|	u	 	 
	}}S4'4e<''u(<=%L	r   c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d}d	}d
 }	| j                         }
| j                         \  }}|5  |
j                  |	|f|||       d d d        | j                  |
j                  j                  d   |   |   |   |	u        | j                  |
j                  |f||f   |	|f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |
u        | j                  |j                   j$                  |u        | j                  |j                   j&                  |f       | j                  |j                   j(                  |u        | j                  |j                   j*                  |u        | j                  |j                   j,                  |	u        y # 1 sw Y   xY w)Nr   rB   ri   AdapterRegistrationc                       e Zd Zy)SComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>.IFooNrH   r&   r   r   rK   rd  {  rL   r   rK   r   rR   r   c                     t               r   r[   contexts    r   r]   zWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>._factory  r^   r   rp   rT   rC   rq   rj   rr   rb  r   r"   r]  r+   r-   rs   r(   r0   ru   r,   rb   r   rv   requiredr   rR   ra   )r   rC   rj   rb  rK   rV   r^  rW   rw   r]   r3   r!   r   r   r   rx   s                   r   5test_registerAdapter_w_explicit_provided_and_requiredzEComponentsTests.test_registerAdapter_w_explicit_provided_and_requiredv  s   >8?	> 	 F|F|	(}}++- 	H  D7D%G	H//248>uE#$ 	%44dWdE5IJ"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..8))U23))U23,,89#	H 	Hs   H55H?c                     ddl m}  G d d|      } |d      }d}d} G d d	      }| j                         }| j                  t        |j
                  ||f||
       y )Nr   rB   c                       e Zd Zy)HComponentsTests.test_registerAdapter_no_provided_available.<locals>.IFooNrH   r&   r   r   rK   rm    rL   r   rK   r   rR   r   c                       e Zd Zy)LComponentsTests.test_registerAdapter_no_provided_available.<locals>._FactoryNrH   r&   r   r   _Factoryro    rL   r   rp  r   rR   rT   rC   r   rc   rd   r]  )r   rC   rK   r^  rW   rw   rp  r3   s           r   *test_registerAdapter_no_provided_availablez:ComponentsTests.test_registerAdapter_no_provided_available  se    >	> 	 F|	 	 }})T%9%98dW$5 	 	2r   c                    ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d	}d
}	 ||       G d d             }
| j                         }| j                         \  }}|5  |j                  |
|f|	|       d d d        | j                  |j                  j                  d   |   |   |	   |
u        | j                  |j                  |f||	f   |
|f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t!        ||             | j                  t!        |j"                  |             | j                  |j"                  j$                  |u        | j                  |j"                  j&                  |u        | j                  |j"                  j(                  |f       | j                  |j"                  j*                  |	u        | j                  |j"                  j,                  |u        | j                  |j"                  j.                  |
u        y # 1 sw Y   xY w)Nr   rB   implementerri   ra  c                       e Zd Zy)GComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   rx    rL   r   rK   r   rR   r   c                       e Zd Zy)KComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>._FactoryNrH   r&   r   r   rp  rz    rQ   r   rp  rq  rp   )rT   rC   rv  rq   rj   rr   rb  r   r"   r]  r+   r-   rs   r(   r0   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   rv  rj   rb  rK   rV   r^  rW   rw   rp  r3   r!   r   r   r   rx   s                    r   )test_registerAdapter_wo_explicit_providedz9ComponentsTests.test_registerAdapter_wo_explicit_provided  s   >;8?	> 	 F|F|	T		 	 
	 }}++- 	L  D7U K	L//248>uE#$ 	%44dWdE5IJ"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..8))U23))U23,,89#	L 	Ls   2IIc                     ddl m}  G d d|      } |d      }d}d} G d d      }| j                         }| j                  t        |j
                  ||||	       y )
Nr   rB   c                       e Zd Zy)HComponentsTests.test_registerAdapter_no_required_available.<locals>.IFooNrH   r&   r   r   rK   r~    rL   r   rK   rR   r   c                       e Zd Zy)LComponentsTests.test_registerAdapter_no_required_available.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  rv   r   rR   rr  r   rC   rK   rV   rW   rw   rp  r3   s           r   *test_registerAdapter_no_required_availablez:ComponentsTests.test_registerAdapter_no_required_available  sd    >	> 	 F|	 	 }})T%9%98#'e% 	 	Ar   c           	          ddl m}  G d d|      } |d      } |d      }d}d} G d d	      }| j                         }| j                  t        |j
                  |||||
       y )Nr   rB   c                       e Zd Zy)EComponentsTests.test_registerAdapter_w_invalid_required.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rR   r   c                       e Zd Zy)IComponentsTests.test_registerAdapter_w_invalid_required.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  r  rr  )	r   rC   rK   rV   r^  rW   rw   rp  r3   s	            r   'test_registerAdapter_w_invalid_requiredz7ComponentsTests.test_registerAdapter_w_invalid_required  so    >	> 	 F|F|	 	 }})T%9%98E 	 	Gr   c                    ddl m} ddlm} ddlm} ddlm}  G d d|      } |d      }d}d	} G d
 d      }	| j                         }
| j                         \  }}|5  |
j                  |	d g|||       d d d        | j                  |
j                  j                  d   |   |   |   |	u        | j                  |
j                  |f||f   |	|f       | j                  t!        |      d       |d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j$                  |             | j                  |j$                  j&                  |
u        | j                  |j$                  j(                  |u        | j                  |j$                  j*                  |f       | j                  |j$                  j,                  |u        | j                  |j$                  j.                  |u        | j                  |j$                  j0                  |	u        y # 1 sw Y   xY w)Nr   rB   r   ri   ra  c                       e Zd Zy)MComponentsTests.test_registerAdapter_w_required_containing_None.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   rR   r   c                       e Zd Zy)QComponentsTests.test_registerAdapter_w_required_containing_None.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  r  rp   )rT   rC   zope.interface.interfacer   rq   rj   rr   rb  r   r"   r]  r+   r-   rs   r(   r0   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   r   rj   rb  rK   rV   rW   rw   rp  r3   r!   r   r   r   rx   s                   r   /test_registerAdapter_w_required_containing_Nonez?ComponentsTests.test_registerAdapter_w_required_containing_None  s   >68?	> 	 F|	 	 }}++- 	9  D6D&+% ! 9	9 	MM##A&y1$7>(J	
 	''dE(ABu	
 	Wq)1:bR 
5*56
5<<1DEF--56--56..=))U23))U23,,89+	9 	9s   H;;Ic                    ddl m} ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d	      }d
}	d}
 G d d      } ||       G d d             } ||      }| j                         }| j                         \  }}|5  |j                  ||g||
|	       d d d        | j                  |j                  j                  d   |   |   |
   |u        | j                  |j                  |f||
f   ||	f       | j                  t!        |      d       |d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j$                  |             | j                  |j$                  j&                  |u        | j                  |j$                  j(                  |u        | j                  |j$                  j*                  |f       | j                  |j$                  j,                  |
u        | j                  |j$                  j.                  |	u        | j                  |j$                  j0                  |u        y # 1 sw Y   xY w)Nr   rB   )implementedByru  ri   ra  c                       e Zd Zy)NComponentsTests.test_registerAdapter_w_required_containing_class.<locals>.IFooNrH   r&   r   r   rK   r  &  rL   r   rK   r   rR   r   c                       e Zd Zy)RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._FactoryNrH   r&   r   r   rp  r  .  rL   r   rp  c                       e Zd Zy)RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._ContextNrH   r&   r   r   _Contextr  1  rQ   r   r  r  rp   )rT   rC   r  rv  rq   rj   rr   rb  r   r"   r]  r+   r-   rs   r(   r0   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   r  rv  rj   rb  rK   rV   r^  rW   rw   rp  r  	_ctx_implr3   r!   r   r   r   rx   s                       r   0test_registerAdapter_w_required_containing_classz@ComponentsTests.test_registerAdapter_w_required_containing_class  s0   >=;8?	> 	 F|F|	 	 
T		 	 
	 "(+	}}++- 	9  H:&+% ! 9	9 	MM##A&y1$7>(J	
 	''dE(ABu	
 	Wq)1:bR 
5*56
5<<1DEF--56--56..=))U23))U23,,89+	9 	9s   
I&&I0c                    ddl m}  G d d|      } |d      }d}d} G d d      }| j                         }| j                  t              5  |j                  |t               g|||	       d d d        y # 1 sw Y   y xY w)
Nr   rB   c                       e Zd Zy)MComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>.IFooNrH   r&   r   r   rK   r  R  rL   r   rK   rR   r   c                       e Zd Zy)QComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>._FactoryNrH   r&   r   r   rp  r  Z  rL   r   rp  r  )rT   rC   r   rc   rd   r]  rb   r  s           r   /test_registerAdapter_w_required_containing_junkz?ComponentsTests.test_registerAdapter_w_required_containing_junkO  s    >	> 	 F|	 	 }}y) 	  68*t%e ! 	 	 	s    A66A?c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      d}d	} G fd
d      }| j                         }	| j                         \  }
}|
5  |	j                  ||||       d d d        | j                  |	j                  j                  d      |   |   |u        | j                  |	j                  f||f   ||f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |	u        | j                  |j                   j$                  |u        | j                  |j                   j&                  f       | j                  |j                   j(                  |u        | j                  |j                   j*                  |u        | j                  |j                   j,                  |u        y # 1 sw Y   xY w)Nr   rB   ri   ra  c                       e Zd Zy)GComponentsTests.test_registerAdapter_wo_explicit_required.<locals>.IFooNrH   r&   r   r   rK   r  h  rL   r   rK   r   rR   r   c                       e Zd ZW  fZy)KComponentsTests.test_registerAdapter_wo_explicit_required.<locals>._FactoryNr)   rI   rJ   __component_adapts__r^  s   r   rp  r  p      $(7 r   rp  r  rp   rh  )r   rC   rj   rb  rK   rV   rW   rw   rp  r3   r!   r   r   r   rx   r^  s                  @r   )test_registerAdapter_wo_explicit_requiredz9ComponentsTests.test_registerAdapter_wo_explicit_requiredc  s   >8?	> 	 F|F|	+ 	+ }}++- 	-  Du&+ ! -	- 	//248>uE#$ 	%44dWdE5IJ"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..8))U23))U23,,89%	- 	-s   $H>>Ic           	      .   ddl m}  G d d|      } |d      } |d      }d}d}d }| j                         }| j                         \  }	}
|	5  |j	                  ||f|||d	
       d d d        | j                  t        |
      d       y # 1 sw Y   %xY w)Nr   rB   c                       e Zd Zy);ComponentsTests.test_registerAdapter_wo_event.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rR   r   c                     t               r   r[   rf  s    r   r]   z?ComponentsTests.test_registerAdapter_wo_event.<locals>._factory  r^   r   F)rx   )rT   rC   r   r"   r]  r(   ru   )r   rC   rK   rV   r^  rW   rw   r]   r3   r!   r   s              r   test_registerAdapter_wo_eventz-ComponentsTests.test_registerAdapter_wo_event  s    >	> 	 F|F|	(}}++- 	.  D7D%', ! .	. 	Wq)	. 	.s   BBc                 j    | j                         }| j                  t        |j                  d d        y N)ra   rv   )r   rc   rd   unregisterAdapterr;   s     r   3test_unregisterAdapter_neither_factory_nor_providedzCComponentsTests.test_unregisterAdapter_neither_factory_nor_provided  s/    }})T%;%;"& 	 	7r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t        |j
                  d |d        y )Nr   rB   c                       e Zd Zy)QComponentsTests.test_unregisterAdapter_neither_factory_nor_required.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   ra   rv   ri  )rT   rC   r   rc   rd   r  r,  s        r   3test_unregisterAdapter_neither_factory_nor_requiredzCComponentsTests.test_unregisterAdapter_neither_factory_nor_required  sL    >	> 	 F|}})T%;%;"& 	 	Fr   c                    ddl m}  G d d|      } |d      } |d      } G d d      }| j                         }| j                         \  }}|5  |j	                  ||f|      }	d d d        | j                  	       y # 1 sw Y   xY w)Nr   rB   c                       e Zd Zy)9ComponentsTests.test_unregisterAdapter_miss.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zy)=ComponentsTests.test_unregisterAdapter_miss.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  )rT   rC   r   r"   r  r   
r   rC   rK   rV   r^  rp  r3   r!   r   r   s
             r   test_unregisterAdapter_missz+ComponentsTests.test_unregisterAdapter_miss  s    >	> 	 F|F|	 	 }}++- 	D**8dWdCE	D	D 	Ds   B  B	c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } G d d	      }| j                         }|j                  ||f|       | j                         \  }	}
|	5  |j                  ||f|      }d d d        | j                         | j                  |j                  j                         | j                  |j                         | j                  t!        |
      d
       |
d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j$                  |             | j                  |j$                  j&                  |u        | j                  |j$                  j(                  |u        | j                  |j$                  j*                  |f       | j                  |j$                  j,                  d       | j                  |j$                  j.                  d       | j                  |j$                  j0                  |u        y # 1 sw Y   xY w)Nr   rB   r   ra  c                       e Zd Zy)YComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zy)]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  rp   ro   )rT   rC   rq   r   rr   rb  r   r]  r"   r  r+   r   r-   rs   r0   r(   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   r   rb  rK   rV   r^  rp  r3   r!   r   r   r   r   rx   s                  r   ;test_unregisterAdapter_hit_w_explicit_provided_and_requiredzKComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required  s   >:?	> 	 F|F|	 	 }}Xw5++- 	D**8dWdCE	D001445Wq)1:bR 
5,78
5<<1DEF--56--56..8**B/**B/,,89!	D 	D   1IIc                 <   ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } ||       G d	 d
             }| j                         }	|	j                  ||f|       | j                         \  }
}|
5  |	j                  ||f      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |	u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |f       | j                  |j                  j&                  d       | j                  |j                  j(                  d       | j                  |j                  j*                  |u        y # 1 sw Y   }xY w)Nr   rB   ru  r   ra  c                       e Zd Zy)IComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zy)MComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>._FactoryNrH   r&   r   r   rp  r    rQ   r   rp  rp   ro   )rT   rC   rv  rq   r   rr   rb  r   r]  r"   r  r+   r(   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   rv  r   rb  rK   rV   r^  rp  r3   r!   r   r   r   r   rx   s                   r   +test_unregisterAdapter_wo_explicit_providedz;ComponentsTests.test_unregisterAdapter_wo_explicit_provided  s   >;:?	> 	 F|F|	T		 	 
	 }}Xw5++- 	>**8dW=E	>Wq)1:bR 
5,78
5<<1DEF--56--56..8**B/**B/,,89	> 	>   HHc                     ddl m} ddlm} ddlm}  G d d|      } |d      } |d       G fdd	      }| j                         }|j                  |f|       | j                         \  }}	|5  |j                  ||
      }
d d d        | j                  
       | j                  t        |	      d       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  f       | j                  |j                  j$                  d       | j                  |j                  j&                  d       | j                  |j                  j(                  |u        y # 1 sw Y   }xY w)Nr   rB   r   ra  c                       e Zd Zy)IComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>.IFooNrH   r&   r   r   rK   r  
  rL   r   rK   r   c                       e Zd ZW  fZy)MComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rp  r    r  r   rp  rv   rp   ro   )rT   rC   rq   r   rr   rb  r   r]  r"   r  r+   r(   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   r   rb  rK   rV   rp  r3   r!   r   r   r   r   rx   r^  s                 @r   +test_unregisterAdapter_wo_explicit_requiredz;ComponentsTests.test_unregisterAdapter_wo_explicit_required  s   >:?	> 	 F|F|	+ 	+ }}Xw5++- 	D**8d*CE	DWq)1:bR 
5,78
5<<1DEF--56--56..8**B/**B/,,89	D 	D   4HHc                 v    | j                         }| j                  t        |j                               g        y r   )r   r(   r   registeredAdaptersr;   s     r   test_registeredAdapters_emptyz-ComponentsTests.test_registeredAdapters_empty&  s+    }}d5578"=r   c                    ddl m} ddlm}  G d d|      } |d      } |d      }d}d}d} G d	 d
      }	| j	                         }
|
j                  |	|f|||       |
j                  |	|f|||       t        |
j                         d       }| j                  t        |      d       | j                  t        |d   |             | j                  |d   j                  |
u        | j                  |d   j                  |u        | j                  |d   j                  |f       | j                  |d   j                  |u        | j                  |d   j                   |u        | j                  |d   j"                  |	u        | j                  t        |d   |             | j                  |d   j                  |
u        | j                  |d   j                  |u        | j                  |d   j                  |f       | j                  |d   j                  |u        | j                  |d   j                   |u        | j                  |d   j"                  |	u        y )Nr   rB   ra  c                       e Zd Zy)>ComponentsTests.test_registeredAdapters_notempty.<locals>.IFooNrH   r&   r   r   rK   r  .  rL   r   rK   rR   r   r   c                       e Zd Zy)BComponentsTests.test_registeredAdapters_notempty.<locals>._FactoryNrH   r&   r   r   rp  r  7  rL   r   rp  c                     | j                   S r   r  r   s    r   r"  zBComponentsTests.test_registeredAdapters_notempty.<locals>.<lambda>=  s
    aff r   r#  r   rp   )rT   rC   rr   rb  r   r]  r%  r  r(   ru   r+   r,   r   rv   ri  r   rR   ra   )r   rC   rb  rK   rV   r^  rW   r   r   rp  r3   r&  s               r    test_registeredAdapters_notemptyz0ComponentsTests.test_registeredAdapters_notempty*  s   >?	> 	 F|F|	 	 }}XwfeDXwfeDT,,.4DES1%
3q6+>?@A4/0A4/0Q4'2Av-.Au,-A(23
3q6+>?@A4/0A4/0Q4'2Av-.Au,-A(23r   c                     ddl m}  G d d|      } |d      }| j                         }t               }| j	                  |j                  ||      d u        y )Nr   rB   c                       e Zd Zy)?ComponentsTests.test_queryAdapter_miss_no_default.<locals>.IFooNrH   r&   r   r   rK   r  Q  rL   r   rK   rT   rC   r   rb   r+   queryAdapter)r   rC   rK   rV   r3   _contexts         r   !test_queryAdapter_miss_no_defaultz1ComponentsTests.test_queryAdapter_miss_no_defaultN  sL    >	> 	 F|}}8))(D9TABr   c                     ddl m}  G d d|      } |d      }| j                         }t               }t               }| j	                  |j                  |||      |u        y )Nr   rB   c                       e Zd Zy)>ComponentsTests.test_queryAdapter_miss_w_default.<locals>.IFooNrH   r&   r   r   rK   r  \  rL   r   rK   r1  r  )r   rC   rK   rV   r3   r  r3  s          r    test_queryAdapter_miss_w_defaultz0ComponentsTests.test_queryAdapter_miss_w_defaultY  s\    >	> 	 F|}}88hh?8K	Mr   c                 z   ddl m} ddl m}  G d d|      } |d      } |d      } G d d      } ||       G d	 d
             } |       }| j                         }	|	j	                  ||f|       |	j                  ||      }
| j                  t        |
|             | j                  |
j                  |u        y )Nr   rB   ru  c                       e Zd Zy)3ComponentsTests.test_queryAdapter_hit.<locals>.IFooNrH   r&   r   r   rK   r  j  rL   r   rK   r   c                       e Zd Zd Zy)7ComponentsTests.test_queryAdapter_hit.<locals>._Factoryc                     || _         y r   rf  r   rg  s     r   r  z@ComponentsTests.test_queryAdapter_hit.<locals>._Factory.__init__q  	    &r   Nr)   rI   rJ   r  r&   r   r   rp  r  p      'r   rp  c                       e Zd Zy)7ComponentsTests.test_queryAdapter_hit.<locals>._ContextNrH   r&   r   r   r  r  t  rQ   r   r  )	rT   rC   rv  r   r]  r  r+   r,   rg  r   rC   rv  rK   rV   r^  rp  r  r  r3   adapters              r   test_queryAdapter_hitz%ComponentsTests.test_queryAdapter_hitf  s    >;	> 	 F|F|	' 	' 
T		 	 
	 :}}Xw5##Hd3
7H56834r   c                     ddl m} ddl m} ddlm}  G d d|      } |d      } |d      } ||       G d d	             } |       }| j                         }	| j                  ||	j                  ||       y )
Nr   rB   ru  r;  c                       e Zd Zy)2ComponentsTests.test_getAdapter_miss.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zy)6ComponentsTests.test_getAdapter_miss.<locals>._ContextNrH   r&   r   r   r  r    rQ   r   r  )rT   rC   rv  rq   r<  r   rc   
getAdapter)
r   rC   rv  r<  rK   rV   r^  r  r  r3   s
             r   test_getAdapter_missz$ComponentsTests.test_getAdapter_miss  sw    >;B	> 	 F|F|	T		 	 
	 :}}.//8T	;r   c                 f   ddl m} ddl m}  G d d|      } |d      } |d      } G d d      } ||       G d	 d
             } |       }| j                         }	|	j	                  ||f|       |	j                  ||      }
| j                  |
|       | j                  |
j                  |       y )Nr   rB   ru  c                       e Zd Zy)1ComponentsTests.test_getAdapter_hit.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zd Zy)5ComponentsTests.test_getAdapter_hit.<locals>._Factoryc                     || _         y r   rf  r  s     r   r  z>ComponentsTests.test_getAdapter_hit.<locals>._Factory.__init__  r  r   Nr  r&   r   r   rp  r    r  r   rp  c                       e Zd Zy)5ComponentsTests.test_getAdapter_hit.<locals>._ContextNrH   r&   r   r   r  r	    rQ   r   r  )	rT   rC   rv  r   r]  r   assertIsInstanceassertIsrg  r  s              r   test_getAdapter_hitz#ComponentsTests.test_getAdapter_hit  s    >;	> 	 F|F|	' 	' 
T		 	 
	 :}}Xw5//(D1gx0goox0r   c                    ddl m} 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      }	| j	                         }
|
j                  |	|f|       |
j                  ||f|       | j                  |
        |       }|
j                  ||      }| j                  ||	       | j                  |j                  |       t        ||      }|
j                  ||      }| j                  ||       | j                  |j                  |       y )Nr   r   ru  c                       e Zd Zy)8ComponentsTests.test_getAdapter_hit_super.<locals>.IBaseNrH   r&   r   r   IBaser    rL   r   r  c                       e Zd Zy);ComponentsTests.test_getAdapter_hit_super.<locals>.IDerivedNrH   r&   r   r   IDerivedr    rL   r   r  c                       e Zd Zy)7ComponentsTests.test_getAdapter_hit_super.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   c                       e Zd Zy)7ComponentsTests.test_getAdapter_hit_super.<locals>.BaseNrH   r&   r   r   Baser    rQ   r   r  c                       e Zd Zy):ComponentsTests.test_getAdapter_hit_super.<locals>.DerivedNrH   r&   r   r   Derivedr    rQ   r   r  c                       e Zd Zd Zy)>ComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBasec                     || _         y r   rf  r  s     r   r  zGComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBase.__init__  r  r   Nr  r&   r   r   AdapterBaser    r  r   r  c                       e Zd Zd Zy)AComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerivedc                     || _         y r   rf  r  s     r   r  zJComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerived.__init__  r  r   Nr  r&   r   r   AdapterDerivedr!    r  r   r#  r   r   rT   rv  r   r]  _should_not_changer   r
  r  rg  r   r   r   rv  r  r  rK   r  r  r  r#  r3   derivedr  super   s                 r   test_getAdapter_hit_superz)ComponentsTests.test_getAdapter_hit_super  s9   ,;	I 		u 		9 	 
U		 	 
	 
X		d 	 
		' 	'	' 	' }}^h[$?[5(D9%)//'40g~6goow/Wg&//$-g{3goow/r   c                    ddl m} 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      }| j	                         }|j                  ||f|       |j                  |
|f|       | j                  |        |	       }|j                  ||      }| j                  ||       | j                  |j                  |       t        |	|      }|j                  ||      }| j                  ||
       | j                  |j                  |       y )Nr   r   ru  c                       e Zd Zy)^ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IBaseNrH   r&   r   r   r  r,    rL   r   r  c                       e Zd Zy)aComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IDerivedNrH   r&   r   r   r  r.    rL   r   r  c                       e Zd Zy)]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IFooNrH   r&   r   r   rK   r0    rL   r   rK   c                       e Zd Zy)]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.BaseNrH   r&   r   r   r  r2    rL   r   r  c                       e Zd Zy)_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child1NrH   r&   r   r   Child1r4    rL   r   r5  c                       e Zd Zy)_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child2NrH   r&   r   r   Child2r7    rQ   r   r8  c                       e Zd Zy)`ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.DerivedNrH   r&   r   r   r  r:    rQ   r   r  c                       e Zd Zd Zy)dComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterBasec                     || _         y r   rf  r  s     r   r  zmComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterBase.__init__  r  r   Nr  r&   r   r   r  r<    r  r   r  c                       e Zd Zd Zy)gComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterDerivedc                     || _         y r   rf  r  s     r   r  zpComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterDerived.__init__  r  r   Nr  r&   r   r   r#  r?    r  r   r#  r$  )r   r   rv  r  r  rK   r  r5  r8  r  r  r#  r3   r'  r  r(  r   s                   r   ?test_getAdapter_hit_super_w_parent_implements_interface_diamondzOComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond  sS   ,;	I 		u 		9 		 		T 	 
U		T 	 
	 
X		ff 	 
		' 	'	' 	' }}^h[$?[5(D9%)//'40g~6goow/Wg&//$-g{3goow/r   c                 :   ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
| j                         }| j	                  |j                  |	|
f|      d        y )Nr   rB   ru  c                       e Zd Zy)9ComponentsTests.test_queryMultiAdapter_miss.<locals>.IFooNrH   r&   r   r   rK   rD    rL   r   rK   r   IBazc                       e Zd Zy)>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context1NrH   r&   r   r   	_Context1rG    rQ   r   rH  c                       e Zd Zy)>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context2NrH   r&   r   r   	_Context2rJ    rQ   r   rK  )rT   rC   rv  r   r(   queryMultiAdapterr   rC   rv  rK   rV   r^  ibazrH  rK  	_context1	_context2r3   s               r   test_queryMultiAdapter_missz+ComponentsTests.test_queryMultiAdapter_miss
  s    >;	> 	F|F|F|	T		 	 
	 
T		 	 
	 K	K	}}//I0FM	r   c                 T   ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
t               }| j	                         }| j                  |j                  |	|
f||      |u        y )Nr   rB   ru  c                       e Zd Zy)CComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>.IFooNrH   r&   r   r   rK   rT  &  rL   r   rK   r   rE  c                       e Zd Zy)HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context1NrH   r&   r   r   rH  rV  -  rQ   r   rH  c                       e Zd Zy)HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context2NrH   r&   r   r   rK  rX  1  rQ   r   rK  r1  )rT   rC   rv  rb   r   r+   rL  )r   rC   rv  rK   rV   r^  rN  rH  rK  rO  rP  r3  r3   s                r   %test_queryMultiAdapter_miss_w_defaultz5ComponentsTests.test_queryMultiAdapter_miss_w_default"  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K	8}}""Iy#94+3 # 58@A	Br   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
 G d d      }| j                         }|j	                  |||f|       |j                  |	|
f|      }| j                  t        ||             | j                  |j                  |	|
f       y )Nr   rB   ru  c                       e Zd Zy)8ComponentsTests.test_queryMultiAdapter_hit.<locals>.IFooNrH   r&   r   r   rK   r\  A  rL   r   rK   r   rE  c                       e Zd Zy)=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context1NrH   r&   r   r   rH  r^  H  rQ   r   rH  c                       e Zd Zy)=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context2NrH   r&   r   r   rK  r`  L  rQ   r   rK  c                       e Zd Zd Zy)<ComponentsTests.test_queryMultiAdapter_hit.<locals>._Factoryc                     ||f| _         y r   rf  r   context1context2s      r   r  zEComponentsTests.test_queryMultiAdapter_hit.<locals>._Factory.__init__T      '1r   Nr  r&   r   r   rp  rb  S      2r   rp  )
rT   rC   rv  r   r]  rL  r+   r,   r(   rg  r   rC   rv  rK   rV   r^  rN  rH  rK  rO  rP  rp  r3   r  s                 r   test_queryMultiAdapter_hitz*ComponentsTests.test_queryMultiAdapter_hit=  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K		2 	2 }}Xd|T:(()Y)?F
7H569i*@Ar   c                 >   ddl m} ddl m} ddlm}  G d d|      } |d      } |d      } |d      } ||       G d	 d
             } ||       G d d             }	 |       }
 |	       }| j                         }| j                  ||j                  |
|f|       y )Nr   rB   ru  r;  c                       e Zd Zy)7ComponentsTests.test_getMultiAdapter_miss.<locals>.IFooNrH   r&   r   r   rK   rm  b  rL   r   rK   r   rE  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context1NrH   r&   r   r   rH  ro  i  rQ   r   rH  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context2NrH   r&   r   r   rK  rq  m  rQ   r   rK  )rT   rC   rv  rq   r<  r   rc   getMultiAdapter)r   rC   rv  r<  rK   rV   r^  rN  rH  rK  rO  rP  r3   s                r   test_getMultiAdapter_missz)ComponentsTests.test_getMultiAdapter_miss]  s    >;B	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K	}}...I0F	Nr   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
 G d d      }| j                         }|j	                  |||f|       |j                  |	|
f|      }| j                  t        ||             | j                  |j                  |	|
f       y )Nr   rB   ru  c                       e Zd Zy)6ComponentsTests.test_getMultiAdapter_hit.<locals>.IFooNrH   r&   r   r   rK   rv  {  rL   r   rK   r   rE  c                       e Zd Zy);ComponentsTests.test_getMultiAdapter_hit.<locals>._Context1NrH   r&   r   r   rH  rx    rQ   r   rH  c                       e Zd Zy);ComponentsTests.test_getMultiAdapter_hit.<locals>._Context2NrH   r&   r   r   rK  rz    rQ   r   rK  c                       e Zd Zd Zy):ComponentsTests.test_getMultiAdapter_hit.<locals>._Factoryc                     ||f| _         y r   rf  rd  s      r   r  zCComponentsTests.test_getMultiAdapter_hit.<locals>._Factory.__init__  rg  r   Nr  r&   r   r   rp  r|    rh  r   rp  )
rT   rC   rv  r   r]  rr  r+   r,   r(   rg  ri  s                 r   test_getMultiAdapter_hitz(ComponentsTests.test_getMultiAdapter_hitw  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K		2 	2 }}Xd|T:&&	9'=tD
7H569i*@Ar   c                 v      fd}||_         ||j                  _         ||j                  j                  _         y )Nc                  (    j                  d       y )NzNothing should get changed)fail)r   r   s    r   
no_changesz6ComponentsTests._should_not_change.<locals>.no_changes  s    II23r   )changedr-   	_v_lookup)r   r3   r  s   `  r   r%  z"ComponentsTests._should_not_change  s-    	4! **4'r   c                 8   ddl m} 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|      }	| j	                         }
|
j                  |	||f|       |
j                  |||f|       | j                  |
        |       }|
j                  ||f|      }| j                  ||	       | j                  |j                  |       | j                  |j                  |       t        ||      }|
j                  ||f|      }| j                  ||       | j                  ||	       | j                  |j                  |       | j                  |j                  |       y )Nr   r   ru  c                       e Zd Zy)=ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IBaseNrH   r&   r   r   r  r    rL   r   r  c                       e Zd Zy)@ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IDerivedNrH   r&   r   r   r  r    rL   r   r  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.BaseNrH   r&   r   r   r  r    rQ   r   r  c                       e Zd Zy)?ComponentsTests.test_getMultiAdapter_hit_super.<locals>.DerivedNrH   r&   r   r   r  r    rQ   r   r  c                       e Zd Zd Zy)CComponentsTests.test_getMultiAdapter_hit_super.<locals>.AdapterBasec                      || _         || _        y r   )re  rf  rd  s      r   r  zLComponentsTests.test_getMultiAdapter_hit_super.<locals>.AdapterBase.__init__  s     ( (r   Nr  r&   r   r   r  r    s    )r   r  c                       e Zd Zy)FComponentsTests.test_getMultiAdapter_hit_super.<locals>.AdapterDerivedNrH   r&   r   r   r#  r    rL   r   r#  )r   r   rT   rv  r   r]  r%  rr  r
  r  re  rf  r   assertNotIsInstancer&  s                 r   test_getMultiAdapter_hit_superz.ComponentsTests.test_getMultiAdapter_hit_super  s   ,;	I 		u 		9 	 
U		 	 
	 
X		d 	 
		) 	)
	[ 	 }}^h-A4H[5(*;TB%)&&'94@g~6g&&0g&&0Wg&&&g=g{3  .9g&&0g&&0r   c                 L   ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
| j                         }| j	                  t        |j                  |	|
f|            g        y )Nr   rB   ru  c                       e Zd Zy)4ComponentsTests.test_getAdapters_empty.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rE  c                       e Zd Zy)9ComponentsTests.test_getAdapters_empty.<locals>._Context1NrH   r&   r   r   rH  r    rQ   r   rH  c                       e Zd Zy)9ComponentsTests.test_getAdapters_empty.<locals>._Context2NrH   r&   r   r   rK  r    rQ   r   rK  )rT   rC   rv  r   r(   r   getAdaptersrM  s               r   test_getAdapters_emptyz&ComponentsTests.test_getAdapters_empty  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K	}}!!9i"8$?@"	Fr   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
| j                         }g fd}|j	                  |||f|       | j                  t        |j                  |	|
f|            g        | j                  |	|
fg       y )Nr   rB   ru  c                       e Zd Zy)CComponentsTests.test_getAdapters_factory_returns_None.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rE  c                       e Zd Zy)HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context1NrH   r&   r   r   rH  r    rQ   r   rH  c                       e Zd Zy)HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context2NrH   r&   r   r   rK  r    rQ   r   rK  c                 ,    j                  | |f       y r   r   )re  rf  _called_withs     r   _side_effect_onlyzPComponentsTests.test_getAdapters_factory_returns_None.<locals>._side_effect_only  s    8 45r   )rT   rC   rv  r   r]  r(   r   r  )r   rC   rv  rK   rV   r^  rN  rH  rK  rO  rP  r3   r  r  s                @r   %test_getAdapters_factory_returns_Nonez5ComponentsTests.test_getAdapters_factory_returns_None  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K	}}	 	.tdC!!9i"8$?@"	FI(>'?@r   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	             } ||       G d
 d             } |       }	 |       }
 G d d      } G d d      }d}d}| j                         }|j	                  |||f||       |j	                  |||f||       t        |j                  |	|
f|            }| j                  t        |      d       | j                  |d   d   |       | j                  t        |d   d   |             | j                  |d   d   |       | j                  t        |d   d   |             y )Nr   rB   ru  c                       e Zd Zy)8ComponentsTests.test_getAdapters_non_empty.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rE  c                       e Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Context1NrH   r&   r   r   rH  r    rQ   r   rH  c                       e Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Context2NrH   r&   r   r   rK  r    rQ   r   rK  c                       e Zd Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory1c                     ||f| _         y r   rf  rd  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory1.__init__!  rg  r   Nr  r&   r   r   	_Factory1r     rh  r   r  c                       e Zd Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory2c                     ||f| _         y r   rf  rd  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory2.__init__%  rg  r   Nr  r&   r   r   	_Factory2r  $  rh  r   r  r   r   r  r   rp   )rT   rC   rv  r   r]  r%  r  r(   ru   r+   r,   )r   rC   rv  rK   rV   r^  rN  rH  rK  rO  rP  r  r  r   r   r3   founds                    r   test_getAdapters_non_emptyz*ComponentsTests.test_getAdapters_non_empty
  sr   >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K		2 	2	2 	2 }}YtdHYtdHt''I(>EFUQ'q!f-
58A;	:;q!f-
58A;	:;r   c           	          ddl m}  G d d|      } |d      } |d      }d}d}d }| j                         }| j                  t        |j
                  ||f|||       y )	Nr   rB   c                       e Zd Zy)NComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrH   r&   r   r   rK   r  7  rL   r   rK   r   r   rR   c                     t               r   r[   rf  s    r   r]   zRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>._factory?  r^   r   )rT   rC   r   rc   rd   registerSubscriptionAdapter)	r   rC   rK   rV   r^  rw   rW   r]   r3   s	            r   0test_registerSubscriptionAdapter_w_nonblank_namez@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name4  sg    >	> 	 F|F|	( }})T%E%E"TGT5%	Ar   c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d}d	}d
 }	| j                         }
| j                         \  }}|5  |
j                  |	|f||       d d d        |
j                  j                  d   |   |   |   }| j                  t        |      d       | j                  |d   |	u        | j                  |
j                  |f|||	|fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |
u        | j                  |j                   j$                  |u        | j                  |j                   j&                  |f       | j                  |j                   j(                  |       | j                  |j                   j*                  |u        | j                  |j                   j,                  |	u        y # 1 sw Y   xY w)Nr   rB   ri   SubscriptionRegistrationc                       e Zd Zy)]ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>.IFooNrH   r&   r   r   rK   r  K  rL   r   rK   r   ro   rR   c                     t               r   r[   rf  s    r   r]   zaComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>._factoryS  r^   r   rS   rp   rT   rC   rq   rj   rr   r  r   r"   r  r-   rt   r(   ru   r+   r1   r,   rb   r   rv   ri  r   rR   ra   )r   rC   rj   r  rK   rV   r^  _blankrW   r]   r3   r!   r   r&  r   r   rx   s                    r   ?test_registerSubscriptionAdapter_w_explicit_provided_n_requiredzOComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_requiredF  s   >8D	> 	 F|F|	( }}++- 	9,,Xw27 - 9	9 mm((+D1$7?S1%A(*+99 7D&(EBC	EWq)1:bR 
5*56
5<<1IJK--56--56..8**F3))U23,,89'	9 	9s   IIc                    ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d	}d
}	 ||       G d d             }
| j                         }| j                         \  }}|5  |j                  |
|f|       d d d        |j                  j                  d   |   |   |	   }| j                  t        |      d       | j                  |d   |
u        | j                  |j                  |f||	|
|fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t!        ||             | j                  t!        |j"                  |             | j                  |j"                  j$                  |u        | j                  |j"                  j&                  |u        | j                  |j"                  j(                  |f       | j                  |j"                  j*                  |	       | j                  |j"                  j,                  |u        | j                  |j"                  j.                  |
u        y # 1 sw Y   xY w)Nr   rB   ru  ri   r  c                       e Zd Zy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   r  s  rL   r   rK   r   rR   ro   c                       e Zd Zy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrH   r&   r   r   rp  r  {  rQ   r   rp  rS   rp   )rT   rC   rv  rq   rj   rr   r  r   r"   r  r-   rt   r(   ru   r+   r1   r,   rb   r   rv   ri  r   rR   ra   )r   rC   rv  rj   r  rK   rV   r^  rW   r  rp  r3   r!   r   r&  r   r   rx   s                     r   5test_registerSubscriptionAdapter_wo_explicit_providedzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_providedm  s"   >;8D	> 	 F|F|	T		 	 
	 }}++- 	L,,XwU,K	Lmm((+D1$7?S1%A(*+99 7D&(EBC	EWq)1:bR 
5*56
5<<1IJK--56--56..8**F3))U23,,89%	L 	Ls   2I))I3c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      d}d	} G fd
d      }| j                         }	| j                         \  }
}|
5  |	j                  |||       d d d        |	j                  j                  d      |   |   }| j                  t        |      d       | j                  |d   |u        | j                  |	j                  f||||fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |	u        | j                  |j                   j$                  |u        | j                  |j                   j&                  f       | j                  |j                   j(                  |       | j                  |j                   j*                  |u        | j                  |j                   j,                  |u        y # 1 sw Y   xY w)Nr   rB   ri   r  c                       e Zd Zy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rR   ro   c                       e Zd ZW  fZy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rp  r    r  r   rp  )rv   rR   rp   r  )r   rC   rj   r  rK   rV   rW   r  rp  r3   r!   r   r&  r   r   rx   r^  s                   @r   5test_registerSubscriptionAdapter_wo_explicit_requiredzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required  s   >8D	> 	 F|F|	+ 	+ }}++- 	,,4e - 	 mm((+D1$7?S1%A(*+99 7D&(EBC	EWq)1:bR 
5*56
5<<1IJK--56--56..8**F3))U23,,89)	 	s   $II$c                 (   ddl m}  G d d|      } |d      } |d      }d}d }| j                         }| j                         \  }}	|5  |j	                  ||f||d	       d d d        | j                  t        |	      d       y # 1 sw Y   %xY w)
Nr   rB   c                       e Zd Zy)GComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   rR   c                     t               r   r[   rf  s    r   r]   zKComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>._factory  r^   r   FrR   rx   )rT   rC   r   r"   r  r(   ru   )
r   rC   rK   rV   r^  rW   r]   r3   r!   r   s
             r   )test_registerSubscriptionAdapter_wo_eventz9ComponentsTests.test_registerSubscriptionAdapter_wo_event  s    >	> 	 F|F|	( }}++- 	F,,Xw27u - F	F 	Wq)	F 	Fs   BBc                 v    | j                         }| j                  t        |j                               g        y r   )r   r(   r   registeredSubscriptionAdaptersr;   s     r   )test_registeredSubscriptionAdapters_emptyz9ComponentsTests.test_registeredSubscriptionAdapters_empty  s+    }}dAACDbIr   c                    ddl m} ddlm}  G d d|      } |d      } |d      }d}d} G d d	      }| j	                         }	|	j                  ||f||
       |	j                  ||f||
       t        |	j                               }
| j                  t        |
      d       | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |f       | j                  |
d   j                  |       | j                  |
d   j                   |u        | j                  |
d   j"                  |u        | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |f       | j                  |
d   j                  |       | j                  |
d   j                   |u        | j                  |
d   j"                  |u        y )Nr   rB   r  c                       e Zd Zy)JComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   rR   ro   c                       e Zd Zy)NComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  rS   r   rp   )rT   rC   rr   r  r   r  r   r  r(   ru   r+   r,   r   rv   ri  r   rR   ra   )r   rC   r  rK   rV   r^  rW   r  rp  r3   r&  s              r   ,test_registeredSubscriptionAdapters_notemptyz<ComponentsTests.test_registeredSubscriptionAdapters_notempty  s   >D	> 	 F|F|	 	 }}((D7Du(M((D7Du(M46689S1%
3q6+CDEA4/0A4/0Q4'2Qf-Au,-A(23
3q6+CDEA4/0A4/0Q4'2Qf-Au,-A(23r   c                     ddl m}  G d d|      } |d      } |d      }d}| j                         }| j                  t        |j
                  |||       y )Nr   rB   c                       e Zd Zy)PComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   nonblank)ri  rv   r   rT   rC   r   rc   rd   unregisterSubscriptionAdapter)r   rC   rK   rV   r^  	_nonblankr3   s          r   2test_unregisterSubscriptionAdapter_w_nonblank_namezBComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name  sZ    >	> 	 F|F|	}})T%G%G#'$Y 	 	Hr   c                 j    | j                         }| j                  t        |j                  d d        y r  )r   rc   rd   r  r;   s     r   ?test_unregisterSubscriptionAdapter_neither_factory_nor_providedzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_provided  s/    }})T%G%G"& 	 	7r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t        |j
                  d |d        y )Nr   rB   c                       e Zd Zy)]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r  r  r,  s        r   ?test_unregisterSubscriptionAdapter_neither_factory_nor_requiredzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required
  sL    >	> 	 F|}})T%G%G"& 	 	Fr   c                 :   ddl m}  G d d|      } |d      } |d      } G d d      }| j                         }| j                         \  }}|5  |j	                  ||f|      }	d d d        | j                  	       | j                  |       y # 1 sw Y   ,xY w)Nr   rB   c                       e Zd Zy)EComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zy)IComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>._FactoryNrH   r&   r   r   rp  r    rL   r   rp  )rT   rC   r   r"   r  r   r  s
             r   'test_unregisterSubscriptionAdapter_missz7ComponentsTests.test_unregisterSubscriptionAdapter_miss  s    >	> 	 F|F|	 	 }}++- 	P66x$$OE	P!	P 	Ps   BBc                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } G d d	      }| j                         }|j                  ||f|       | j                         \  }	}
|	5  |j                  d |f|      }d d d        | j                         | j                  |j                  j                         | j                  |j                         | j                  t!        |
      d
       |
d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j$                  |             | j                  |j$                  j&                  |u        | j                  |j$                  j(                  |u        | j                  |j$                  j*                  |f       | j                  |j$                  j,                  d       | j                  |j$                  j.                  d       | j                  |j$                  j0                  d u        y # 1 sw Y   xY w)Nr   rB   r   r  c                       e Zd Zy)OComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>.IFooNrH   r&   r   r   rK   r  -  rL   r   rK   r   c                       e Zd Zy)SComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>._FactoryNrH   r&   r   r   rp  r  3  rL   r   rp  rp   ro   rT   rC   rq   r   rr   r  r   r  r"   r  r+   r   r-   rt   r1   r(   ru   r,   rb   r   rv   ri  r   rR   ra   r   rC   r   r  rK   rV   r^  rp  r3   r!   r   r   r   r   rx   s                  r   1test_unregisterSubscriptionAdapter_hit_wo_factoryzAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory(  s   >:D	> 	 F|F|	 	 }}((D7DA++- 	L66tdWdKE	L33499:Wq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,45!	L 	Lr  c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } G d d	      }| j                         }|j                  ||f|       | j                         \  }	}
|	5  |j                  ||f|      }d d d        | j                         | j                  |j                  j                         | j                  |j                         | j                  t!        |
      d
       |
d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j$                  |             | j                  |j$                  j&                  |u        | j                  |j$                  j(                  |u        | j                  |j$                  j*                  |f       | j                  |j$                  j,                  d       | j                  |j$                  j.                  d       | j                  |j$                  j0                  |u        y # 1 sw Y   xY w)Nr   rB   r   r  c                       e Zd Zy)NComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>.IFooNrH   r&   r   r   rK   r  P  rL   r   rK   r   c                       e Zd Zy)RComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>._FactoryNrH   r&   r   r   rp  r  V  rL   r   rp  rp   ro   r  r   s                  r   0test_unregisterSubscriptionAdapter_hit_w_factoryz@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factoryK  s   >:D	> 	 F|F|	 	 }}((D7DA++- 	P66x$$OE	P33499:Wq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,89!	P 	Pr  c                 <   ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } ||       G d	 d
             }| j                         }	|	j                  ||f|       | j                         \  }
}|
5  |	j                  ||f      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |	u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |f       | j                  |j                  j&                  d       | j                  |j                  j(                  d       | j                  |j                  j*                  |u        y # 1 sw Y   }xY w)Nr   rB   ru  r   r  c                       e Zd Zy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   r
  t  rL   r   rK   r   c                       e Zd Zy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrH   r&   r   r   rp  r  z  rQ   r   rp  rp   ro   )rT   rC   rv  rq   r   rr   r  r   r  r"   r  r+   r(   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   rv  r   r  rK   rV   r^  rp  r3   r!   r   r   r   r   rx   s                   r   7test_unregisterSubscriptionAdapter_wo_explicit_providedzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_providedn  s   >;:D	> 	 F|F|	T		 	 
	 }}((D7DA++- 	J66x$IE	JWq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,89	J 	Jr  c                     ddl m} ddlm} ddlm}  G d d|      } |d      } |d       G fdd	      }| j                         }|j                  |f|       | j                         \  }}	|5  |j                  ||
      }
d d d        | j                  
       | j                  t        |	      d       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  f       | j                  |j                  j$                  d       | j                  |j                  j&                  d       | j                  |j                  j(                  |u        y # 1 sw Y   }xY w)Nr   rB   r   r  c                       e Zd Zy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd ZW  fZy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rp  r    r  r   rp  r  rp   ro   )rT   rC   rq   r   rr   r  r   r  r"   r  r+   r(   ru   r,   rb   r   rv   ri  r   rR   ra   )r   rC   r   r  rK   rV   rp  r3   r!   r   r   r   r   rx   r^  s                 @r   7test_unregisterSubscriptionAdapter_wo_explicit_requiredzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required  s   >:D	> 	 F|F|	+ 	+ }}((D7DA++- 	P66x$6OE	PWq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,89	P 	Pr  c                    ddl m} ddl m}  G d d|      } |d      } |d      }| j                         } ||       G d d             } |       }| j	                  t        |j                  |f|            g        y )	Nr   rB   ru  c                       e Zd Zy)4ComponentsTests.test_subscribers_empty.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd Zy)3ComponentsTests.test_subscribers_empty.<locals>.BarNrH   r&   r   r   Barr    rQ   r   r  )rT   rC   rv  r   r(   r   subscribers)	r   rC   rv  rK   rV   r^  r3   r  bars	            r   test_subscribers_emptyz&ComponentsTests.test_subscribers_empty  s|    >;	> 	 F|F|}}	T		 	 
	 ed..vt<=rBr   c                    ddl m} ddl m}  G d d|      } |d      } |d       G fdd      } G d	 d
|      }| j                         }|j	                  |f|       |j	                  |f|        |       G d d             } |       }	|j                  |	f|      }
d }t        |
|      }
| j                  t        |
      d       | j                  t        |
d   |             | j                  t        |
d   |             y )Nr   rB   ru  c                       e Zd Zy)8ComponentsTests.test_subscribers_non_empty.<locals>.IFooNrH   r&   r   r   rK   r    rL   r   rK   r   c                       e Zd ZW  fZd Zy)<ComponentsTests.test_subscribers_non_empty.<locals>._Factoryc                     || _         y r   )r  r  s     r   r  zEComponentsTests.test_subscribers_non_empty.<locals>._Factory.__init__  s	     'r   N)r)   rI   rJ   r  r  r  s   r   rp  r!    s    $(7 (r   rp  c                       e Zd Zy)<ComponentsTests.test_subscribers_non_empty.<locals>._DerivedNrH   r&   r   r   _Derivedr$    rL   r   r%  c                       e Zd Zy)7ComponentsTests.test_subscribers_non_empty.<locals>.BarNrH   r&   r   r   r  r'    rQ   r   r  c                 .    | j                   j                  S r   )r   r)   xs    r   
_klassnamez>ComponentsTests.test_subscribers_non_empty.<locals>._klassname  s    ;;'''r   r#  r   rp   )rT   rC   rv  r   r  r  r%  r(   ru   r+   r,   )r   rC   rv  rK   rV   rp  r%  r3   r  r  r  r+  r^  s               @r   test_subscribers_non_emptyz*ComponentsTests.test_subscribers_non_empty  s   >;	> 	 F|F|	( 	(	x 	 }}((D7DA((D7DA	T		 	 
	 e&&vt4	( [j9[)1-
;q>8<=
;q>8<=r   c                     ddl m}  G d d|      } |d      }d}| j                         }d }| j                  t        |j
                  |||       y )Nr   rB   c                       e Zd Zy)BComponentsTests.test_registerHandler_w_nonblank_name.<locals>.IFooNrH   r&   r   r   rK   r/    rL   r   rK   r  c                     t               r   r[   rf  s    r   r]   zFComponentsTests.test_registerHandler_w_nonblank_name.<locals>._factory  r^   r   ri  r   )rT   rC   r   rc   rd   registerHandler)r   rC   rK   rV   r  r3   r]   s          r   $test_registerHandler_w_nonblank_namez4ComponentsTests.test_registerHandler_w_nonblank_name  sW    >	> 	 F|	}}	( 	)T%9%98#'i 	 	9r   c                 \   ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}d	 }| j                         }	| j                         \  }
}|
5  |	j                  ||f|
       d d d        |	j                  j                  d   |   d    |   }| j                  t        |      d       | j                  |d   |u        | j                  |	j                  |f|||fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |	u        | j                  |j                   j$                  |f       | j                  |j                   j&                  |       | j                  |j                   j(                  |u        | j                  |j                   j*                  |u        y # 1 sw Y   xY w)Nr   rB   ri   HandlerRegistrationc                       e Zd Zy)FComponentsTests.test_registerHandler_w_explicit_required.<locals>.IFooNrH   r&   r   r   rK   r8    rL   r   rK   ro   rR   c                     t               r   r[   rf  s    r   r]   zJComponentsTests.test_registerHandler_w_explicit_required.<locals>._factory	  r^   r   rS   rp   )rT   rC   rq   rj   rr   r6  r   r"   r2  r-   rt   r(   ru   r+   r2   r,   rb   r   ri  r   rR   ra   )r   rC   rj   r6  rK   rV   r  rW   r]   r3   r!   r   r&  r   r   rx   s                   r   (test_registerHandler_w_explicit_requiredz8ComponentsTests.test_registerHandler_w_explicit_required  s   >8?	> 	 F|	( }}++- 	@  D7 ?	@mm((+D1$7?S1%A(*+44 7FHe<=	?Wq)1:bR 
5*56
5<<1DEF--56..8**F3))U23,,89#	@ 	@s   H!!H+c                   
 ddl m}  G d d|      } |d      
d}d} G 
fdd      }| j                         }| j                         \  }}|5  |j	                  ||d	
       d d d        |j
                  j                  d   
   d    |   }	| j                  t        |	      d       | j                  |	d   |u        | j                  |j                  
f|||fg       | j                  t        |      d       y # 1 sw Y   xY w)Nr   rB   c                       e Zd Zy)PComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>.IFooNrH   r&   r   r   rK   r=  !	  rL   r   rK   rR   ro   c                       e Zd ZW  fZy)TComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>._FactoryNr  rV   s   r   rp  r?  (	  s    $(7 r   rp  Fr  rp   )rT   rC   r   r"   r2  r-   rt   r(   ru   r+   r2   )r   rC   rK   rW   r  rp  r3   r!   r   r&  rV   s             @r   2test_registerHandler_wo_explicit_required_no_eventzBComponentsTests.test_registerHandler_wo_explicit_required_no_event	  s	   >	> 	 F|	 	 }}++- 	D  U C	Dmm((+D1$7?S1%A(*+44 7FHe<=	?Wq)	D 	Ds   C>>Dc                 t    | j                         }| j                  t        |j                                      y r   )r   r   r   registeredHandlersr;   s     r   test_registeredHandlers_emptyz-ComponentsTests.test_registeredHandlers_empty7	  s)    }}d55789r   c                    ddl m} ddlm}  G d d|      } |d      }d }d }| j	                         }|j                  ||f       |j                  ||f       d }t        |j                         |	      }	| j                  t        |	      d
       | j                  t        |	d   |             | j                  |	d   j                  |f       | j                  |	d   j                  d       | j                  |	d   j                  |       | j                  |	d   j                  d       | j                  t        |	d   |             | j                  |	d   j                  |f       | j                  |	d   j                  d       | j                  |	d   j                  |       | j                  |	d   j                  d       y )Nr   rB   r5  c                       e Zd Zy)?ComponentsTests.test_registeredHandlers_non_empty.<locals>.IFooNrH   r&   r   r   rK   rG  ?	  rL   r   rK   c                     t               r   r[   rf  s    r   	_factory1zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory1D	  r^   r   c                     t               r   r[   rf  s    r   	_factory2zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory2G	  r^   r   c                 B    | j                   j                  j                  S r   )ra   __code__co_namer)  s    r   _factory_namezHComponentsTests.test_registeredHandlers_non_empty.<locals>._factory_nameN	  s    99%%---r   r#  r   ro   rp   )rT   rC   rr   r6  r   r2  r%  rC  r(   ru   r+   r,   ri  r   ra   rR   )
r   rC   r6  rK   rV   rI  rK  r3   rO  r  s
             r   !test_registeredHandlers_non_emptyz1ComponentsTests.test_registeredHandlers_non_empty;	  s   >?	> 	 F|	(	( }}Y0Y0	. T446MJ[)1-
;q>3FGHQ004':Q,,b1Q//;Q,,b1
;q>3FGHQ004':Q,,b1Q//;Q,,b1r   c                     ddl m}  G d d|      } |d      }d}| j                         }| j                  t        |j
                  |f|       y )Nr   rB   c                       e Zd Zy)DComponentsTests.test_unregisterHandler_w_nonblank_name.<locals>.IFooNrH   r&   r   r   rK   rS  a	  rL   r   rK   r  r1  )rT   rC   r   rc   rd   unregisterHandler)r   rC   rK   rV   r  r3   s         r   &test_unregisterHandler_w_nonblank_namez6ComponentsTests.test_unregisterHandler_w_nonblank_name^	  sP    >	> 	 F|	}})T%;%;$(7 	 	<r   c                 d    | j                         }| j                  t        |j                         y r   )r   rc   rd   rT  r;   s     r   3test_unregisterHandler_neither_factory_nor_requiredzCComponentsTests.test_unregisterHandler_neither_factory_nor_requiredj	  s#    }})T%;%;<r   c                     ddl m}  G d d|      } |d      }| j                         }|j                  |f      }| j	                  |       y )Nr   rB   c                       e Zd Zy)9ComponentsTests.test_unregisterHandler_miss.<locals>.IFooNrH   r&   r   r   rK   rZ  q	  rL   r   rK   ri  )rT   rC   r   rT  r   )r   rC   rK   rV   r3   r   s         r   test_unregisterHandler_missz+ComponentsTests.test_unregisterHandler_missn	  sJ    >	> 	 F|}}&&&8r   c                    ddl m} ddlm} ddlm}  G d d|      } |d      }| j                         }d }| j                         }|j                  ||f       | j                         \  }}	|5  |j                  ||f      }
d d d        | j                  
       | j                  t        |	      d       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |f       | j                  |j                  j"                  d	       | j                  |j                  j$                  |u        y # 1 sw Y   0xY w)
Nr   rB   r   r5  c                       e Zd Zy)XComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   r_  ~	  rL   r   rK   c                     t               r   r[   rf  s    r   r]   z\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>._factory	  r^   r   rp   ro   rT   rC   rq   r   rr   r6  r   r2  r"   rT  r+   r(   ru   r,   rb   r   ri  r   ra   r   rC   r   r6  rK   rV   r3   r]   r!   r   r   r   r   rx   s                 r   :test_unregisterHandler_hit_w_factory_and_explicit_providedzJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_providedy	  sk   >:?	> 	 F|}}	( }}Xw/++- 	>**8dW=E	>Wq)1:bR 
5,78
5<<1DEF--56..8**B/,,89	> 	>   1F33F=c                    ddl m} ddlm} ddlm}  G d d|      } |d      }| j                         }d }| j                         }|j                  ||f       | j                         \  }}	|5  |j                  |f      }
d d d        | j                  
       | j                  t        |	      d	       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |f       | j                  |j                  j"                  d
       | j                  |j                  j$                  d u        y # 1 sw Y   0xY w)Nr   rB   r   r5  c                       e Zd Zy)QComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>.IFooNrH   r&   r   r   rK   rg  	  rL   r   rK   c                     t               r   r[   rf  s    r   r]   zUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>._factory	  r^   r   r[  rp   ro   ra  rb  s                 r   3test_unregisterHandler_hit_w_only_explicit_providedzCComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided	  sl   >:?	> 	 F|}}	( }}Xw/++- 	=**TG*<E	=Wq)1:bR 
5,78
5<<1DEF--56..8**B/,,45	= 	=rd  c                    ddl m} ddlm} ddlm}  G d d|      } |d       G fdd      }| j                         }|j                  |       | j                         \  }}|5  |j                  |      }	d d d        | j                  	       | j                  t        |      d	       |d   \  }
}|
\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   f       | j                  |j                  j"                  d
       | j                  |j                  j$                  d
       | j                  |j                  j&                  |u        y # 1 sw Y   VxY w)Nr   rB   r   r5  c                       e Zd Zy)IComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>.IFooNrH   r&   r   r   rK   rl  	  rL   r   rK   c                       e Zd ZW  fZy)MComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>._FactoryNr  r@  s   r   rp  rn  	  r  r   rp  rp   ro   )rT   rC   rq   r   rr   r6  r   r2  r"   rT  r+   r(   ru   r,   rb   r   ri  r   rR   ra   )r   rC   r   r6  rK   rp  r3   r!   r   r   r   r   rx   rV   s                @r   +test_unregisterHandler_wo_explicit_requiredz;ComponentsTests.test_unregisterHandler_wo_explicit_required	  sx   >:?	> 	 F|	+ 	+ }}X&++- 	5**84E	5Wq)1:bR 
5,78
5<<1DEF--56..8**B/**B/,,89	5 	5s   )GGc                     ddl m} ddl m}  G d d|      } |d      }| j                         } ||       G d d             } |       }|j	                  |f       y )Nr   rB   ru  c                       e Zd Zy)/ComponentsTests.test_handle_empty.<locals>.IFooNrH   r&   r   r   rK   rr  	  rL   r   rK   c                       e Zd Zy).ComponentsTests.test_handle_empty.<locals>.BarNrH   r&   r   r   r  rt  	  rQ   r   r  )rT   rC   rv  r   handle)r   rC   rv  rK   rV   r3   r  r  s           r   test_handle_emptyz!ComponentsTests.test_handle_empty	  s]    >;	> 	 F|}}	T		 	 
	 eSFr   c                 t  
 ddl m} ddl m}  G d d|      } |d      }g 

fd}g fd}| j                         }|j	                  ||f       |j	                  ||f        ||       G d d	             } |       }	|j                  |	       | j                  
|	g       | j                  |	g       y )
Nr   rB   ru  c                       e Zd Zy)3ComponentsTests.test_handle_non_empty.<locals>.IFooNrH   r&   r   r   rK   ry  	  rL   r   rK   c                 (    j                  |        y r   r   )rg  	_called_1s    r   
_factory_1z9ComponentsTests.test_handle_non_empty.<locals>._factory_1	      W%r   c                 (    j                  |        y r   r   )rg  	_called_2s    r   
_factory_2z9ComponentsTests.test_handle_non_empty.<locals>._factory_2	  r}  r   c                       e Zd Zy)2ComponentsTests.test_handle_non_empty.<locals>.BarNrH   r&   r   r   r  r  	  rQ   r   r  )rT   rC   rv  r   r2  ru  r(   )r   rC   rv  rK   rV   r|  r  r3   r  r  r{  r  s             @@r   test_handle_non_emptyz%ComponentsTests.test_handle_non_empty	  s    >;	> 	 F|		& 		& }}Z$1Z$1	T		 	 
	 eCSE*SE*r   c                     G d dt               }| j                         }t               }|r|n	t               }|j                  ||       |j                  ||d       | j	                  t        |j                  j                        d       | j	                  |j                  j                  |d|r|fn||fiig       | j	                  |j                  j                  ||rdnd	i       |j                  ||      }| j                  |       |j                  ||d      }| j                  |       | j	                  |j                  j                  i        | j	                  t        |j                  j                        d
       y )Nc                       e Zd Zy)QComponentsTests.test_register_unregister_identical_objects_provided.<locals>.IFooNrH   r&   r   r   rK   r  

  rL   r   rK   r  r  r   rp   ro   r      r   )r   r   rb   rU   r(   ru   r.   rt   	_providedr   r+   )r   	identicalrK   r3   firstsecondress          r   3test_register_unregister_identical_objects_providedzCComponentsTests.test_register_unregister_identical_objects_provided
  sU   	9 	 }}#UT2Vd?T^^8891=442IyE6?C8
 7 	 	11y!a4
 	 $$UT$:$$Vd$G1126T^^8891=r   c                 (    | j                  d       y )NF)r  )r  r   s    r   2test_register_unregister_nonequal_objects_providedzBComponentsTests.test_register_unregister_nonequal_objects_provided$
  s    @@ 	A 	
r   c                     G d dt               } G d d      }| j                         }t        d      D ]  }|j                   |       ||         |j                  j
                  }|j                  j                  }| j                  t        |      d       | j                  t        |d         d       | j                  t        |d   |         d       |j                  j                  }| j                  t        |      d       | j                  t        |d         d       | j                  t        |d   |         d       | j                  t        |d   |   d	         d        t        |             x}|j                  _        |j                  i        i x}	|d   |<   t        d
      D ]$  }
t        t        |
            }
|d   |   |
   |	|
<   & | j                  ||        t        |             x}|j                  _	        |j                  i        i x}	|d   |<   d|	d	<   t        dd      D ]/  }
t        t        |
            }
|d   |   |
   }|	d	xx   |fz  cc<   1 |j                         }| j                  |j                  j
                  |       | j                  |d
dddd       |j                  d      }| j                  |j                  j
                  |dz          | j                  ||       | j                  ||       | j                  t        |d   |   d	         t        |d   |   d	                |d   |   d	   D ]  }| j                  ||d   |   d	           |j                         }| j                  |ddddd       |j                  d      }| j                  ||       | j                  |j                  j
                  |dz          y )Nc                       e Zd ZdZy)GComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.IFooDoes nothingNr)   rI   rJ   __doc__r&   r   r   rK   r  +
      r   rK   c                       e Zd ZdZy)YComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.UtilityImplementingFoor  Nr  r&   r   r   UtilityImplementingFoor  .
  r  r   r     r  rp   r   ro   
   r&                  )did_not_registerneeded_registereddid_not_subscribeneeded_subscribedT)rebuild)r   r   rangerU   r.   _generationrs   r(   ru   rt   typer   strassertNotEqual$rebuildUtilityRegistryFromLocalCacheassertIn)r   rK   r  compsiorig_generationorig_adaptersorig_subscribersnew_adaptersdr   new_subsr3   rebuild_preflightrebuild_resultsorig_subscriberpreflight_afterrebuild_afters                     r   )test_rebuildUtilityRegistryFromLocalCachez9ComponentsTests.test_rebuildUtilityRegistryFromLocalCache)
  s   	9 		 	 r 	A!!&($s " 	
  //5511]+Q/]1-.2]1-d34b9 ??77-.2-a0115-a067;-a06r:;R@ 4G43F3HHu0B$&&LOD!"I 	3Ds4y>D#A&t,T2AdG	3 	M<82H$7G2H2JJ5??/ ""HQK"!RL 	Ds4y>D #D)$/DbEdWE	 "FFH44oF* "!#!"!#-
 	  DD E 

 	44o6IJ*O<}5D!"%& #D)"-.	0  0248< 	BOMM/8A;t+<R+@A	B  DDF "!"!#!"+
 	 BB C 
 	844o6IJr   )test)T)vr)   rI   rJ   r   r   r"   r4   r7   r<   r@   rX   rg   ry   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-  r4  r9  r@  rD  rI  rN  rS  rW  r_  rj  rs  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r)  rA  rQ  rY  rj  rs  r~  r%  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r,  r3  r:  rA  rD  rP  rU  rW  r\  rc  ri  ro  rv  r  r  r  r  r   r   s   @r   r	   r	      s   9 :F=	= ,?6B:B
M 6D*"%,12(6TO$* C2C@G
?" 6@ :D"6H#6JO&O&O.>8(*(.?0@9	O
<	G
:?A L$ ,":H2"%:NA$G$':R.:`($:L*(7
	F $!:F!:F:B>"4H	CM52;(12*0X00d0B6B@N4B@5-1^F2AB(<TA$%:N&:P&:P*(J!4FH7
	F"&!6F!:F!:F:BC$$>L9 ":H*2:!2F
<=	 :>6>:>"+@ ><

[Kr   r	   c                        e Zd Z fdZ xZS )UnhashableComponentsTestsc                 H     G d dt         t        |          t              }|S )Nc                       e Zd Zy)=UnhashableComponentsTests._getTargetClass.<locals>.ComponentsNrH   r&   r   r   r   r  
  s     r   r   )r   r  r   r   )r   r   r   s     r   r   z)UnhashableComponentsTests._getTargetClass
  s%    	+TBDd	
 r   )r)   rI   rJ   r   r   r   s   @r   r  r  
  s    	 	r   r  c                       e Zd Z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y)UtilityRegistrationTestsc                     ddl m} |S )Nr   rk   )rr   rl   )r   rl   s     r   r   z(UtilityRegistrationTests._getTargetClass
      ?""r   Nc                     ddl m}  G d d|      } |d      } G d d      } |       }d}d	}	| j                         }
 |
|||||	|      ||fS )
Nr   rB   c                       e Zd Zy)AUtilityRegistrationTests._makeOne.<locals>.InterfaceClassSubclassNrH   r&   r   r   InterfaceClassSubclassr  
  rL   r   r  rK   c                       e Zd Zd Zy)4UtilityRegistrationTests._makeOne.<locals>._Registryc                      yN	_REGISTRYr&   r   s    r   __repr__z=UtilityRegistrationTests._makeOne.<locals>._Registry.__repr__
      "r   Nr)   rI   rJ   r  r&   r   r   	_Registryr  
      #r   r  r   	DOCSTRINGrT   rC   r   )r   r`   ra   rC   r  rV   r  r   r   docklasss              r   r   z!UtilityRegistrationTests._makeOne
  sj    >	^ 	 &f-	# 	# ;$$&(D$	3@
 	
r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   IUtilityRegistrationverifyClass)rq   r  zope.interface.verifyr  r   )r   r  r  s      r   +test_class_conforms_to_IUtilityRegistrationzDUtilityRegistrationTests.test_class_conforms_to_IUtilityRegistration
      B5($*>*>*@Ar   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   r  verifyObject)rq   r  r  r  r   )r   r  r  ur_s        r   .test_instance_conforms_to_IUtilityRegistrationzGUtilityRegistrationTests.test_instance_conforms_to_IUtilityRegistration
  $    B6==?Aq)2.r   c                      G d d      } |       }| j                  |      \  }}}| j                  t        |      d|z         y )Nc                       e Zd ZdZ y):UtilityRegistrationTests.test___repr__.<locals>._ComponentTESTNrH   r&   r   r   
_Componentr  
      Hr   r  zAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')r9   r   r  
_componentr  	_registryrw   s         r   r<   z&UtilityRegistrationTests.test___repr__
  sM    	 	  \
#}}Z8IuH@	
r   c                      G d d      } |       }| j                  |      \  }}}t               |_        | j                  t	        |      d|z         y )Nc                       e Zd Zd Zy)KUtilityRegistrationTests.test___repr___provided_wo_name.<locals>._Componentc                      yNr  r&   r   s    r   r  zTUtilityRegistrationTests.test___repr___provided_wo_name.<locals>._Component.__repr__
      r   Nr  r&   r   r   r  r  
      r   r  AUtilityRegistration(_REGISTRY, None, %r, TEST, None, 'DOCSTRING')r   rb   rv   r(   r:   r  s         r   test___repr___provided_wo_namez7UtilityRegistrationTests.test___repr___provided_wo_name
  V    	 	  \
#}}Z8IuhH@	
r   c                      G d d      } |       }| j                  |      \  }}}t               |_        | j                  t	        |      d|z         y )Nc                       e Zd Zd Zy)LUtilityRegistrationTests.test___repr___component_wo_name.<locals>._Componentc                      yr  r&   r   s    r   r  zUUtilityRegistrationTests.test___repr___component_wo_name.<locals>._Component.__repr__
  r  r   Nr  r&   r   r   r  r  
  r  r   r  r  r  r  s         r   test___repr___component_wo_namez8UtilityRegistrationTests.test___repr___component_wo_name
  r  r   c                     t               }| j                  |      \  }}}| j                  |j                         t	        |             y r   rb   r   r(   __hash__idr   r  r  r  rw   s        r   test___hash__z&UtilityRegistrationTests.test___hash__
  8    X
#}}Z8Iu2/r   c                 j    t               }| j                  |      \  }}}| j                  ||k(         y r   rb   r   r+   r  s        r   test___eq___identityz-UtilityRegistrationTests.test___eq___identity
  .    X
#}}Z8Iub!r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   r  r   r  r  r  rw   ur2r  s          r   test___eq___hitz(UtilityRegistrationTests.test___eq___hit
  B    X
#}}Z8IuMM*-	Qc	"r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   rb   r   r   r   r  _component2r  r  rw   r  r  s           r   test___eq___missz)UtilityRegistrationTests.test___eq___miss
  K    X
h#}}Z8IuMM+.	Qs#r   c                 j    t               }| j                  |      \  }}}| j                  ||k7         y r   r  r  s        r   test___ne___identityz-UtilityRegistrationTests.test___ne___identity  0    X
#}}Z8Iur"r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  r  s          r   test___ne___hitz(UtilityRegistrationTests.test___ne___hit	  D    X
#}}Z8IuMM*-	Qs#r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  r  s           r   test___ne___missz)UtilityRegistrationTests.test___ne___miss  I    X
h#}}Z8IuMM+.	Qc	"r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  r  s        r   test___lt___identityz-UtilityRegistrationTests.test___lt___identity  0    X
#}}Z8Iub!r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  r  s          r   test___lt___hitz(UtilityRegistrationTests.test___lt___hit  D    X
#}}Z8IuMM*-	Qc"r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y N2rb   r   r   r+   r  s           r   test___lt___missz)UtilityRegistrationTests.test___lt___miss!  T    X
h#}}Z8IuMM+.	Q3;S!r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  r  s        r   test___le___identityz-UtilityRegistrationTests.test___le___identity)  r	  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  r  s          r   test___le___hitz(UtilityRegistrationTests.test___le___hit.  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y r%  r'  r  s           r   test___le___missz)UtilityRegistrationTests.test___le___miss4  T    X
h#}}Z8IuMM+.	Q3;c	"r   c                 j    t               }| j                  |      \  }}}| j                  ||kD         y r   r  r  s        r   test___gt___identityz-UtilityRegistrationTests.test___gt___identity<  r   r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||kD         y r%  r'  r  s           r   test___gt___hitz(UtilityRegistrationTests.test___gt___hitA  T    X
h#}}Z8IuMM+.	Q3;b!r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||kD         y r   r  r  s          r   test___gt___missz)UtilityRegistrationTests.test___gt___missI  D    X
#}}Z8IuMM*-	Qr"r   c                 j    t               }| j                  |      \  }}}| j                  ||k\         y r   r  r  s        r   test___ge___identityz-UtilityRegistrationTests.test___ge___identityO  r	  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r%  rb   r   r   r   r  s           r   test___ge___missz)UtilityRegistrationTests.test___ge___missT  V    X
h#}}Z8IuMM+.	Q3;s#r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r%  r'  r  s          r   test___ge___hitz(UtilityRegistrationTests.test___ge___hit\  M    X
#}}Z8IuMM*-	Q3;r	"r   )NN)r)   rI   rJ   r   r   r  r  r<   r  r  r  r  r  r  r  r  r  r  r"  r(  r+  r-  r/  r2  r4  r7  r:  r=  r@  r&   r   r   r  r  
  s    #
,B
/

 
 0
"
#$#
$#"
#""
##"
"#"
$#r   r  c                       e Zd Z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y)AdapterRegistrationTestsc                     ddl m} |S )Nr   ra  )rr   rb  )r   rb  s     r   r   z(AdapterRegistrationTests._getTargetClassf  r  r   Nc                     ddl m}  G d d|      } |d      } |d      } G d d      } |       }d}d	}	| j                         }
 |
||f||||	      ||fS )
Nr   rB   c                       e Zd Zy)/AdapterRegistrationTests._makeOne.<locals>.IFooNrH   r&   r   r   rK   rG  m  rL   r   rK   r   c                       e Zd Zd Zy)4AdapterRegistrationTests._makeOne.<locals>._Registryc                      yr  r&   r   s    r   r  z=AdapterRegistrationTests._makeOne.<locals>._Registry.__repr__t  r  r   Nr  r&   r   r   r  rI  s  r  r   r  r   r  r  r   r`   rC   rK   rV   r^  r  r   r   r  r  s              r   r   z!AdapterRegistrationTests._makeOnej  t    >	> 	 F|F|	# 	# ;$$&(TGT4C@
 	
r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   IAdapterRegistrationr  )rq   rO  r  r  r   )r   rO  r  s      r   +test_class_conforms_to_IAdapterRegistrationzDAdapterRegistrationTests.test_class_conforms_to_IAdapterRegistration  r  r   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   rN  r  )rq   rO  r  r  r   )r   rO  r  arr  s        r   .test_instance_conforms_to_IAdapterRegistrationzGAdapterRegistrationTests.test_instance_conforms_to_IAdapterRegistration  r  r   c                      G d d      } |       }| j                  |      \  }}}| j                  t        |      d|z         y )Nc                       e Zd ZdZ y):AdapterRegistrationTests.test___repr__.<locals>._Componentr  NrH   r&   r   r   r  rV    r  r   r  zCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')r9   r   r  r  rR  r  rw   s         r   r<   z&AdapterRegistrationTests.test___repr__  sL    	 	  \
#}}Z8IuH	
r   c                      G d d      } |       }| j                  |      \  }}}t               |_        | j                  t	        |      d|z         y )Nc                       e Zd Zd Zy)KAdapterRegistrationTests.test___repr___provided_wo_name.<locals>._Componentc                      yr  r&   r   s    r   r  zTAdapterRegistrationTests.test___repr___provided_wo_name.<locals>._Component.__repr__  r  r   Nr  r&   r   r   r  rZ    r  r   r  CAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')r  rW  s         r   r  z7AdapterRegistrationTests.test___repr___provided_wo_name  U    	 	  \
#}}Z8IuhH	
r   c                      G d d      } |       }| j                  |      \  }}}t               |_        | j                  t	        |      d|z         y )Nc                       e Zd Zd Zy)LAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Componentc                      yr  r&   r   s    r   r  zUAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Component.__repr__  r  r   Nr  r&   r   r   r  r`    r  r   r  r\  r  rW  s         r   r  z8AdapterRegistrationTests.test___repr___component_wo_name  r]  r   c                     t               }| j                  |      \  }}}| j                  |j                         t	        |             y r   r   r   r  rR  r  rw   s        r   r  z&AdapterRegistrationTests.test___hash__  r  r   c                 j    t               }| j                  |      \  }}}| j                  ||k(         y r   r  rc  s        r   r  z-AdapterRegistrationTests.test___eq___identity  r	  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   r  r   r  rR  r  rw   ar2r  s          r   r  z(AdapterRegistrationTests.test___eq___hit  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   r  r   r  r  rR  r  rw   rg  r  s           r   r  z)AdapterRegistrationTests.test___eq___miss  r  r   c                 j    t               }| j                  |      \  }}}| j                  ||k7         y r   r  rc  s        r   r  z-AdapterRegistrationTests.test___ne___identity  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  rf  s          r   r  z)AdapterRegistrationTests.test___ne___miss  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  ri  s           r   test___ne___hit_componentz2AdapterRegistrationTests.test___ne___hit_component  r  r   c                     ddl m}  G d d|      } |d      }t               }| j                  |      \  }}}| j                  |      \  }}	}	||_        | j                  ||k7         y )Nr   rB   c                       e Zd Zy)?AdapterRegistrationTests.test___ne___hit_provided.<locals>.IFooNrH   r&   r   r   rK   rp    rL   r   rK   rE  )rT   rC   rb   r   rv   r+   )
r   rC   rK   rN  r  rR  r  rw   rg  r  s
             r   test___ne___hit_providedz1AdapterRegistrationTests.test___ne___hit_provided  sc    >	> 	 F|X
#}}Z8IuMM*-	Qc	"r   c                     ddl m}  G d d|      } |d      }t               }t               }| j                  |      \  }}}| j                  |      \  }	}
}
|f|	_        | j                  ||	k7         y )Nr   rB   c                       e Zd Zy)?AdapterRegistrationTests.test___ne___hit_required.<locals>.IFooNrH   r&   r   r   rK   rt    rL   r   rK   rE  )rT   rC   rb   r   ri  r+   )r   rC   rK   rN  r  r  rR  r  rw   rg  r  s              r   test___ne___hit_requiredz1AdapterRegistrationTests.test___ne___hit_required  sl    >	> 	 F|X
h#}}Z8IuMM+.	Qwc	"r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  rc  s        r   r  z-AdapterRegistrationTests.test___lt___identity  r   r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  rf  s          r   r"  z(AdapterRegistrationTests.test___lt___hit  r#  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y r%  r'  ri  s           r   r(  z)AdapterRegistrationTests.test___lt___miss	  r)  r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  rc  s        r   r+  z-AdapterRegistrationTests.test___le___identity  r	  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  rf  s          r   r-  z(AdapterRegistrationTests.test___le___hit  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y r%  r'  ri  s           r   r/  z)AdapterRegistrationTests.test___le___miss  r0  r   c                 j    t               }| j                  |      \  }}}| j                  ||kD         y r   r  rc  s        r   r2  z-AdapterRegistrationTests.test___gt___identity$  r   r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||kD         y r%  r'  ri  s           r   r4  z(AdapterRegistrationTests.test___gt___hit)  r5  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||kD         y r   r  rf  s          r   r7  z)AdapterRegistrationTests.test___gt___miss1  r8  r   c                 j    t               }| j                  |      \  }}}| j                  ||k\         y r   r  rc  s        r   r:  z-AdapterRegistrationTests.test___ge___identity7  r	  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r%  r<  ri  s           r   r=  z)AdapterRegistrationTests.test___ge___miss<  r>  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r%  r'  rf  s          r   r@  z(AdapterRegistrationTests.test___ge___hitD  rA  r   r   )r)   rI   rJ   r   r   rP  rS  r<   r  r  r  r  r  r  r  r  rm  rq  ru  r  r"  r(  r+  r-  r/  r2  r4  r7  r:  r=  r@  r&   r   r   rC  rC  d  s    #
.B
/

 
 0
"
#$#
$###"
#""
##"
"#"
$#r   rC  c                   &    e Zd Zd ZddZd Zd Zy)SubscriptionRegistrationTestsc                     ddl m} |S )Nr   r  )rr   r  )r   r  s     r   r   z-SubscriptionRegistrationTests._getTargetClassN  s    D''r   Nc                     ddl m}  G d d|      } |d      } |d      } G d d      } |       }d}d	}	| j                         }
 |
||f||||	      ||fS )
Nr   rB   c                       e Zd Zy)4SubscriptionRegistrationTests._makeOne.<locals>.IFooNrH   r&   r   r   rK   r  U  rL   r   rK   r   c                       e Zd Zd Zy)9SubscriptionRegistrationTests._makeOne.<locals>._Registryc                      yr  r&   r   s    r   r  zBSubscriptionRegistrationTests._makeOne.<locals>._Registry.__repr__\  r  r   Nr  r&   r   r   r  r  [  r  r   r  r   r  r  rK  s              r   r   z&SubscriptionRegistrationTests._makeOneR  rL  r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr    ISubscriptionAdapterRegistrationr  )rq   r  r  r  r   )r   r  r  s      r   7test_class_conforms_to_ISubscriptionAdapterRegistrationzUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistrationi  s    N54d6J6J6LMr   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   r  r  )rq   r  r  r  r   )r   r  r  sarr  s        r   :test_instance_conforms_to_ISubscriptionAdapterRegistrationzXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistrationn  s$    N6MMO	Q5s;r   r   )r)   rI   rJ   r   r   r  r  r&   r   r   r  r  L  s    (
.N
<r   r  c                   8    e Zd Zd Zd	dZd Zd Zd Zd Zd Z	y)
HandlerRegistrationTestsc                     ddl m} |S )Nr   r5  )rr   r6  )r   r6  s     r   r   z(HandlerRegistrationTests._getTargetClassw  r  r   Nc                     ddl m}  G d d|      } |d      } G d d      } |       }d}d}| j                         }	 |	||f|||      ||fS )	Nr   rB   c                       e Zd Zy)/HandlerRegistrationTests._makeOne.<locals>.IFooNrH   r&   r   r   rK   r  ~  rL   r   rK   c                       e Zd Zd Zy)4HandlerRegistrationTests._makeOne.<locals>._Registryc                      yr  r&   r   s    r   r  z=HandlerRegistrationTests._makeOne.<locals>._Registry.__repr__  r  r   Nr  r&   r   r   r  r    r  r   r  r   r  r  )
r   r`   rC   rK   rV   r  r   r   r  r  s
             r   r   z!HandlerRegistrationTests._makeOne{  si    >	> 	 F|	# 	# ;$$&(TGT9c:
 	
r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   IHandlerRegistrationr  )rq   r  r  r  r   )r   r  r  s      r   +test_class_conforms_to_IHandlerRegistrationzDHandlerRegistrationTests.test_class_conforms_to_IHandlerRegistration  r  r   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   r  r  )rq   r  r  r  r   )r   r  r  hrr  s        r   .test_instance_conforms_to_IHandlerRegistrationzGHandlerRegistrationTests.test_instance_conforms_to_IHandlerRegistration  r  r   c                     d }| j                  |      \  }}}| j                  |j                  |u        | j                  |j                  |j                  u        | j                  |j                  d u        y )Nc                     t               r   r[   rf  s    r   r]   z:HandlerRegistrationTests.test_properties.<locals>._factory  r^   r   )r   r+   handlerra   rv   )r   r]   r  r  s       r   test_propertiesz(HandlerRegistrationTests.test_properties  s^    	(==*Aq

h./

bjj01t+,r   c                      G d d      }| j                   |             \  }}}| j                  t        |      d|z         y )Nc                       e Zd ZdZ y)GHandlerRegistrationTests.test___repr___factory_w_name.<locals>._Factoryr  NrH   r&   r   r   rp  r    r  r   rp  =HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')r9   r   rp  r  r  rw   s        r   test___repr___factory_w_namez5HandlerRegistrationTests.test___repr___factory_w_name  sG    	 	  $}}XZ8IuH	r   c                      G d d      }| j                   |             \  }}}| j                  t        |      d|z         y )Nc                       e Zd Zd Zy)HHandlerRegistrationTests.test___repr___factory_wo_name.<locals>._Factoryc                      yr  r&   r   s    r   r  zQHandlerRegistrationTests.test___repr___factory_wo_name.<locals>._Factory.__repr__  r  r   Nr  r&   r   r   rp  r    r  r   rp  r  r9   r  s        r   test___repr___factory_wo_namez6HandlerRegistrationTests.test___repr___factory_wo_name  sG    	 	  $}}XZ8IuH	
r   r   )
r)   rI   rJ   r   r   r  r  r  r  r  r&   r   r   r  r  u  s&    #
,B
/-

r   r  c                       e Zd Zd Zd Zy)PersistentAdapterRegistryc                     | j                   j                         }t        |      D ]3  }|| j                  v s|j	                  d      s#|j                  |       5 |j                  dd        |S )N_vro)__dict__copyr   
_delegated
startswithpop)r   stateks      r   __getstate__z&PersistentAdapterRegistry.__getstate__  s^    ""$e 	ADOO#q||D'9		!	 			$r   c                     |j                  dd      }| j                  j                  |       | j                          || _        | j
                  j                  |        y )Nr*   r&   )r  r  update_createLookupr*   r  r  )r   r  basess      r   __setstate__z&PersistentAdapterRegistry.__setstate__  sI    		+r*U#t$r   N)r)   rI   rJ   r  r  r&   r   r   r  r    s    %r   r  c                       e Zd Zd Zy)PersistentComponentsc                 @    t               | _        t               | _        y r   )r  r-   r.   r   s    r   _init_registriesz%PersistentComponents._init_registries  s    1324r   N)r)   rI   rJ   r  r&   r   r   r  r    s    5r   r  c                       e Zd Zy)PersistentDictComponentsNrH   r&   r   r   r  r    s    r   r  c                       e Zd Zd Zy)PersistentComponentsDictc                 Z    t         j                  |        t        j                  | |       y r   )r   r  r  )r   r   s     r   r  z!PersistentComponentsDict.__init__  s    d%%dD1r   Nr  r&   r   r   r  r    s    2r   r  c                   $    e Zd Zd Zd Zd Zd Zy)TestPersistentComponentsc                     t        d      S )Nr  )r  r   s    r   r   z!TestPersistentComponents._makeOne  s    #F++r   c                      y r   r&   r   mades     r   _check_equality_after_picklez5TestPersistentComponents._check_equality_after_pickle  s    r   c                     dd l }| j                         }|j                  |       |j                  |j                  |            }| j	                  |j
                  d       y Nr   r  )pickler   dumpsloadsr(   r)   )r   r  r3   comp2s       r   test_pickles_emptyz+TestPersistentComponents.test_pickles_empty  sG    }}TV\\$/00r   c                    dd l }| j                         }t               }|j                  |t               | j                  ||j                  t                     |j                  |j                  |            }| j                  |j                  d       | j                  |j                  t                     |j                  |t               | j                  ||j                  t                     | j                  |       y r  )r  r   rb   rU   r   r  r?  r  r  r(   r)   assertIsNotNoner  )r   r  r3   utilityr  s        r   &test_pickles_with_utility_registrationz?TestPersistentComponents.test_pickles_with_utility_registration  s    }}(	 	gooi0	2 V\\$/00 	U--i89 		 	g&&y1	3 	))%0r   N)r)   rI   rJ   r   r  r  r  r&   r   r   r  r    s    ,11r   r  c                       e Zd Zd Zd Zd Zy)TestPersistentDictComponentsc                     t         S r   )r  r   s    r   r   z,TestPersistentDictComponents._getTargetClass      ''r   c                 >     | j                         d      }d|d<   |S )Nr  r  *   r$  r   r;   s     r   r   z%TestPersistentDictComponents._makeOne  s%    %t##%62Ur   c                 R    | j                  d|       | j                  |d   d       y )Nr$  r  )r  r(   r  s     r   r  z9TestPersistentDictComponents._check_equality_after_pickle  s$    eT"eb)r   N)r)   rI   rJ   r   r   r  r&   r   r   r  r    s    (
*r   r  c                       e Zd Zd Zy)TestPersistentComponentsDictc                     t         S r   )r  r   s    r   r   z,TestPersistentComponentsDict._getTargetClass"  r  r   N)r)   rI   rJ   r   r&   r   r   r  r     s    (r   r  c                       e Zd Zd Zd Zd Zy)r    c                     || _         |D ci c]  }|t        ||       c}| _        |j                         D ]  \  }}t	        |||        y c c}w r   )modulegetattr
to_restoreitemssetattr)r   r  r   r$  values        r   r  z_Monkey.__init__(  sR    @BC3 44C((* 	(JCFC'	( Ds   Ac                     | S r   r&   r   s    r   	__enter__z_Monkey.__enter__.  s    r   c                 v    | j                   j                         D ]  \  }}t        | j                  ||        y r   )r  r  r  r  )r   exc_typeexc_valexc_tbr$  r  s         r   __exit__z_Monkey.__exit__1  s2    ////1 	-JCDKKe,	-r   N)r)   rI   rJ   r  r  r  r&   r   r   r    r    &  s    (-r   r    )r  unittestr   r   r'   r   rr   r   TestCaser	   r  r  rC  r  r  r  r  r   r  r  r  r  r  r    r&   r   r   <module>r     s      $ ; .m)Kh'' m)K`S "I#x00 I#Xe#x00 e#P&<H$5$5 &<RG
x00 G
T% 8 %$5: 5	3T 	
2t%9 2(1x00 (1V*#; *(#? (- -r   