
    Vh׷                       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    R/home/dcms/DCMS/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                  |j                  |       | j                  |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__assertIsInstance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,dmm_=dnno>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   r5   r2   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   r2   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>   r2   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   IFoorF   T       r   rJ   fooc                       e Zd Zy)EComponentsTests.test_registerUtility_with_component_name.<locals>.FooNrG   r&   r   r   FoorN   Y       r   rO   inforQ   )zope.interface.declarationsrB   rD   r   registerUtilityr(   r.   )	r   rB   rD   rJ   ifoorO   rL   _infor2   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	TypeErrorrT   r   r\   _to_regr2   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   |   |   |       | j                  |	j                  ||f   ||d f       | j                  |	j                  j                  d   |   d	   |f       | j                  t!        |      d
       |d   \  }}|\  }| j                  |i        | j#                  ||       | j#                  |j                  |       | j                  |j                  j$                  |	       | j                  |j                  j&                  |       | j                  |j                  j(                  |       | j                  |j                  j*                  |       | j                  |j                  j,                  |       | j/                  |j                  j0                         y # 1 sw Y   xY w)Nr   rA   
RegisteredUtilityRegistrationc                       e Zd Zy)>ComponentsTests.test_registerUtility_w_component.<locals>.IFooNrG   r&   r   r   rJ   rm   s   rK   r   rJ   rQ   r       )rS   rB   zope.interface.interfacesri   zope.interface.registryrk   ra   r   r"   rT   assertIsr-   	_adaptersr(   r.   _subscriberslenr+   r   providedr   r_   rQ   assertIsNoner`   )r   rB   ri   rk   rJ   rU   rV   _namere   r2   r!   r   r   r   events                  r    test_registerUtility_w_componentz0ComponentsTests.test_registerUtility_w_componentn   s   >8?	> 	 F|(}}++- 	>  $u=	>dnn..q1$7>H44T5[A!5$/	144Q7=bAG:NWq)1:bR eZ0ell,?@ell++T2ell++T2ell''/ell,,g6ell''/%,,../#	> 	>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                  ||       | j                  |j                  |       | j                  |j                  j                  |	       | j                  |j                  j                  |       | j                  |j                  j                   |       | j                  |j                  j"                         | j                  |j                  j$                  |       | j                  |j                  j&                  |       y # 1 sw Y   VxY w)Nr   rA   rh   rj   c                       e Zd Zy)<ComponentsTests.test_registerUtility_w_factory.<locals>.IFooNrG   r&   r   r   rJ   r}      rK   r   rJ   rQ   r   c                       S r   r&   re   s   r   r\   z@ComponentsTests.test_registerUtility_w_factory.<locals>._factory       Nr   r`   ro   )rS   rB   rp   ri   rq   rk   ra   r   r"   rT   r(   ru   r+   rr   r   rv   r   r_   rQ   r`   )r   rB   ri   rk   rJ   rU   rV   rx   r\   r2   r!   r   r   r   ry   re   s                  @r   test_registerUtility_w_factoryz.ComponentsTests.test_registerUtility_w_factory   s{   >8?	> 	 F|(	 }}++- 	M  tUE8 L	MWq)1:bR eZ0ell,?@ell++T2ell++T2ell''/ell,,g6ell''/ell**H5	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>.FooNrG   r&   r   r   rO   r      rK   r   rO   rQ   r   )r   rb   rc   rT   )r   rO   rV   rx   re   r2   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                  ||       | j                  |j                  |       | j                  |j                  j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |	       | j                  |j                  j$                  |
       | j                  |j                  j&                  |       | j)                  |j                  j*                         y # 1 sw Y   UxY w)Nr   rA   directlyProvidesrh   rj   c                       e Zd Zy)>ComponentsTests.test_registerUtility_wo_provided.<locals>.IFooNrG   r&   r   r   rJ   r      rK   r   rJ   c                       e Zd Zy)=ComponentsTests.test_registerUtility_wo_provided.<locals>.FooNrG   r&   r   r   rO   r      rK   r   rO   rQ   r   ro   )rS   rB   r   rp   ri   rq   rk   r   r"   rT   r(   ru   r+   ra   rr   r   rv   r   r_   rQ   rw   r`   )r   rB   r   ri   rk   rJ   rO   rU   rV   rx   re   r2   r!   r   r   r   ry   s                    r    test_registerUtility_wo_providedz0ComponentsTests.test_registerUtility_wo_provided   s   >@8?	> 		 	 F|%$'}}++- 	>  $u=	>Wq)1:bR eZ0ell,?@ell++T2ell++T2ell''/ell,,g6ell''/%,,../	> 	>s   /G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   rA   c                       e Zd Zy)JComponentsTests.test_registerUtility_duplicates_existing_reg.<locals>.IFooNrG   r&   r   r   rJ   r      rK   r   rJ   rQ   r   )rS   rB   ra   r   rT   r"   r(   ru   
r   rB   rJ   rU   rV   rx   re   r2   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   rA   c                       e Zd Zy)CComponentsTests.test_registerUtility_w_different_info.<locals>.IFooNrG   r&   r   r   rJ   r      rK   r   rJ   info1info2r      rn   rS   rB   ra   r   rT   r"   r(   ru   r.   r-   rt   )r   rB   rJ   rU   _info1_info2rx   re   r2   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   rA   c                       e Zd Zy)SComponentsTests.test_registerUtility_w_different_names_same_component.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   rQ   name1name2ro   rn   r   r   rB   rJ   rU   rV   _name1_name2
_other_regre   r2   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                 B   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                  ||       | j                  |j                  |       | j                  |j                  j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |       | j                  |j                  j$                  |	       | j                  |j                  j&                  |       | j)                  |j                  j*                         |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                  |       | j                  |j                  j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |       | j                  |j                  j$                  |
       | j                  |j                  j&                  |       | j)                  |j                  j*                         y # 1 sw Y   xY w)Nr   rA   rh   Unregisteredrj   c                       e Zd Zy)HComponentsTests.test_registerUtility_replaces_existing_reg.<locals>.IFooNrG   r&   r   r   rJ   r   $  rK   r   rJ   rQ   r   r   ro   )rS   rB   rp   ri   r   rq   rk   ra   r   rT   r"   r(   ru   r+   rr   r   rv   r   r_   rQ   rw   r`   )r   rB   ri   r   rk   rJ   rU   rV   rx   _before_afterr2   r!   r   r   r   ry   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 e\2ell,?@ell++T2ell++T2ell''/ell,,g6ell''/%,,../1:bR eZ0ell,?@ell++T2ell++T2ell''/ell,,f5ell''/%,,../1	= 	=s   =LL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   rA   c                       e Zd Zy)DComponentsTests.test_registerUtility_w_existing_subscr.<locals>.IFooNrG   r&   r   r   rJ   r   K  rK   r   rJ   rQ   r   r   rn   )	rS   rB   ra   r   rT   r"   r(   r-   rt   r   rB   rJ   rU   rV   r   r   re   r2   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   rA   c                       e Zd Zy);ComponentsTests.test_registerUtility_wo_event.<locals>.IFooNrG   r&   r   r   rJ   r   ]  rK   r   rJ   rQ   r   F)rS   rB   ra   r   r"   rT   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 )Nro   )	reg_countsuperrT   dictr.   r   r   	__class__s     r   rT   ztComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Reg.registerUtilityp  sE    !#'.>>Q&26333D/ 'r   r)   rH   rI   r   rT   __classcell__r   s   @r   CompThatChangesAfter1Regr   m  s    I r   r   ro   c                       e Zd Zy)PComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.IFooNrG   r&   r   r   rJ   r   }  rK   r   rJ   r   r   rT   ra   r   r(   ru   listregisteredUtilities)r   r   r2   rJ   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 )Nro   r   )r   r   r.   r   rT   r   s     r   rT   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   ro   c                       e Zd Zy)QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   r   c                       e Zd Zy)QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IBarNrG   r&   r   r   IBarr     rK   r   r      r   )r   r   r2   rJ   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   r`   )r   rb   rc   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   rZ   r&   r   r   r\   zSComponentsTests.test_unregisterUtility_both_factory_and_component.<locals>._factory  r]   r   r^   )ra   r   rb   rc   r   rd   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   rA   c                       e Zd Zy)EComponentsTests.test_unregisterUtility_w_component_miss.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   r   )rS   rB   ra   r   r"   r   assertFalse)
r   rB   rJ   rU   rx   re   r2   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                 b   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                          | j                  |j                  j"                         | j%                  t'        |
      d       |
d   \  }}|\  }| j%                  |i        | j)                  ||       | j)                  |j                  |       | j+                  |j                  j,                  |       | j+                  |j                  j.                  |       | j+                  |j                  j0                  |       | j+                  |j                  j2                  |       | j5                  |j                  j6                         y # 1 sw Y   xY w)	Nr   rA   r   rj   c                       e Zd Zy)@ComponentsTests.test_unregisterUtility_w_component.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   r   ro   )rS   rB   rp   r   rq   rk   ra   r   rT   r"   r   
assertTruer   r-   rs   assertNotInr.   rt   r(   ru   r+   rr   r   rv   r   r_   rw   r`   )r   rB   r   rk   rJ   rU   rx   re   r2   r!   r   r   r   r   ry   s                  r   "test_unregisterUtility_w_componentz2ComponentsTests.test_unregisterUtility_w_component  s   >:?	> 	 F|(}}WdE2++- 	A**7D%@E	A112$(C(CD445Wq)1:bR e\2ell,?@ell++T2ell++T2ell''/ell,,g6%,,../!	A 	As   *H$$H.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                  ||       | j                  |j                  |       | j                  |j                  j                   |	       | j                  |j                  j"                  |       | j                  |j                  j$                  |       | j                  |j                  j&                         | j                  |j                  j(                  |       y # 1 sw Y   AxY w)Nr   rA   r   rj   c                       e Zd Zy)>ComponentsTests.test_unregisterUtility_w_factory.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   rQ   r   c                       S r   r&   r   s   r   r\   zBComponentsTests.test_unregisterUtility_w_factory.<locals>._factory  r   r   r   ro   )rS   rB   rp   r   rq   rk   ra   r   rT   r"   r   r   r(   ru   r+   rr   r   rv   r   r_   r`   )r   rB   r   rk   rJ   rU   rV   rx   r\   r2   r!   r   r   r   r   ry   re   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 e\2ell,?@ell++T2ell++T2ell''/ell,,g6ell**H5	P 	Ps   5G

G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                  |
||	|       | j                         \  }}|5  |j                  |
d |	      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                  |       | j!                  |j                  j"                  |       | j!                  |j                  j$                  |       | j!                  |j                  j&                  |	       | j!                  |j                  j(                  |
       | j!                  |j                  j*                  |       | j-                  |j                  j.                         y # 1 sw Y   fxY w)Nr   rA   r   r   rj   c                       e Zd Zy)IComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   c                       e Zd Zy)HComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.FooNrG   r&   r   r   rO   r     rK   r   rO   rQ   r   ro   rS   rB   r   rp   r   rq   rk   r   rT   r"   r   r   r(   ru   r+   ra   rr   r   rv   r   r_   rQ   rw   r`   r   rB   r   r   rk   rJ   rO   rU   rV   rx   re   r2   r!   r   r   r   r   ry   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 e\2ell,?@ell++T2ell++T2ell''/ell,,g6ell''/%,,../	A 	A   G;;H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                  |
||	|       | j                         \  }}|5  |j                  ||	      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                  |       | j!                  |j                  j"                  |       | j!                  |j                  j$                  |       | j!                  |j                  j&                  |	       | j!                  |j                  j(                  |
       | j!                  |j                  j*                  |       | j-                  |j                  j.                         y # 1 sw Y   fxY w)Nr   rA   r   r   rj   c                       e Zd Zy)LComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.IFooNrG   r&   r   r   rJ   r   ,  rK   r   rJ   c                       e Zd Zy)KComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.FooNrG   r&   r   r   rO   r   /  rK   r   rO   rQ   r   rv   r   ro   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 e\2ell,?@ell++T2ell++T2ell''/ell,,g6ell''/%,,../	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   rA   c                       e Zd Zy)FComponentsTests.test_unregisterUtility_w_existing_subscr.<locals>.IFooNrG   r&   r   r   rJ   r  N  rK   r   rJ   rQ   r   r   rn   
rS   rB   ra   r   rT   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   rA   c                       e Zd Zy)SComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable.<locals>.IFooNrG   r&   r   r   rJ   r  a  rK   r   rJ   rQ   r   r   rn   )
rS   rB   r   r   rT   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   rA   )_UtilityRegistrationsc                       e Zd Zy)]ComponentsTests.test_unregisterUtility_w_existing_subs_non_hashable_fresh_cache.<locals>.IFooNrG   r&   r   r   rJ   r  w  rK   r   rJ   rQ   r   r   rn   )rS   rB   rq   r
  r   r   rT   r"   r   r(   r-   rt   )r   rB   r
  rJ   rU   rV   r   r   re   r2   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   rA   c                       e Zd Zy)]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   rQ   r   r   r5   )rS   rB   r   r   rT   __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   rA   c                       e Zd Zy)VComponentsTests.test_unregisterUtility_w_existing_subscr_other_component.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   rQ   r   r   rn   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   rA   c                       e Zd Zy)[ComponentsTests.test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hash.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   rQ   r   r   rn   )rS   rB   ra   r   r   rT   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                 x   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                  |
d   |       | j                  |
d   j                  |	       | j                  |
d   j                  |       | j                  |
d   j                  |       | j                  |
d   j                   |       | j                  |
d   j"                  |       | j%                  |
d   j&                         | j                  |
d   |       | j                  |
d   j                  |	       | j                  |
d   j                  |       | j                  |
d   j                  |       | j                  |
d   j                   |       | j                  |
d   j"                  |       | j%                  |
d   j&                         y )Nr   rA   rj   c                       e Zd Zy)?ComponentsTests.test_registeredUtilities_notempty.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   rQ   r   r   c                     | j                   S r   r   rs    r   <lambda>zCComponentsTests.test_registeredUtilities_notempty.<locals>.<lambda>  s
    qvv r   keyr   ro   )rS   rB   rq   rk   ra   r   rT   sortedr   r(   ru   r+   rr   r   rv   r   r_   rQ   rw   r`   )r   rB   rk   rJ   rU   rV   r   r   re   r2   regs              r   !test_registeredUtilities_notemptyz1ComponentsTests.test_registeredUtilities_notempty  s   >?	> 	 F|(}}WdFE:WdFE:T--/5EFS1%c!f&9:c!foot,c!foot,c!fkk6*c!f&&0c!fkk5)#a&..)c!f&9:c!foot,c!foot,c!fkk6*c!f&&0c!fkk5)#a&..)r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  |j	                  |             y )Nr   rA   c                       e Zd Zy)?ComponentsTests.test_queryUtility_miss_no_default.<locals>.IFooNrG   r&   r   r   rJ   r-    rK   r   rJ   )rS   rB   r   rw   queryUtilityr   rB   rJ   rU   r2   s        r   !test_queryUtility_miss_no_defaultz1ComponentsTests.test_queryUtility_miss_no_default  s@    >	> 	 F|}}$++D12r   c                     ddl m}  G d d|      } |d      }| j                         }t               }| j	                  |j                  ||      |       y )Nr   rA   c                       e Zd Zy)>ComponentsTests.test_queryUtility_miss_w_default.<locals>.IFooNrG   r&   r   r   rJ   r3    rK   r   rJ   default)rS   rB   r   ra   rr   r.  )r   rB   rJ   rU   r2   _defaults         r    test_queryUtility_miss_w_defaultz0ComponentsTests.test_queryUtility_miss_w_default  sL    >	> 	 F|}}8d''h'?Jr   c                     ddl m}  G d d|      } |d      }t               }| j                         }|j	                  ||       | j                  |j                  |      |       y )Nr   rA   c                       e Zd Zy)3ComponentsTests.test_queryUtility_hit.<locals>.IFooNrG   r&   r   r   rJ   r:    rK   r   rJ   )rS   rB   ra   r   rT   rr   r.  r   rB   rJ   rU   re   r2   s         r   test_queryUtility_hitz%ComponentsTests.test_queryUtility_hit	  sW    >	> 	 F|(}}Wd+d''-w7r   c                     ddl m} ddlm}  G d d|      } |d      }| j	                         }| j                  ||j                  |       y )Nr   rA   ComponentLookupErrorc                       e Zd Zy)2ComponentsTests.test_getUtility_miss.<locals>.IFooNrG   r&   r   r   rJ   rA    rK   r   rJ   )rS   rB   rp   r?  r   rb   
getUtility)r   rB   r?  rJ   rU   r2   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                  |      |       y )Nr   rA   c                       e Zd Zy)1ComponentsTests.test_getUtility_hit.<locals>.IFooNrG   r&   r   r   rJ   rF  #  rK   r   rJ   )rS   rB   ra   r   rT   rr   rB  r;  s         r   test_getUtility_hitz#ComponentsTests.test_getUtility_hit   sU    >	> 	 F|(}}Wd+dood+W5r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t	        |j                  |            g        y )Nr   rA   c                       e Zd Zy)7ComponentsTests.test_getUtilitiesFor_miss.<locals>.IFooNrG   r&   r   r   rJ   rJ  /  rK   r   rJ   )rS   rB   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   rA   c                       e Zd Zy)6ComponentsTests.test_getUtilitiesFor_hit.<locals>.IFooNrG   r&   r   r   rJ   rO  9  rK   r   rJ   r   r   r"  )rS   rB   ra   r   rT   r(   r(  rK  r   rB   rJ   rU   r   r   re   r2   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   rA   c                       e Zd Zy)DComponentsTests.test_getAllUtilitiesRegisteredFor_miss.<locals>.IFooNrG   r&   r   r   rJ   rT  I  rK   r   rJ   )rS   rB   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   rA   c                       e Zd Zy)CComponentsTests.test_getAllUtilitiesRegisteredFor_hit.<locals>.IFooNrG   r&   r   r   rJ   rY  S  rK   r   rJ   r   r   r"  )rS   rB   ra   r   rT   r(   r   rU  rP  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   rA   rC   c                       e Zd Zy)FComponentsTests.test_registerAdapter_with_component_name.<locals>.IFooNrG   r&   r   r   rJ   r]  d  rK   r   rJ   r   rL   c                       e Zd Zy)EComponentsTests.test_registerAdapter_with_component_name.<locals>.FooNrG   r&   r   r   rO   r_  j  rP   r   rO   rQ   rR   )rS   rB   rD   r   registerAdapterr(   r/   )	r   rB   rD   rJ   rU   ibarrO   rV   r2   s	            r   (test_registerAdapter_with_component_namez8ComponentsTests.test_registerAdapter_with_component_name`  s    >5	> 	 F|F|	u	 	 
	}}S4'4e<''u(<=%L	r   c                 T   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   |   |   |   |	       | j                  |
j                  |f||f   |	|f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                   |       | j                  |j                   j"                  |
       | j                  |j                   j$                  |       | j                  |j                   j&                  |f       | j                  |j                   j(                  |       | j                  |j                   j*                  |       | j                  |j                   j,                  |	       y # 1 sw Y   xY w)Nr   rA   rh   AdapterRegistrationc                       e Zd Zy)SComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>.IFooNrG   r&   r   r   rJ   rg  {  rK   r   rJ   r   rQ   r   c                     t               r   rZ   contexts    r   r\   zWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>._factory  r]   r   ro   rS   rB   rp   ri   rq   re  r   r"   r`  rr   r,   rs   r(   r/   ru   r+   ra   r   rv   requiredr   rQ   r`   )r   rB   ri   re  rJ   rU   ra  rV   rx   r\   r2   r!   r   r   r   ry   s                   r   5test_registerAdapter_w_explicit_provided_and_requiredzEComponentsTests.test_registerAdapter_w_explicit_provided_and_requiredv  s   >8?	> 	 F|F|	(}}++- 	H  D7D%G	HMM##A&t,T259	
 	44dWdE5IJ"E*	,Wq)1:bR eZ0ell,?@ell++T2ell++T2..8ell''/ell''/ell**H5'	H 	Hs   HH'c                     ddl m}  G d d|      } |d      }d}d} G d d	      }| j                         }| j                  t        |j
                  ||f||
       y )Nr   rA   c                       e Zd Zy)HComponentsTests.test_registerAdapter_no_provided_available.<locals>.IFooNrG   r&   r   r   rJ   rp    rK   r   rJ   r   rQ   r   c                       e Zd Zy)LComponentsTests.test_registerAdapter_no_provided_available.<locals>._FactoryNrG   r&   r   r   _Factoryrr    rK   r   rs  r   rQ   rS   rB   r   rb   rc   r`  )r   rB   rJ   ra  rV   rx   rs  r2   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   |   |   |	   |
       | j                  |j                  |f||	f   |
|f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j!                  ||       | j!                  |j"                  |       | j                  |j"                  j$                  |       | j                  |j"                  j&                  |       | j                  |j"                  j(                  |f       | j                  |j"                  j*                  |	       | j                  |j"                  j,                  |       | j                  |j"                  j.                  |
       y # 1 sw Y   xY w)Nr   rA   implementerrh   rd  c                       e Zd Zy)GComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   r{    rK   r   rJ   r   rQ   r   c                       e Zd Zy)KComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>._FactoryNrG   r&   r   r   rs  r}    rP   r   rs  rt  ro   )rS   rB   ry  rp   ri   rq   re  r   r"   r`  rr   r,   rs   r(   r/   ru   r+   ra   r   rv   rl  r   rQ   r`   )r   rB   ry  ri   re  rJ   rU   ra  rV   rx   rs  r2   r!   r   r   r   ry   s                    r   )test_registerAdapter_wo_explicit_providedz9ComponentsTests.test_registerAdapter_wo_explicit_provided  s   >;8?	> 	 F|F|	T		 	 
	 }}++- 	L  D7U K	LMM##A&t,T259	
 	44dWdE5IJ"E*	,Wq)1:bR eZ0ell,?@ell++T2ell++T2..8ell''/ell''/ell**H5'	L 	Ls   2H55H?c                     ddl m}  G d d|      } |d      }d}d} G d d      }| j                         }| j                  t        |j
                  ||||	       y )
Nr   rA   c                       e Zd Zy)HComponentsTests.test_registerAdapter_no_required_available.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   rQ   r   c                       e Zd Zy)LComponentsTests.test_registerAdapter_no_required_available.<locals>._FactoryNrG   r&   r   r   rs  r    rK   r   rs  rv   r   rQ   ru  r   rB   rJ   rU   rV   rx   rs  r2   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   rA   c                       e Zd Zy)EComponentsTests.test_registerAdapter_w_invalid_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rQ   r   c                       e Zd Zy)IComponentsTests.test_registerAdapter_w_invalid_required.<locals>._FactoryNrG   r&   r   r   rs  r    rK   r   rs  r  ru  )	r   rB   rJ   rU   ra  rV   rx   rs  r2   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   |   |   |   |	       | j                  |
j                  |f||f   |	|f       | j                  t!        |      d       |d   \  }}|\  }| j                  |i        | j#                  ||       | j#                  |j$                  |       | j                  |j$                  j&                  |
       | j                  |j$                  j(                  |       | j                  |j$                  j*                  |f       | j                  |j$                  j,                  |       | j                  |j$                  j.                  |       | j                  |j$                  j0                  |	       y # 1 sw Y   xY w)Nr   rA   r   rh   rd  c                       e Zd Zy)MComponentsTests.test_registerAdapter_w_required_containing_None.<locals>.IFooNrG   r&   r   r   rJ   r     rK   r   rJ   rQ   r   c                       e Zd Zy)QComponentsTests.test_registerAdapter_w_required_containing_None.<locals>._FactoryNrG   r&   r   r   rs  r    rK   r   rs  r  ro   )rS   rB   zope.interface.interfacer   rp   ri   rq   re  r   r"   r`  rr   r,   rs   r(   r/   ru   r+   ra   r   rv   rl  r   rQ   r`   )r   rB   r   ri   re  rJ   rU   rV   rx   rs  r2   r!   r   r   r   ry   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>	
 	''dE(ABu	
 	Wq)1:bR eZ0ell,?@ell++T2ell++T2..=ell''/ell''/ell**H5-	9 	9s   H##H-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   |   |   |
   |       | j                  |j                  |f||
f   ||	f       | j                  t!        |      d       |d   \  }}|\  }| j                  |i        | j#                  ||       | j#                  |j$                  |       | j                  |j$                  j&                  |       | j                  |j$                  j(                  |       | j                  |j$                  j*                  |f       | j                  |j$                  j,                  |
       | j                  |j$                  j.                  |	       | j                  |j$                  j0                  |       y # 1 sw Y   xY w)Nr   rA   )implementedByrx  rh   rd  c                       e Zd Zy)NComponentsTests.test_registerAdapter_w_required_containing_class.<locals>.IFooNrG   r&   r   r   rJ   r  +  rK   r   rJ   r   rQ   r   c                       e Zd Zy)RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._FactoryNrG   r&   r   r   rs  r  3  rK   r   rs  c                       e Zd Zy)RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._ContextNrG   r&   r   r   _Contextr  6  rP   r   r  r  ro   )rS   rB   r  ry  rp   ri   rq   re  r   r"   r`  rr   r,   rs   r(   r/   ru   r+   ra   r   rv   rl  r   rQ   r`   )r   rB   r  ry  ri   re  rJ   rU   ra  rV   rx   rs  r  	_ctx_implr2   r!   r   r   r   ry   s                       r   0test_registerAdapter_w_required_containing_classz@ComponentsTests.test_registerAdapter_w_required_containing_class$  s   >=;8?	> 	 F|F|	 	 
T		 	 
	 "(+	}}++- 	9  H:&+% ! 9	9 	MM##A&y1$7>	
 	''dE(ABu	
 	Wq)1:bR eZ0ell,?@ell++T2ell++T2..=ell''/ell''/ell**H5-	9 	9s   
II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   rA   c                       e Zd Zy)MComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>.IFooNrG   r&   r   r   rJ   r  X  rK   r   rJ   rQ   r   c                       e Zd Zy)QComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>._FactoryNrG   r&   r   r   rs  r  `  rK   r   rs  r  )rS   rB   r   rb   rc   r`  ra   r  s           r   /test_registerAdapter_w_required_containing_junkz?ComponentsTests.test_registerAdapter_w_required_containing_junkU  s    >	> 	 F|	 	 }}y) 	  68*t%e ! 	 	 	s    A66A?c                 f   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      |   |   |       | j                  |	j                  f||f   ||f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                   |       | j                  |j                   j"                  |	       | j                  |j                   j$                  |       | j                  |j                   j&                  f       | j                  |j                   j(                  |       | j                  |j                   j*                  |       | j                  |j                   j,                  |       y # 1 sw Y   xY w)Nr   rA   rh   rd  c                       e Zd Zy)GComponentsTests.test_registerAdapter_wo_explicit_required.<locals>.IFooNrG   r&   r   r   rJ   r  n  rK   r   rJ   r   rQ   r   c                       e Zd ZW  fZy)KComponentsTests.test_registerAdapter_wo_explicit_required.<locals>._FactoryNr)   rH   rI   __component_adapts__ra  s   r   rs  r  v      $(7 r   rs  r  ro   rk  )r   rB   ri   re  rJ   rU   rV   rx   rs  r2   r!   r   r   r   ry   ra  s                  @r   )test_registerAdapter_wo_explicit_requiredz9ComponentsTests.test_registerAdapter_wo_explicit_requiredi  s   >8?	> 	 F|F|	+ 	+ }}++- 	-  Du&+ ! -	- 	MM##A&t,T259	
 	44dWdE5IJ"E*	,Wq)1:bR eZ0ell,?@ell++T2ell++T2..8ell''/ell''/ell**H5)	- 	-s   $H&&H0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   rA   c                       e Zd Zy);ComponentsTests.test_registerAdapter_wo_event.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rQ   r   c                     t               r   rZ   ri  s    r   r\   z?ComponentsTests.test_registerAdapter_wo_event.<locals>._factory  r]   r   F)ry   )rS   rB   r   r"   r`  r(   ru   )r   rB   rJ   rU   ra  rV   rx   r\   r2   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)r`   rv   )r   rb   rc   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   rA   c                       e Zd Zy)QComponentsTests.test_unregisterAdapter_neither_factory_nor_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r`   rv   rl  )rS   rB   r   rb   rc   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   rA   c                       e Zd Zy)9ComponentsTests.test_unregisterAdapter_miss.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd Zy)=ComponentsTests.test_unregisterAdapter_miss.<locals>._FactoryNrG   r&   r   r   rs  r    rK   r   rs  )rS   rB   r   r"   r  r   
r   rB   rJ   rU   ra  rs  r2   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                 r   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#                  ||       | j#                  |j$                  |       | j'                  |j$                  j(                  |       | j'                  |j$                  j*                  |       | j                  |j$                  j,                  |f       | j                  |j$                  j.                  d       | j                  |j$                  j0                  d       | j'                  |j$                  j2                  |       y # 1 sw Y   xY w)Nr   rA   r   rd  c                       e Zd Zy)YComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd Zy)]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>._FactoryNrG   r&   r   r   rs  r    rK   r   rs  ro   rn   )rS   rB   rp   r   rq   re  r   r`  r"   r  r   r   r,   rs   r/   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   r`   )r   rB   r   re  rJ   rU   ra  rs  r2   r!   r   r   r   r   ry   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 e\2ell,?@ell++T2ell++T2..8**B/**B/ell**H5!	D 	D   1H,,H6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                  ||       | j                  |j                  |       | j!                  |j                  j"                  |	       | j!                  |j                  j$                  |       | j                  |j                  j&                  |f       | j                  |j                  j(                  d       | j                  |j                  j*                  d       | j!                  |j                  j,                  |       y # 1 sw Y   hxY w)Nr   rA   rx  r   rd  c                       e Zd Zy)IComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd Zy)MComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>._FactoryNrG   r&   r   r   rs  r    rP   r   rs  ro   rn   )rS   rB   ry  rp   r   rq   re  r   r`  r"   r  r   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   r`   )r   rB   ry  r   re  rJ   rU   ra  rs  r2   r!   r   r   r   r   ry   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 e\2ell,?@ell++T2ell++T2..8**B/**B/ell**H5	> 	>   G<<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                  ||       | j                  |j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |       | j                  |j                  j$                  f       | j                  |j                  j&                  d       | j                  |j                  j(                  d       | j                  |j                  j*                  |       y # 1 sw Y   hxY w)Nr   rA   r   rd  c                       e Zd Zy)IComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd ZW  fZy)MComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rs  r    r  r   rs  rv   ro   rn   )rS   rB   rp   r   rq   re  r   r`  r"   r  r   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   r`   )r   rB   r   re  rJ   rU   rs  r2   r!   r   r   r   r   ry   ra  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 e\2ell,?@ell++T2ell++T2..8**B/**B/ell**H5	D 	D   4G..G8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                  |d   |       | j                  |d   j                  |
       | j                  |d   j                  |       | j                  |d   j                  |f       | j                  |d   j                  |       | j                  |d   j                   |       | j                  |d   j"                  |	       | j                  |d   |       | j                  |d   j                  |
       | j                  |d   j                  |       | j                  |d   j                  |f       | j                  |d   j                  |       | j                  |d   j                   |       | j                  |d   j"                  |	       y )Nr   rA   rd  c                       e Zd Zy)>ComponentsTests.test_registeredAdapters_notempty.<locals>.IFooNrG   r&   r   r   rJ   r  6  rK   r   rJ   rQ   r   r   c                       e Zd Zy)BComponentsTests.test_registeredAdapters_notempty.<locals>._FactoryNrG   r&   r   r   rs  r  ?  rK   r   rs  c                     | j                   S r   r"  r#  s    r   r%  zBComponentsTests.test_registeredAdapters_notempty.<locals>.<lambda>E  s
    aff r   r&  r   ro   )rS   rB   rq   re  r   r`  r(  r  r(   ru   r+   rr   r   rv   rl  r   rQ   r`   )r   rB   re  rJ   rU   ra  rV   r   r   rs  r2   r)  s               r    test_registeredAdapters_notemptyz0ComponentsTests.test_registeredAdapters_notempty2  s   >?	> 	 F|F|	 	 }}XwfeDXwfeDT,,.4DES1%c!f&9:c!foot,c!foot,Q4'2c!fkk6*c!fkk5)c!fnnh/c!f&9:c!foot,c!foot,Q4'2c!fkk6*c!fkk5)c!fnnh/r   c                     ddl m}  G d d|      } |d      }| j                         }t               }| j	                  |j                  ||             y )Nr   rA   c                       e Zd Zy)?ComponentsTests.test_queryAdapter_miss_no_default.<locals>.IFooNrG   r&   r   r   rJ   r  Y  rK   r   rJ   )rS   rB   r   ra   rw   queryAdapter)r   rB   rJ   rU   r2   _contexts         r   !test_queryAdapter_miss_no_defaultz1ComponentsTests.test_queryAdapter_miss_no_defaultV  sI    >	> 	 F|}}8$++Hd;<r   c                     ddl m}  G d d|      } |d      }| j                         }t               }t               }| j	                  |j                  |||      |       y )Nr   rA   c                       e Zd Zy)>ComponentsTests.test_queryAdapter_miss_w_default.<locals>.IFooNrG   r&   r   r   rJ   r  d  rK   r   rJ   r4  )rS   rB   r   ra   rr   r  )r   rB   rJ   rU   r2   r  r6  s          r    test_queryAdapter_miss_w_defaultz0ComponentsTests.test_queryAdapter_miss_w_defaulta  sY    >	> 	 F|}}88hh?	
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   rA   rx  c                       e Zd Zy)3ComponentsTests.test_queryAdapter_hit.<locals>.IFooNrG   r&   r   r   rJ   r  t  rK   r   rJ   r   c                       e Zd Zd Zy)7ComponentsTests.test_queryAdapter_hit.<locals>._Factoryc                     || _         y r   ri  r   rj  s     r   r  z@ComponentsTests.test_queryAdapter_hit.<locals>._Factory.__init__{  	    &r   Nr)   rH   rI   r  r&   r   r   rs  r  z      'r   rs  c                       e Zd Zy)7ComponentsTests.test_queryAdapter_hit.<locals>._ContextNrG   r&   r   r   r  r  ~  rP   r   r  )	rS   rB   ry  r   r`  r  r+   rr   rj  r   rB   ry  rJ   rU   ra  rs  r  r  r2   adapters              r   test_queryAdapter_hitz%ComponentsTests.test_queryAdapter_hitp  s    >;	> 	 F|F|	' 	' 
T		 	 
	 :}}Xw5##Hd3gx0goox0r   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   rA   rx  r>  c                       e Zd Zy)2ComponentsTests.test_getAdapter_miss.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd Zy)6ComponentsTests.test_getAdapter_miss.<locals>._ContextNrG   r&   r   r   r  r    rP   r   r  )rS   rB   ry  rp   r?  r   rb   
getAdapter)
r   rB   ry  r?  rJ   rU   ra  r  r  r2   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   rA   rx  c                       e Zd Zy)1ComponentsTests.test_getAdapter_hit.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd Zd Zy)5ComponentsTests.test_getAdapter_hit.<locals>._Factoryc                     || _         y r   ri  r  s     r   r  z>ComponentsTests.test_getAdapter_hit.<locals>._Factory.__init__  r  r   Nr  r&   r   r   rs  r    r  r   rs  c                       e Zd Zy)5ComponentsTests.test_getAdapter_hit.<locals>._ContextNrG   r&   r   r   r  r    rP   r   r  )	rS   rB   ry  r   r`  r  r+   rr   rj  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   rx  c                       e Zd Zy)8ComponentsTests.test_getAdapter_hit_super.<locals>.IBaseNrG   r&   r   r   IBaser    rK   r   r  c                       e Zd Zy);ComponentsTests.test_getAdapter_hit_super.<locals>.IDerivedNrG   r&   r   r   IDerivedr    rK   r   r  c                       e Zd Zy)7ComponentsTests.test_getAdapter_hit_super.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   c                       e Zd Zy)7ComponentsTests.test_getAdapter_hit_super.<locals>.BaseNrG   r&   r   r   Baser    rP   r   r  c                       e Zd Zy):ComponentsTests.test_getAdapter_hit_super.<locals>.DerivedNrG   r&   r   r   Derivedr    rP   r   r  c                       e Zd Zd Zy)>ComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBasec                     || _         y r   ri  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   ri  r  s     r   r  zJComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerived.__init__  r  r   Nr  r&   r   r   AdapterDerivedr!    r  r   r#  r   r   rS   ry  r   r`  _should_not_changer  r+   rr   rj  r   r   r   ry  r  r  rJ   r  r  r  r#  r2   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   rx  c                       e Zd Zy)^ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IBaseNrG   r&   r   r   r  r,    rK   r   r  c                       e Zd Zy)aComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IDerivedNrG   r&   r   r   r  r.    rK   r   r  c                       e Zd Zy)]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IFooNrG   r&   r   r   rJ   r0    rK   r   rJ   c                       e Zd Zy)]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.BaseNrG   r&   r   r   r  r2    rK   r   r  c                       e Zd Zy)_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child1NrG   r&   r   r   Child1r4    rK   r   r5  c                       e Zd Zy)_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child2NrG   r&   r   r   Child2r7    rP   r   r8  c                       e Zd Zy)`ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.DerivedNrG   r&   r   r   r  r:    rP   r   r  c                       e Zd Zd Zy)dComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterBasec                     || _         y r   ri  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   ri  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   ry  r  r  rJ   r  r5  r8  r  r  r#  r2   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   rA   rx  c                       e Zd Zy)9ComponentsTests.test_queryMultiAdapter_miss.<locals>.IFooNrG   r&   r   r   rJ   rD    rK   r   rJ   r   IBazc                       e Zd Zy)>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context1NrG   r&   r   r   	_Context1rG    rP   r   rH  c                       e Zd Zy)>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context2NrG   r&   r   r   	_Context2rJ  "  rP   r   rK  )rS   rB   ry  r   r(   queryMultiAdapterr   rB   ry  rJ   rU   ra  ibazrH  rK  	_context1	_context2r2   s               r   test_queryMultiAdapter_missz+ComponentsTests.test_queryMultiAdapter_miss  s    >;	> 	F|F|F|	T		 	 
	 
T		 	 
	 K	K	}}//I0FM	r   c                 R   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||      |       y )Nr   rA   rx  c                       e Zd Zy)CComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>.IFooNrG   r&   r   r   rJ   rT  0  rK   r   rJ   r   rE  c                       e Zd Zy)HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context1NrG   r&   r   r   rH  rV  7  rP   r   rH  c                       e Zd Zy)HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context2NrG   r&   r   r   rK  rX  ;  rP   r   rK  r4  )rS   rB   ry  ra   r   rr   rL  )r   rB   ry  rJ   rU   ra  rN  rH  rK  rO  rP  r6  r2   s                r   %test_queryMultiAdapter_miss_w_defaultz5ComponentsTests.test_queryMultiAdapter_miss_w_default,  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K	8}}""Iy#94+3 # 5	
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                  ||       | j                  |j                  |	|
f       y )Nr   rA   rx  c                       e Zd Zy)8ComponentsTests.test_queryMultiAdapter_hit.<locals>.IFooNrG   r&   r   r   rJ   r\  M  rK   r   rJ   r   rE  c                       e Zd Zy)=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context1NrG   r&   r   r   rH  r^  T  rP   r   rH  c                       e Zd Zy)=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context2NrG   r&   r   r   rK  r`  X  rP   r   rK  c                       e Zd Zd Zy)<ComponentsTests.test_queryMultiAdapter_hit.<locals>._Factoryc                     ||f| _         y r   ri  r   context1context2s      r   r  zEComponentsTests.test_queryMultiAdapter_hit.<locals>._Factory.__init__`      '1r   Nr  r&   r   r   rs  rb  _      2r   rs  )	rS   rB   ry  r   r`  rL  r+   r(   rj  r   rB   ry  rJ   rU   ra  rN  rH  rK  rO  rP  rs  r2   r  s                 r   test_queryMultiAdapter_hitz*ComponentsTests.test_queryMultiAdapter_hitI  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K		2 	2 }}Xd|T:(()Y)?Fgx0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   rA   rx  r>  c                       e Zd Zy)7ComponentsTests.test_getMultiAdapter_miss.<locals>.IFooNrG   r&   r   r   rJ   rm  n  rK   r   rJ   r   rE  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context1NrG   r&   r   r   rH  ro  u  rP   r   rH  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context2NrG   r&   r   r   rK  rq  y  rP   r   rK  )rS   rB   ry  rp   r?  r   rb   getMultiAdapter)r   rB   ry  r?  rJ   rU   ra  rN  rH  rK  rO  rP  r2   s                r   test_getMultiAdapter_missz)ComponentsTests.test_getMultiAdapter_missi  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                  ||       | j                  |j                  |	|
f       y )Nr   rA   rx  c                       e Zd Zy)6ComponentsTests.test_getMultiAdapter_hit.<locals>.IFooNrG   r&   r   r   rJ   rv    rK   r   rJ   r   rE  c                       e Zd Zy);ComponentsTests.test_getMultiAdapter_hit.<locals>._Context1NrG   r&   r   r   rH  rx    rP   r   rH  c                       e Zd Zy);ComponentsTests.test_getMultiAdapter_hit.<locals>._Context2NrG   r&   r   r   rK  rz    rP   r   rK  c                       e Zd Zd Zy):ComponentsTests.test_getMultiAdapter_hit.<locals>._Factoryc                     ||f| _         y r   ri  rd  s      r   r  zCComponentsTests.test_getMultiAdapter_hit.<locals>._Factory.__init__  rg  r   Nr  r&   r   r   rs  r|    rh  r   rs  )	rS   rB   ry  r   r`  rr  r+   r(   rj  ri  s                 r   test_getMultiAdapter_hitz(ComponentsTests.test_getMultiAdapter_hit  s    >;	> 	 F|F|F|	T		 	 
	 
T		 	 
	 K	K		2 	2 }}Xd|T:&&	9'=tDgx0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   r2   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   rx  c                       e Zd Zy)=ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IBaseNrG   r&   r   r   r  r    rK   r   r  c                       e Zd Zy)@ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IDerivedNrG   r&   r   r   r  r    rK   r   r  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.BaseNrG   r&   r   r   r  r    rP   r   r  c                       e Zd Zy)?ComponentsTests.test_getMultiAdapter_hit_super.<locals>.DerivedNrG   r&   r   r   r  r    rP   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>.AdapterDerivedNrG   r&   r   r   r#  r    rK   r   r#  )r   r   rS   ry  r   r`  r%  rr  r+   rr   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   rA   rx  c                       e Zd Zy)4ComponentsTests.test_getAdapters_empty.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rE  c                       e Zd Zy)9ComponentsTests.test_getAdapters_empty.<locals>._Context1NrG   r&   r   r   rH  r    rP   r   rH  c                       e Zd Zy)9ComponentsTests.test_getAdapters_empty.<locals>._Context2NrG   r&   r   r   rK  r    rP   r   rK  )rS   rB   ry  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   rA   rx  c                       e Zd Zy)CComponentsTests.test_getAdapters_factory_returns_None.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rE  c                       e Zd Zy)HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context1NrG   r&   r   r   rH  r     rP   r   rH  c                       e Zd Zy)HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context2NrG   r&   r   r   rK  r    rP   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   )rS   rB   ry  r   r`  r(   r   r  )r   rB   ry  rJ   rU   ra  rN  rH  rK  rO  rP  r2   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                  |d   d   |       | j                  |d   d   |       | j                  |d   d   |       y )Nr   rA   rx  c                       e Zd Zy)8ComponentsTests.test_getAdapters_non_empty.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rE  c                       e Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Context1NrG   r&   r   r   rH  r  !  rP   r   rH  c                       e Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Context2NrG   r&   r   r   rK  r  %  rP   r   rK  c                       e Zd Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory1c                     ||f| _         y r   ri  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   ri  rd  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory2.__init__1  rg  r   Nr  r&   r   r   	_Factory2r  0  rh  r   r  r   r   r"  r   ro   )
rS   rB   ry  r   r`  r(  r  r(   ru   r+   )r   rB   ry  rJ   rU   ra  rN  rH  rK  rO  rP  r  r  r   r   r2   founds                    r   test_getAdapters_non_emptyz*ComponentsTests.test_getAdapters_non_empty  sl   >;	> 	 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-eAhqk95q!f-eAhqk95r   c           	          ddl m}  G d d|      } |d      } |d      }d}d}d }| j                         }| j                  t        |j
                  ||f|||       y )	Nr   rA   c                       e Zd Zy)NComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrG   r&   r   r   rJ   r  C  rK   r   rJ   r   r   rQ   c                     t               r   rZ   ri  s    r   r\   zRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>._factoryK  r]   r   )rS   rB   r   rb   rc   registerSubscriptionAdapter)	r   rB   rJ   rU   ra  rx   rV   r\   r2   s	            r   0test_registerSubscriptionAdapter_w_nonblank_namez@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name@  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   |	       | j                  |
j                  |f|||	|fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                   |       | j                  |j                   j"                  |
       | j                  |j                   j$                  |       | j                  |j                   j&                  |f       | j                  |j                   j(                  |       | j                  |j                   j*                  |       | j                  |j                   j,                  |	       y # 1 sw Y   xY w)Nr   rA   rh   SubscriptionRegistrationc                       e Zd Zy)]ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>.IFooNrG   r&   r   r   rJ   r  W  rK   r   rJ   r   rn   rQ   c                     t               r   rZ   ri  s    r   r\   zaComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>._factory_  r]   r   rR   ro   rS   rB   rp   ri   rq   r  r   r"   r  r,   rt   r(   ru   rr   r0   r+   ra   r   rv   rl  r   rQ   r`   )r   rB   ri   r  rJ   rU   ra  _blankrV   r\   r2   r!   r   r)  r   r   ry   s                    r   ?test_registerSubscriptionAdapter_w_explicit_provided_n_requiredzOComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_requiredR  s   >8D	> 	 F|F|	( }}++- 	9,,Xw27 - 9	9 mm((+D1$7?S1%c!fh'99 7D&(EBC	EWq)1:bR eZ0ell,DEell++T2ell++T2..8**F3ell''/ell**H5'	9 	9s   H;;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   |
       | j                  |j                  |f||	|
|fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j!                  ||       | j!                  |j"                  |       | j                  |j"                  j$                  |       | j                  |j"                  j&                  |       | j                  |j"                  j(                  |f       | j                  |j"                  j*                  |	       | j                  |j"                  j,                  |       | j                  |j"                  j.                  |
       y # 1 sw Y   xY w)Nr   rA   rx  rh   r  c                       e Zd Zy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rQ   rn   c                       e Zd Zy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrG   r&   r   r   rs  r    rP   r   rs  rR   ro   )rS   rB   ry  rp   ri   rq   r  r   r"   r  r,   rt   r(   ru   rr   r0   r+   ra   r   rv   rl  r   rQ   r`   )r   rB   ry  ri   r  rJ   rU   ra  rV   r  rs  r2   r!   r   r)  r   r   ry   s                     r   5test_registerSubscriptionAdapter_wo_explicit_providedzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_providedy  s   >;8D	> 	 F|F|	T		 	 
	 }}++- 	L,,XwU,K	Lmm((+D1$7?S1%c!fh'99 7D&(EBC	EWq)1:bR eZ0ell,DEell++T2ell++T2..8**F3ell''/ell**H5%	L 	Ls   2II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   |       | j                  |	j                  f||||fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                   |       | j                  |j                   j"                  |	       | j                  |j                   j$                  |       | j                  |j                   j&                  f       | j                  |j                   j(                  |       | j                  |j                   j*                  |       | j                  |j                   j,                  |       y # 1 sw Y   xY w)Nr   rA   rh   r  c                       e Zd Zy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rQ   rn   c                       e Zd ZW  fZy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rs  r    r  r   rs  )rv   rQ   ro   r  )r   rB   ri   r  rJ   rU   rV   r  rs  r2   r!   r   r)  r   r   ry   ra  s                   @r   5test_registerSubscriptionAdapter_wo_explicit_requiredzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required  s   >8D	> 	 F|F|	+ 	+ }}++- 	,,4e - 	 mm((+D1$7?S1%c!fh'99 7D&(EBC	EWq)1:bR eZ0ell,DEell++T2ell++T2..8**F3ell''/ell**H5)	 	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   rA   c                       e Zd Zy)GComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   rQ   c                     t               r   rZ   ri  s    r   r\   zKComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>._factory  r]   r   FrQ   ry   )rS   rB   r   r"   r  r(   ru   )
r   rB   rJ   rU   ra  rV   r\   r2   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                  |
d   |       | j                  |
d   j                  |	       | j                  |
d   j                  |       | j                  |
d   j                  |f       | j                  |
d   j                  |       | j                  |
d   j                   |       | j                  |
d   j"                  |       | j                  |
d   |       | j                  |
d   j                  |	       | j                  |
d   j                  |       | j                  |
d   j                  |f       | j                  |
d   j                  |       | j                  |
d   j                   |       | j                  |
d   j"                  |       y )Nr   rA   r  c                       e Zd Zy)JComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   rQ   rn   c                       e Zd Zy)NComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>._FactoryNrG   r&   r   r   rs  r    rK   r   rs  rR   r   ro   )rS   rB   rq   r  r   r  r   r  r(   ru   r+   rr   r   rv   rl  r   rQ   r`   )r   rB   r  rJ   rU   ra  rV   r  rs  r2   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%c!f&>?c!foot,c!foot,Q4'2Qf-c!fkk5)c!fnnh/c!f&>?c!foot,c!foot,Q4'2Qf-c!fkk5)c!fnnh/r   c                     ddl m}  G d d|      } |d      } |d      }d}| j                         }| j                  t        |j
                  |||       y )Nr   rA   c                       e Zd Zy)PComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   nonblank)rl  rv   r   rS   rB   r   rb   rc   unregisterSubscriptionAdapter)r   rB   rJ   rU   ra  	_nonblankr2   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   rb   rc   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   rA   c                       e Zd Zy)]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   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   rA   c                       e Zd Zy)EComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>.IFooNrG   r&   r   r   rJ   r  $  rK   r   rJ   r   c                       e Zd Zy)IComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>._FactoryNrG   r&   r   r   rs  r  *  rK   r   rs  )rS   rB   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                 p   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#                  ||       | j#                  |j$                  |       | j'                  |j$                  j(                  |       | j'                  |j$                  j*                  |       | j                  |j$                  j,                  |f       | j                  |j$                  j.                  d       | j                  |j$                  j0                  d       | j3                  |j$                  j4                         y # 1 sw Y   xY w)Nr   rA   r   r  c                       e Zd Zy)OComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>.IFooNrG   r&   r   r   rJ   r  9  rK   r   rJ   r   c                       e Zd Zy)SComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>._FactoryNrG   r&   r   r   rs  r  ?  rK   r   rs  ro   rn   )rS   rB   rp   r   rq   r  r   r  r"   r  r   r   r,   rt   r0   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   rw   r`   r   rB   r   r  rJ   rU   ra  rs  r2   r!   r   r   r   r   ry   s                  r   1test_unregisterSubscriptionAdapter_hit_wo_factoryzAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory4  s   >:D	> 	 F|F|	 	 }}((D7DA++- 	L66tdWdKE	L33499:Wq)1:bR e\2ell,DEell++T2ell++T2..8**B/**B/%,,../!	L 	Ls   1H++H5c                 r   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#                  ||       | j#                  |j$                  |       | j'                  |j$                  j(                  |       | j'                  |j$                  j*                  |       | j                  |j$                  j,                  |f       | j                  |j$                  j.                  d       | j                  |j$                  j0                  d       | j'                  |j$                  j2                  |       y # 1 sw Y   xY w)Nr   rA   r   r  c                       e Zd Zy)NComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>.IFooNrG   r&   r   r   rJ   r  \  rK   r   rJ   r   c                       e Zd Zy)RComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>._FactoryNrG   r&   r   r   rs  r  b  rK   r   rs  ro   rn   )rS   rB   rp   r   rq   r  r   r  r"   r  r   r   r,   rt   r0   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   r`   r  s                  r   0test_unregisterSubscriptionAdapter_hit_w_factoryz@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factoryW  s   >:D	> 	 F|F|	 	 }}((D7DA++- 	P66x$$OE	P33499:Wq)1:bR e\2ell,DEell++T2ell++T2..8**B/**B/ell**H5!	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                  ||       | j                  |j                  |       | j!                  |j                  j"                  |	       | j!                  |j                  j$                  |       | j                  |j                  j&                  |f       | j                  |j                  j(                  d       | j                  |j                  j*                  d       | j!                  |j                  j,                  |       y # 1 sw Y   hxY w)Nr   rA   rx  r   r  c                       e Zd Zy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   r	    rK   r   rJ   r   c                       e Zd Zy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrG   r&   r   r   rs  r    rP   r   rs  ro   rn   )rS   rB   ry  rp   r   rq   r  r   r  r"   r  r   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   r`   )r   rB   ry  r   r  rJ   rU   ra  rs  r2   r!   r   r   r   r   ry   s                   r   7test_unregisterSubscriptionAdapter_wo_explicit_providedzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_providedz  s   >;:D	> 	 F|F|	T		 	 
	 }}((D7DA++- 	J66x$IE	JWq)1:bR e\2ell,DEell++T2ell++T2..8**B/**B/ell**H5	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                  ||       | j                  |j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |       | j                  |j                  j$                  f       | j                  |j                  j&                  d       | j                  |j                  j(                  d       | j                  |j                  j*                  |       y # 1 sw Y   hxY w)Nr   rA   r   r  c                       e Zd Zy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd ZW  fZy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rs  r    r  r   rs  r  ro   rn   )rS   rB   rp   r   rq   r  r   r  r"   r  r   r(   ru   r+   ra   rr   r   rv   rl  r   rQ   r`   )r   rB   r   r  rJ   rU   rs  r2   r!   r   r   r   r   ry   ra  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 e\2ell,DEell++T2ell++T2..8**B/**B/ell**H5	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   rA   rx  c                       e Zd Zy)4ComponentsTests.test_subscribers_empty.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   r   c                       e Zd Zy)3ComponentsTests.test_subscribers_empty.<locals>.BarNrG   r&   r   r   Barr    rP   r   r  )rS   rB   ry  r   r(   r   subscribers)	r   rB   ry  rJ   rU   ra  r2   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                  |
d   |       | j                  |
d   |       y )Nr   rA   rx  c                       e Zd Zy)8ComponentsTests.test_subscribers_non_empty.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   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)   rH   rI   r  r  r  s   r   rs  r     s    $(7 (r   rs  c                       e Zd Zy)<ComponentsTests.test_subscribers_non_empty.<locals>._DerivedNrG   r&   r   r   _Derivedr#    rK   r   r$  c                       e Zd Zy)7ComponentsTests.test_subscribers_non_empty.<locals>.BarNrG   r&   r   r   r  r&    rP   r   r  c                 .    | j                   j                  S r   )r   r)   xs    r   
_klassnamez>ComponentsTests.test_subscribers_non_empty.<locals>._klassname  s    ;;'''r   r&  r   ro   )
rS   rB   ry  r   r  r  r(  r(   ru   r+   )r   rB   ry  rJ   rU   rs  r$  r2   r  r  r  r*  ra  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-k!nh7k!nh7r   c                     ddl m}  G d d|      } |d      }d}| j                         }d }| j                  t        |j
                  |||       y )Nr   rA   c                       e Zd Zy)BComponentsTests.test_registerHandler_w_nonblank_name.<locals>.IFooNrG   r&   r   r   rJ   r.    rK   r   rJ   r  c                     t               r   rZ   ri  s    r   r\   zFComponentsTests.test_registerHandler_w_nonblank_name.<locals>._factory 	  r]   r   rl  r   )rS   rB   r   rb   rc   registerHandler)r   rB   rJ   rU   r  r2   r\   s          r   $test_registerHandler_w_nonblank_namez4ComponentsTests.test_registerHandler_w_nonblank_name  sW    >	> 	 F|	}}	( 	)T%9%98#'i 	 	9r   c                 0   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   |       | j                  |	j                  |f|||fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  ||       | j                  |j                   |       | j                  |j                   j"                  |	       | j                  |j                   j$                  |f       | j                  |j                   j&                  |       | j                  |j                   j(                  |       | j                  |j                   j*                  |       y # 1 sw Y   xY w)Nr   rA   rh   HandlerRegistrationc                       e Zd Zy)FComponentsTests.test_registerHandler_w_explicit_required.<locals>.IFooNrG   r&   r   r   rJ   r7  	  rK   r   rJ   rn   rQ   c                     t               r   rZ   ri  s    r   r\   zJComponentsTests.test_registerHandler_w_explicit_required.<locals>._factory	  r]   r   rR   ro   )rS   rB   rp   ri   rq   r5  r   r"   r1  r,   rt   r(   ru   rr   r1   r+   ra   r   rl  r   rQ   r`   )r   rB   ri   r5  rJ   rU   r  rV   r\   r2   r!   r   r)  r   r   ry   s                   r   (test_registerHandler_w_explicit_requiredz8ComponentsTests.test_registerHandler_w_explicit_required	  s   >8?	> 	 F|	( }}++- 	@  D7 ?	@mm((+D1$7?S1%c!fh'44 7FHe<=	?Wq)1:bR eZ0ell,?@ell++T2..8**F3ell''/ell**H5#	@ 	@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   |       | j                  |j                  
f|||fg       | j                  t        |      d       y # 1 sw Y   xY w)Nr   rA   c                       e Zd Zy)PComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>.IFooNrG   r&   r   r   rJ   r<  -	  rK   r   rJ   rQ   rn   c                       e Zd ZW  fZy)TComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>._FactoryNr  rU   s   r   rs  r>  4	  s    $(7 r   rs  Fr  ro   )rS   rB   r   r"   r1  r,   rt   r(   ru   rr   r1   )r   rB   rJ   rV   r  rs  r2   r!   r   r)  rU   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%c!fh'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_emptyC	  s)    }}d55789r   c                 t   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                  |	d   |       | j                  |	d   j                  |f       | j                  |	d   j                  d       | j                  |	d   j                  |       | j                  |	d   j                  d       | j                  |	d   |       | j                  |	d   j                  |f       | j                  |	d   j                  d       | j                  |	d   j                  |       | j                  |	d   j                  d       y )Nr   rA   r4  c                       e Zd Zy)?ComponentsTests.test_registeredHandlers_non_empty.<locals>.IFooNrG   r&   r   r   rJ   rF  K	  rK   r   rJ   c                     t               r   rZ   ri  s    r   	_factory1zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory1P	  r]   r   c                     t               r   rZ   ri  s    r   	_factory2zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory2S	  r]   r   c                 B    | j                   j                  j                  S r   )r`   __code__co_namer(  s    r   _factory_namezHComponentsTests.test_registeredHandlers_non_empty.<locals>._factory_nameZ	  s    99%%---r   r&  r   rn   ro   )rS   rB   rq   r5  r   r1  r(  rB  r(   ru   r+   rl  r   r`   rQ   )
r   rB   r5  rJ   rU   rH  rJ  r2   rN  r  s
             r   !test_registeredHandlers_non_emptyz1ComponentsTests.test_registeredHandlers_non_emptyG	  s   >?	> 	 F|	(	( }}Y0Y0	. T446MJ[)1-k!n.ABQ004':Q,,b1Q//;Q,,b1k!n.AB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   rA   c                       e Zd Zy)DComponentsTests.test_unregisterHandler_w_nonblank_name.<locals>.IFooNrG   r&   r   r   rJ   rR  m	  rK   r   rJ   r  r0  )rS   rB   r   rb   rc   unregisterHandler)r   rB   rJ   rU   r  r2   s         r   &test_unregisterHandler_w_nonblank_namez6ComponentsTests.test_unregisterHandler_w_nonblank_namej	  sP    >	> 	 F|	}})T%;%;$(7 	 	<r   c                 d    | j                         }| j                  t        |j                         y r   )r   rb   rc   rS  r:   s     r   3test_unregisterHandler_neither_factory_nor_requiredzCComponentsTests.test_unregisterHandler_neither_factory_nor_requiredv	  s#    }})T%;%;<r   c                     ddl m}  G d d|      } |d      }| j                         }|j                  |f      }| j	                  |       y )Nr   rA   c                       e Zd Zy)9ComponentsTests.test_unregisterHandler_miss.<locals>.IFooNrG   r&   r   r   rJ   rY  }	  rK   r   rJ   rl  )rS   rB   r   rS  r   )r   rB   rJ   rU   r2   r   s         r   test_unregisterHandler_missz+ComponentsTests.test_unregisterHandler_missz	  sJ    >	> 	 F|}}&&&8r   c                 X   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                  ||       | j                  |j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |f       | j                  |j                  j$                  d	       | j                  |j                  j&                  |       y # 1 sw Y   xY w)
Nr   rA   r   r4  c                       e Zd Zy)XComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   r^  	  rK   r   rJ   c                     t               r   rZ   ri  s    r   r\   z\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>._factory	  r]   r   ro   rn   )rS   rB   rp   r   rq   r5  r   r1  r"   rS  r   r(   ru   r+   ra   rr   r   rl  r   r`   r   rB   r   r5  rJ   rU   r2   r\   r!   r   r   r   r   ry   s                 r   :test_unregisterHandler_hit_w_factory_and_explicit_providedzJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided	  s_   >:?	> 	 F|}}	( }}Xw/++- 	>**8dW=E	>Wq)1:bR e\2ell,?@ell++T2..8**B/ell**H5	> 	>s   1FF)c                 V   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                  ||       | j                  |j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  |f       | j                  |j                  j$                  d
       | j'                  |j                  j(                         y # 1 sw Y   xY w)Nr   rA   r   r4  c                       e Zd Zy)QComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>.IFooNrG   r&   r   r   rJ   rd  	  rK   r   rJ   c                     t               r   rZ   ri  s    r   r\   zUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>._factory	  r]   r   rZ  ro   rn   )rS   rB   rp   r   rq   r5  r   r1  r"   rS  r   r(   ru   r+   ra   rr   r   rl  r   rw   r`   r`  s                 r   3test_unregisterHandler_hit_w_only_explicit_providedzCComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided	  s`   >:?	> 	 F|}}	( }}Xw/++- 	=**TG*<E	=Wq)1:bR e\2ell,?@ell++T2..8**B/%,,../	= 	=s   1FF(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                  ||       | j                  |j                  |       | j                  |j                  j                   |       | j                  |j                  j"                  f       | j                  |j                  j$                  d
       | j                  |j                  j&                  d
       | j                  |j                  j(                  |       y # 1 sw Y   BxY w)Nr   rA   r   r4  c                       e Zd Zy)IComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>.IFooNrG   r&   r   r   rJ   ri  	  rK   r   rJ   c                       e Zd ZW  fZy)MComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>._FactoryNr  r?  s   r   rs  rk  	  r  r   rs  ro   rn   )rS   rB   rp   r   rq   r5  r   r1  r"   rS  r   r(   ru   r+   ra   rr   r   rl  r   rQ   r`   )r   rB   r   r5  rJ   rs  r2   r!   r   r   r   r   ry   rU   s                @r   +test_unregisterHandler_wo_explicit_requiredz;ComponentsTests.test_unregisterHandler_wo_explicit_required	  sl   >:?	> 	 F|	+ 	+ }}X&++- 	5**84E	5Wq)1:bR e\2ell,?@ell++T2..8**B/**B/ell**H5	5 	5s   )F;;Gc                     ddl m} ddl m}  G d d|      } |d      }| j                         } ||       G d d             } |       }|j	                  |f       y )Nr   rA   rx  c                       e Zd Zy)/ComponentsTests.test_handle_empty.<locals>.IFooNrG   r&   r   r   rJ   ro  	  rK   r   rJ   c                       e Zd Zy).ComponentsTests.test_handle_empty.<locals>.BarNrG   r&   r   r   r  rq  	  rP   r   r  )rS   rB   ry  r   handle)r   rB   ry  rJ   rU   r2   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   rA   rx  c                       e Zd Zy)3ComponentsTests.test_handle_non_empty.<locals>.IFooNrG   r&   r   r   rJ   rv  	  rK   r   rJ   c                 (    j                  |        y r   r   )rj  	_called_1s    r   
_factory_1z9ComponentsTests.test_handle_non_empty.<locals>._factory_1	      W%r   c                 (    j                  |        y r   r   )rj  	_called_2s    r   
_factory_2z9ComponentsTests.test_handle_non_empty.<locals>._factory_2
  rz  r   c                       e Zd Zy)2ComponentsTests.test_handle_non_empty.<locals>.BarNrG   r&   r   r   r  r  	
  rP   r   r  )rS   rB   ry  r   r1  rr  r(   )r   rB   ry  rJ   rU   ry  r}  r2   r  r  rx  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>.IFooNrG   r&   r   r   rJ   r  
  rK   r   rJ   r  r  r   ro   rn   r      r   )r   r   ra   rT   r(   ru   r-   rt   	_providedr   r   )r   	identicalrJ   r2   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_provided0
  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)   rH   rI   __doc__r&   r   r   rJ   r  7
      r   rJ   c                       e Zd ZdZy)YComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.UtilityImplementingFoor  Nr  r&   r   r   UtilityImplementingFoor  :
  r  r   r     r"  ro   r   rn   
   r&                  )did_not_registerneeded_registereddid_not_subscribeneeded_subscribedT)rebuild)r   r   rangerT   r-   _generationrs   r(   ru   rt   typer   strassertNotEqual$rebuildUtilityRegistryFromLocalCacheassertIn)r   rJ   r  compsiorig_generationorig_adaptersorig_subscribersnew_adaptersdr   new_subsr2   rebuild_preflightrebuild_resultsorig_subscriberpreflight_afterrebuild_afters                     r   )test_rebuildUtilityRegistryFromLocalCachez9ComponentsTests.test_rebuildUtilityRegistryFromLocalCache5
  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)   rH   rI   r   r   r"   r3   r6   r;   r?   rW   rf   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r*  r0  r7  r<  rC  rG  rL  rQ  rV  rZ  rb  rm  rv  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+  r2  r9  r@  rC  rO  rT  rV  r[  ra  rf  rl  rs  r  r  r  r  r   r   s   @r   r	   r	      s   9 :F=	= ,?0B6B
M 0D*"%,12(0TO$* C2C@G
?" 0@ 6D"0H#0JO&O&O.>8(*(.?*@3	K
8	G
6?A L$ ,$6L2"'6RA$G$(6T/6b(&6P*(7
	F $!6F!6F6B>"0H	=
12;(12*0X00d0
:B@N4B@5-1^F2AB(6TA$%6N&6P&6P*(J!0FH7
	F"&!0F!6F!6F6BC$$8L9 "6H*2:!2F
<=	 6>0>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>.ComponentsNrG   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)   rH   rI   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   rj   )rq   rk   )r   rk   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   rA   c                       e Zd Zy)AUtilityRegistrationTests._makeOne.<locals>.InterfaceClassSubclassNrG   r&   r   r   InterfaceClassSubclassr  
  rK   r   r  rJ   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)   rH   rI   r  r&   r   r   	_Registryr  
      #r   r  r   	DOCSTRINGrS   rB   r   )r   r_   r`   rB   r  rU   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)rp   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)rp   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TESTNrG   r&   r   r   
_Componentr  
      Hr   r  zAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')r8   r   r  
_componentr  	_registryrx   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   ra   rv   r(   r9   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   ra   r   r(   __hash__idr   r  r  r  rx   s        r   test___hash__z&UtilityRegistrationTests.test___hash__
  8    X
#}}Z8Iu2/r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   ra   r   r(   r   s        r   test___eq___identityz-UtilityRegistrationTests.test___eq___identity
  .    X
#}}Z8IuR r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  r   r  r  r  rx   ur2r  s          r   test___eq___hitz(UtilityRegistrationTests.test___eq___hit  B    X
#}}Z8IuMM*-	QS!r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   ra   r   r  r   r  _component2r  r  rx   r	  r  s           r   test___eq___missz)UtilityRegistrationTests.test___eq___miss	  I    X
h#}}Z8IuMM+.	QB$r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   r  r   s        r   test___ne___identityz-UtilityRegistrationTests.test___ne___identity  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  r  s          r   test___ne___hitz(UtilityRegistrationTests.test___ne___hit  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  r  s           r   test___ne___missz)UtilityRegistrationTests.test___ne___miss  r  r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   ra   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                  ||       y N2ra   r   r   
assertLessr  s           r   test___lt___missz)UtilityRegistrationTests.test___lt___miss-  R    X
h#}}Z8IuMM+.	Q3;C r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   ra   r   assertLessEqualr   s        r   test___le___identityz-UtilityRegistrationTests.test___le___identity5  .    X
#}}Z8IuR$r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r'  r  s          r   test___le___hitz(UtilityRegistrationTests.test___le___hit:  B    X
#}}Z8IuMM*-	QR%r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   ra   r   r   r(  r  s           r   test___le___missz)UtilityRegistrationTests.test___le___miss@  T    X
h#}}Z8IuMM+.	Q3;R%r   c                 j    t               }| j                  |      \  }}}| j                  ||kD         y r   r  r   s        r   test___gt___identityz-UtilityRegistrationTests.test___gt___identityH  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   ra   r   r   assertGreaterr  s           r   test___gt___hitz(UtilityRegistrationTests.test___gt___hitM  T    X
h#}}Z8IuMM+.	Q3;3#r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||kD         y r   r  r  s          r   test___gt___missz)UtilityRegistrationTests.test___gt___missU  D    X
#}}Z8IuMM*-	Qr"r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   ra   r   assertGreaterEqualr   s        r   test___ge___identityz-UtilityRegistrationTests.test___ge___identity[  .    X
#}}Z8IuB'r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r   ra   r   r   r   r  s           r   test___ge___missz)UtilityRegistrationTests.test___ge___miss`  V    X
h#}}Z8IuMM+.	Q3;s#r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   ra   r   r   r>  r  s          r   test___ge___hitz(UtilityRegistrationTests.test___ge___hith  M    X
#}}Z8IuMM*-	Q3;R(r   )NN)r)   rH   rI   r   r   r  r  r;   r  r  r  r  r
  r  r  r  r  r  r  r$  r)  r,  r0  r3  r7  r:  r?  rC  rG  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   rd  )rq   re  )r   re  s     r   r   z(AdapterRegistrationTests._getTargetClassr  r  r   Nc                     ddl m}  G d d|      } |d      } |d      } G d d      } |       }d}d	}	| j                         }
 |
||f||||	      ||fS )
Nr   rA   c                       e Zd Zy)/AdapterRegistrationTests._makeOne.<locals>.IFooNrG   r&   r   r   rJ   rN  y  rK   r   rJ   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__  r  r   Nr  r&   r   r   r  rP    r  r   r  r   r  r  r   r_   rB   rJ   rU   ra  r  r   r   r  r  s              r   r   z!AdapterRegistrationTests._makeOnev  t    >	> 	 F|F|	# 	# ;$$&(TGT4C@
 	
r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   IAdapterRegistrationr  )rp   rV  r  r  r   )r   rV  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   rU  r  )rp   rV  r  r  r   )r   rV  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  NrG   r&   r   r   r  r]    r  r   r  zCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')r8   r   r  r  rY  r  rx   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  ra    r  r   r  CAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')r  r^  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  rg    r  r   r  rc  r  r^  s         r   r  z8AdapterRegistrationTests.test___repr___component_wo_name  rd  r   c                     t               }| j                  |      \  }}}| j                  |j                         t	        |             y r   r  r   r  rY  r  rx   s        r   r  z&AdapterRegistrationTests.test___hash__  r  r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   r  rj  s        r   r  z-AdapterRegistrationTests.test___eq___identity  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  r   r  rY  r  rx   ar2r  s          r   r
  z(AdapterRegistrationTests.test___eq___hit  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  r   r  r  rY  r  rx   rn  r  s           r   r  z)AdapterRegistrationTests.test___eq___miss  r  r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   r  rj  s        r   r  z-AdapterRegistrationTests.test___ne___identity  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  rm  s          r   r  z)AdapterRegistrationTests.test___ne___miss  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r  rp  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                  ||       y )Nr   rA   c                       e Zd Zy)?AdapterRegistrationTests.test___ne___hit_provided.<locals>.IFooNrG   r&   r   r   rJ   rw    rK   r   rJ   rE  )rS   rB   ra   r   rv   r  )
r   rB   rJ   rN  r  rY  r  rx   rn  r  s
             r   test___ne___hit_providedz1AdapterRegistrationTests.test___ne___hit_provided  sc    >	> 	 F|X
#}}Z8IuMM*-	QB$r   c                     ddl m}  G d d|      } |d      }t               }t               }| j                  |      \  }}}| j                  |      \  }	}
}
|f|	_        | j                  ||	       y )Nr   rA   c                       e Zd Zy)?AdapterRegistrationTests.test___ne___hit_required.<locals>.IFooNrG   r&   r   r   rJ   r{    rK   r   rJ   rE  )rS   rB   ra   r   rl  r  )r   rB   rJ   rN  r  r  rY  r  rx   rn  r  s              r   test___ne___hit_requiredz1AdapterRegistrationTests.test___ne___hit_required  sl    >	> 	 F|X
h#}}Z8IuMM+.	QwB$r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  rj  s        r   r  z-AdapterRegistrationTests.test___lt___identity
  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  rm  s          r   r  z(AdapterRegistrationTests.test___lt___hit  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   r"  rp  s           r   r$  z)AdapterRegistrationTests.test___lt___miss  r%  r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   r'  rj  s        r   r)  z-AdapterRegistrationTests.test___le___identity  r*  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||       y r   r'  rm  s          r   r,  z(AdapterRegistrationTests.test___le___hit"  r-  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   r/  rp  s           r   r0  z)AdapterRegistrationTests.test___le___miss(  r1  r   c                 j    t               }| j                  |      \  }}}| j                  ||kD         y r   r  rj  s        r   r3  z-AdapterRegistrationTests.test___gt___identity0  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   r5  rp  s           r   r7  z(AdapterRegistrationTests.test___gt___hit5  r8  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||kD         y r   r  rm  s          r   r:  z)AdapterRegistrationTests.test___gt___miss=  r;  r   c                 f    t               }| j                  |      \  }}}| j                  ||       y r   r=  rj  s        r   r?  z-AdapterRegistrationTests.test___ge___identityC  r@  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r   rB  rp  s           r   rC  z)AdapterRegistrationTests.test___ge___missH  rD  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||       y r   rF  rm  s          r   rG  z(AdapterRegistrationTests.test___ge___hitP  rH  r   r   )r)   rH   rI   r   r   rW  rZ  r;   r  r  r  r  r
  r  r  r  rt  rx  r|  r  r  r$  r)  r,  r0  r3  r7  r:  r?  rC  rG  r&   r   r   rJ  rJ  p  s    #
.B
/

 
 0
!
"%!
"%%%"
#!%
&&"
$#(
$)r   rJ  c                   &    e Zd Zd ZddZd Zd Zy)SubscriptionRegistrationTestsc                     ddl m} |S )Nr   r  )rq   r  )r   r  s     r   r   z-SubscriptionRegistrationTests._getTargetClassZ  s    D''r   Nc                     ddl m}  G d d|      } |d      } |d      } G d d      } |       }d}d	}	| j                         }
 |
||f||||	      ||fS )
Nr   rA   c                       e Zd Zy)4SubscriptionRegistrationTests._makeOne.<locals>.IFooNrG   r&   r   r   rJ   r  a  rK   r   rJ   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__h  r  r   Nr  r&   r   r   r  r  g  r  r   r  r   r  r  rR  s              r   r   z&SubscriptionRegistrationTests._makeOne^  rS  r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr    ISubscriptionAdapterRegistrationr  )rp   r  r  r  r   )r   r  r  s      r   7test_class_conforms_to_ISubscriptionAdapterRegistrationzUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistrationu  s    N54d6J6J6LMr   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   r  r  )rp   r  r  r  r   )r   r  r  sarr  s        r   :test_instance_conforms_to_ISubscriptionAdapterRegistrationzXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistrationz  s$    N6MMO	Q5s;r   r   )r)   rH   rI   r   r   r  r  r&   r   r   r  r  X  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   r4  )rq   r5  )r   r5  s     r   r   z(HandlerRegistrationTests._getTargetClass  r  r   Nc                     ddl m}  G d d|      } |d      } G d d      } |       }d}d}| j                         }	 |	||f|||      ||fS )	Nr   rA   c                       e Zd Zy)/HandlerRegistrationTests._makeOne.<locals>.IFooNrG   r&   r   r   rJ   r    rK   r   rJ   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_   rB   rJ   rU   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  )rp   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  )rp   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                  |       | j                  |j                  |j                         | j	                  |j
                         y )Nc                     t               r   rZ   ri  s    r   r\   z:HandlerRegistrationTests.test_properties.<locals>._factory  r]   r   )r   rr   handlerr`   rw   rv   )r   r\   r  r  s       r   test_propertiesz(HandlerRegistrationTests.test_properties  sU    	(==*Aqbjj(+bjj"**-"++&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  NrG   r&   r   r   rs  r    r  r   rs  =HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')r8   r   rs  r  r  rx   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   rs  r    r  r   rs  r  r8   r  s        r   test___repr___factory_wo_namez6HandlerRegistrationTests.test___repr___factory_wo_name  sG    	 	  $}}XZ8IuH	
r   r   )
r)   rH   rI   r   r   r  r  r  r  r  r&   r   r   r  r    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)   rH   rI   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)   rH   rI   r  r&   r   r   r  r    s    5r   r  c                       e Zd Zy)PersistentDictComponentsNrG   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  r2   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   ra   rT   r   rr   rB  r  r  r(   r)   assertIsNotNoner  )r   r  r2   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)   rH   rI   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)   rH   rI   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)   rH   rI   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__4  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__=  s2    ////1 	-JCDKKe,	-r   N)r)   rH   rI   r  r  r  r&   r   r   r    r    2  s    (-r   r    )r  unittestr   r   r'   r   rq   r   TestCaser	   r  r  rJ  r  r  r  r  r   r  r  r  r  r  r    r&   r   r   <module>r      s      $ ; .y)Kh'' y)KxS "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   