
    Ng                       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!e      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 ZqdtdpZrdq Zsdr Zt xZuS )uComponentsTestsc                     t         S Nr   selfs    ]/var/www/djangounited/venv/lib/python3.12/site-packages/zope/interface/tests/test_registry.py_getTargetClasszComponentsTests._getTargetClass   s        c                 6     | j                         |g|i |S r   r   )r   nameargskws       r   _makeOnezComponentsTests._makeOne   s"    %t##%d8T8R88r   c                 @    ddl m} g fd}t        ||      }|fS )Nr   )registryc                  ,    j                  | |f       y r   append)r   r   _eventss     r   _notifyz,ComponentsTests._wrapEvents.<locals>._notify"   s    NND":&r   )notify)zope.interfacer   _Monkey)r   r   r   _monkeyr   s       @r   _wrapEventszComponentsTests._wrapEvents   s'    +	'(73r   c                    ddl m} | j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  t        |j                  |             | j                  t        |j                  |             | j                  |j                  j
                  d       | j                  |j                  j
                  d       | j                  |j                  i        | j                  |j                  i        | j                  |j                  g        | j                  |j                  g        y )Nr   )AdapterRegistrytesting )zope.interface.adapterr$   r   assertEqual__name__	__bases__
assertTrue
isinstanceadapters	utilities_utility_registrations_adapter_registrations_subscription_registrations_handler_registrations)r   r$   comps      r   test_ctor_no_basesz"ComponentsTests.test_ctor_no_bases'   s    :}}Y'	2,
4==/BC
4>>?CD00"5112644b944b9992>44b9r   c                    | j                  d      }| j                  d|f      }| j                  |j                  d       | j                  |j                  |f       | j                  |j                  j                  |j                  f       | j                  |j
                  j                  |j
                  f       y )Nbaser%   )r   r(   r)   r*   r-   r.   )r   r6   r3   s      r   test_ctor_w_basez ComponentsTests.test_ctor_w_base5   s    }}V$}}Y0	2$1004==2BC11DNN3DEr   c                 \    | j                  d      }| j                  t        |      d       y )Nr%   z<Components testing>)r   r(   reprr   r3   s     r   test___repr__zComponentsTests.test___repr__=   s%    }}Y'd%;<r   c                    | j                  d      }| j                  d      }| j                         }||f|_        | j                  |j                  ||f       | j                  |j                  j                  |j                  |j                  f       | j                  |j                  j                  |j                  |j                  f       y )Nbase1base2)r   r*   r(   r-   r.   )r   r=   r>   r3   s       r   test_assign_to___bases__z(ComponentsTests.test_assign_to___bases__C   s    g&g&}}%800..%..9	;11//5??;	=r   c                    ddl m}m}  G d d|      } |d      } |d       G d dt                     } |       }d}| j	                         }|j                  |||	       | j                  |j                  |df   ||d f       y )
Nr   namedInterfaceClassc                       e Zd Zy)FComponentsTests.test_registerUtility_with_component_name.<locals>.IFooNr)   
__module____qualname__r&   r   r   IFoorE   R       r   rI   fooc                       e Zd Zy)EComponentsTests.test_registerUtility_with_component_name.<locals>.FooNrF   r&   r   r   FoorM   V       r   rN   inforP   )zope.interface.declarationsrB   rC   objectr   registerUtilityr(   r/   )	r   rB   rC   rI   ifoorN   rK   _infor3   s	            r   (test_registerUtility_with_component_namez8ComponentsTests.test_registerUtility_with_component_nameN   s    E	> 	F|	v	& 	 
	e}}S$U3''f5%	 r   c                     d }t               }| j                         }| j                  t        |j                  ||       y )Nc                      t               r   NotImplementedErrorr&   r   r   _factoryzQComponentsTests.test_registerUtility_both_factory_and_component.<locals>._factoryc       %''r   	componentfactoryrS   r   assertRaises	TypeErrorrT   r   r\   _to_regr3   s       r   /test_registerUtility_both_factory_and_componentz?ComponentsTests.test_registerUtility_both_factory_and_componentb   s;    	((}})T%9%9$+X 	 	?r   c                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}t               }| j                         }	| j                         \  }
}|
5  |	j                  ||||       d d d        | j                  |	j                  j                  d   |   |   |u        | j                  |	j                  ||f   ||d f       | j                  |	j                  j                  d   |   d	   |f       | j                  t!        |      d
       |d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j                  |             | j                  |j                  j$                  |	u        | j                  |j                  j&                  |u        | j                  |j                  j(                  |u        | j                  |j                  j*                  |u        | j                  |j                  j,                  |u        | j                  |j                  j.                  d u        y # 1 sw Y   xY w)Nr   rC   
RegisteredUtilityRegistrationc                       e Zd Zy)>ComponentsTests.test_registerUtility_w_component.<locals>.IFooNrF   r&   r   r   rI   rn   o   rJ   r   rI   rP   r       )rR   rC   zope.interface.interfacesrj   zope.interface.registryrl   rS   r   r"   rT   r+   r.   	_adaptersr(   r/   _subscriberslenr,   r   providedr   r_   rP   r`   )r   rC   rj   rl   rI   rU   rV   _namere   r3   r!   r   r   r   events                  r    test_registerUtility_w_componentz0ComponentsTests.test_registerUtility_w_componentj   s   >8?	> 	F|(}}++- 	>  $u=	>003D9%@GKL44T5[A!5$/	144Q7=bAG:NWq)1:bR 
5*56
5<<1DEF--56--56))U23..'9:))U23,,45#	> 	>s   II(c                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}t               fd	}| j                         }	| j                         \  }
}|
5  |	j                  d ||||
       d d d        | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |	u        | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  u        | j                  |j                  j$                  |u        | j                  |j                  j&                  |u        y # 1 sw Y   nxY w)Nr   rh   ri   rk   c                       e Zd Zy)<ComponentsTests.test_registerUtility_w_factory.<locals>.IFooNrF   r&   r   r   rI   r|      rJ   r   rI   rP   r   c                       S r   r&   re   s   r   r\   z@ComponentsTests.test_registerUtility_w_factory.<locals>._factory       Nr   r`   rp   )rR   rC   rq   rj   rr   rl   rS   r   r"   rT   r(   ru   r+   r,   r   rv   r   r_   rP   r`   )r   rC   rj   rl   rI   rU   rV   rw   r\   r3   r!   r   r   r   rx   re   s                  @r   test_registerUtility_w_factoryz.ComponentsTests.test_registerUtility_w_factory   s   >8?	> 	F|(	}}++- 	M  tUE8 L	MWq)1:bR 
5*56
5<<1DEF--56--56))U23..'9:))U23,,89	M 	Ms   G""G,c                      G d dt               }d}d} |       }| j                         }| j                  t        |j                  |d ||       y )Nc                       e Zd Zy)GComponentsTests.test_registerUtility_no_provided_available.<locals>.FooNrF   r&   r   r   rN   r      rJ   r   rN   rP   r   ra   )r   rN   rV   rw   re   r3   s         r   *test_registerUtility_no_provided_availablez:ComponentsTests.test_registerUtility_no_provided_available   sN    	& 	 %}})..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	t              } |d      }d
}d}	 |       }
 ||
|       | j                         }| j                         \  }}|5  |j                  |
d |	|       d d d        | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  |	u        | j                  |j                  j$                  |
u        | j                  |j                  j&                  |u        | j                  |j                  j(                  d u        y # 1 sw Y   nxY w)Nr   directlyProvidesrh   ri   rk   c                       e Zd Zy)>ComponentsTests.test_registerUtility_wo_provided.<locals>.IFooNrF   r&   r   r   rI   r      rJ   r   rI   c                       e Zd Zy)=ComponentsTests.test_registerUtility_wo_provided.<locals>.FooNrF   r&   r   r   rN   r      rJ   r   rN   rP   r   rp   )rR   r   rC   rq   rj   rr   rl   rS   r   r"   rT   r(   ru   r+   r,   r   rv   r   r_   rP   r`   )r   r   rC   rj   rl   rI   rN   rU   rV   rw   re   r3   r!   r   r   r   rx   s                    r    test_registerUtility_wo_providedz0ComponentsTests.test_registerUtility_wo_provided   s   @>8?	> 		& 	F|%$'}}++- 	>  $u=	>Wq)1:bR 
5*56
5<<1DEF--56--56))U23..'9:))U23,,45	> 	>s   4G55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   rh   c                       e Zd Zy)JComponentsTests.test_registerUtility_duplicates_existing_reg.<locals>.IFooNrF   r&   r   r   rI   r      rJ   r   rI   rP   r   )rR   rC   rS   r   rT   r"   r(   ru   
r   rC   rI   rU   rV   rw   re   r3   r!   r   s
             r   ,test_registerUtility_duplicates_existing_regz<ComponentsTests.test_registerUtility_duplicates_existing_reg   s    >	> 	F|(}}WdE59++- 	>  $u=	>Wq)	> 	>s   !BB#c                    ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       | j                         \  }	}
|	5  |j	                  ||||       d d d        | j                  t        |
      d       | j                  |j                  ||f   ||d f       | j                  |j                  j                  d   |   d	   |f       y # 1 sw Y   yxY w)
Nr   rh   c                       e Zd Zy)CComponentsTests.test_registerUtility_w_different_info.<locals>.IFooNrF   r&   r   r   rI   r      rJ   r   rI   info1info2r      ro   rR   rC   rS   r   rT   r"   r(   ru   r/   r.   rt   )r   rC   rI   rU   _info1_info2rw   re   r3   r!   r   s              r   %test_registerUtility_w_different_infoz5ComponentsTests.test_registerUtility_w_different_info   s    >	> 	F|(}}WdE6:++- 	?  $v>	?Wq)44dE]C!640	244Q7=cB!	%	? 	?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   rh   c                       e Zd Zy)SComponentsTests.test_registerUtility_w_different_names_same_component.<locals>.IFooNrF   r&   r   r   rI   r      rJ   r   rI   rP   name1name2rp   ro   r   r   rC   rI   rU   rV   _name1_name2
_other_regre   r3   r!   r   s               r   5test_registerUtility_w_different_names_same_componentzEComponentsTests.test_registerUtility_w_different_names_same_component   s,   >	> 	F|X
(}}Zvu=++- 	?  $>	?Wq)44dF^D$eT2	444dF^D!5$/	144Q7=cB$g/	1	? 	?s   -DD(c                    ddl m} ddlm} ddlm} ddlm}  G d d|      } |d      }d}d	}t               t               }
}	| j                         }|j                  |	|||       | j                         \  }}|5  |j                  |
|||       d d d        | j                  t        |      d
       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |	u        | j                  |j                  j&                  |u        | j                  |j                  j(                  d u        |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |
u        | j                  |j                  j&                  |u        | j                  |j                  j(                  d u        y # 1 sw Y   xY w)Nr   rh   Unregisteredri   rk   c                       e Zd Zy)HComponentsTests.test_registerUtility_replaces_existing_reg.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   rP   r   r   rp   )rR   rC   rq   r   rj   rr   rl   rS   r   rT   r"   r(   ru   r+   r,   r   rv   r   r_   rP   r`   )r   rC   r   rj   rl   rI   rU   rV   rw   _before_afterr3   r!   r   r   r   rx   s                    r   *test_registerUtility_replaces_existing_regz:ComponentsTests.test_registerUtility_replaces_existing_reg  s   >:8?	> 	F| (FH}}WdE59++- 	=  ue<	=Wq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:))U23,,451:bR 
5*56
5<<1DEF--56--56))U23..&89))U23,,451	= 	=s   =MMc                 z   ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       | j                         \  }	}
|	5  |j	                  ||||       d d d        | j                  |j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rh   c                       e Zd Zy)DComponentsTests.test_registerUtility_w_existing_subscr.<locals>.IFooNrF   r&   r   r   rI   r   <  rJ   r   rI   rP   r   r   ro   )	rR   rC   rS   r   rT   r"   r(   r.   rt   r   rC   rI   rU   rV   r   r   re   r3   r!   r   s              r   &test_registerUtility_w_existing_subscrz6ComponentsTests.test_registerUtility_w_existing_subscr9  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   rh   c                       e Zd Zy);ComponentsTests.test_registerUtility_wo_event.<locals>.IFooNrF   r&   r   r   rI   r   M  rJ   r   rI   rP   r   F)rR   rC   rS   r   r"   rT   r(   ru   r   s
             r   test_registerUtility_wo_eventz-ComponentsTests.test_registerUtility_wo_eventJ  s    >	> 	F|(}}++- 	E  $ueD	EWq)	E 	Es   BBc                     G fdd| j                                       }|j                  t               t               | j	                  t        t        |j                                     d        G d dt              }|j                  t               |       | j	                  t        t        |j                                     d       y )Nc                   &     e Zd ZdZ fdZ xZS )dComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Regr   c                     | xj                   dz  c_         t        | 
  |  | j                   dk(  rt        | j                        | _        y y )Nrp   )	reg_countsuperrT   dictr/   )r   r   CompThatChangesAfter1Reg	__class__s     r   rT   ztComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Reg.registerUtility^  sE    !#.EtL>>Q&26t7R7R2SD/ 'r   r)   rG   rH   r   rT   __classcell__)r   r   s   @r   r   r   \  s    IT Tr   r   rp   c                       e Zd Zy)PComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.IFooNrF   r&   r   r   rI   r   i  rJ   r   rI   r   r   rT   rS   r   r(   ru   listregisteredUtilities)r   r3   rI   r   s      @r   2test_registerUtility_changes_object_identity_afterzBComponentsTests.test_registerUtility_changes_object_identity_afterY  s    	Tt';';'= 	T ()VXy1T$":":"<=>B	9 	 	VXt,T$":":"<=>Br   c                 V    G fdd| j                                       }|j                  t               t               | j	                  t        t        |j                                     d        G d dt              }|j                  t               |       | j	                  t        t        |j                                     d        G d dt              }|j                  t               |       | j	                  t        t        |j                                     d	       y )
Nc                   &     e Zd ZdZ fdZ xZS )eComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Regr   c                     | xj                   dz  c_         | j                   dk(  rt        | j                        | _        t        |   |  y )Nrp   r   )r   r   r/   r   rT   )r   r   CompThatChangesAfter2Regr   s     r   rT   zuComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Reg.registerUtilityt  s@    !#>>Q&26t7R7R2SD/.EtLr   r   )r   r   s   @r   r   r   r  s    IM Mr   r   rp   c                       e Zd Zy)QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   r   c                       e Zd Zy)QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IBarNrF   r&   r   r   IBarr     rJ   r   r      r   )r   r3   rI   r   r   s       @r   3test_registerUtility_changes_object_identity_beforezCComponentsTests.test_registerUtility_changes_object_identity_beforeo  s    	Mt';';'= 	M ()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   Atest_unregisterUtility_neither_factory_nor_component_nor_providedzQComponentsTests.test_unregisterUtility_neither_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^   )rS   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   rh   c                       e Zd Zy)EComponentsTests.test_unregisterUtility_w_component_miss.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   r   )rR   rC   rS   r   r"   r   assertFalse)
r   rC   rI   rU   rw   re   r3   r!   r   unregs
             r   'test_unregisterUtility_w_component_missz7ComponentsTests.test_unregisterUtility_w_component_miss  s    >	> 	F|(}}++- 	A**7D%@E	A!	A 	As   B

Bc                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}t               }| j                         }|j                  |||       | j                         \  }	}
|	5  |j                  |||      }d d d        | j                         | j                  |j                  j                         | j                  ||f|j                  v        | j                  |j                  j                          | j#                  t%        |
      d       |
d   \  }}|\  }| j#                  |i        | j                  t'        ||             | j                  t'        |j                  |             | j                  |j                  j(                  |u        | j                  |j                  j*                  |u        | j                  |j                  j,                  |u        | j                  |j                  j.                  |u        | j                  |j                  j0                  d u        y # 1 sw Y   xY w)	Nr   rh   r   rk   c                       e Zd Zy)@ComponentsTests.test_unregisterUtility_w_component.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   r   rp   )rR   rC   rq   r   rr   rl   rS   r   rT   r"   r   r+   r   r.   rs   r/   rt   r(   ru   r,   r   rv   r   r_   r`   )r   rC   r   rl   rI   rU   rw   re   r3   r!   r   r   r   r   rx   s                  r   "test_unregisterUtility_w_componentz2ComponentsTests.test_unregisterUtility_w_component  s   >:?	> 	F|(}}WdE2++- 	A**7D%@E	A112$$*E*EEF445Wq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:,,45!	A 	As   *H==Ic                    ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}t               fd	}| j                         }	|	j                  d ||||
       | j                         \  }
}|
5  |	j                  d |||
      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |	u        | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  u        | j                  |j                  j&                  |u        y # 1 sw Y   XxY w)Nr   rh   r   rk   c                       e Zd Zy)>ComponentsTests.test_unregisterUtility_w_factory.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   rP   r   c                       S r   r&   r~   s   r   r\   zBComponentsTests.test_unregisterUtility_w_factory.<locals>._factory  r   r   r   rp   )rR   rC   rq   r   rr   rl   rS   r   rT   r"   r   r+   r(   ru   r,   r   rv   r   r_   r`   )r   rC   r   rl   rI   rU   rV   rw   r\   r3   r!   r   r   r   r   rx   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 
5,78
5<<1DEF--56--56))U23..'9:,,89	P 	Ps   5G!!G+c                 L   ddl m} ddl m} ddlm} ddlm}  G d d|      } G d d	t              } |d      }d
}d}	 |       }
 ||
|       | j                         }|j                  |
||	|       | j                         \  }}|5  |j                  |
d |	      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |	u        | j                  |j                  j&                  |
u        | j                  |j                  j(                  |u        | j                  |j                  j*                  d u        y # 1 sw Y   xY w)Nr   r   rh   r   rk   c                       e Zd Zy)IComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   c                       e Zd Zy)HComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.FooNrF   r&   r   r   rN   r     rJ   r   rN   rP   r   rp   rR   r   rC   rq   r   rr   rl   rS   r   rT   r"   r   r+   r(   ru   r,   r   rv   r   r_   rP   r`   r   r   rC   r   rl   rI   rN   rU   rV   rw   re   r3   r!   r   r   r   r   rx   s                     r   +test_unregisterUtility_wo_explicit_providedz;ComponentsTests.test_unregisterUtility_wo_explicit_provided  s   @>:?	> 		& 	F|%$'}}WdE59++- 	A**7D%@E	AWq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:))U23,,45	A 	A   HH#c                 L   ddl m} ddl m} ddlm} ddlm}  G d d|      } G d d	t              } |d      }d
}d}	 |       }
 ||
|       | j                         }|j                  |
||	|       | j                         \  }}|5  |j                  ||	      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |	u        | j                  |j                  j&                  |
u        | j                  |j                  j(                  |u        | j                  |j                  j*                  d u        y # 1 sw Y   xY w)Nr   r   rh   r   rk   c                       e Zd Zy)LComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   c                       e Zd Zy)KComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.FooNrF   r&   r   r   rN   r     rJ   r   rN   rP   r   rv   r   rp   r   r   s                     r   .test_unregisterUtility_wo_component_or_factoryz>ComponentsTests.test_unregisterUtility_wo_component_or_factory
  s   @>:?	> 		& 	F|%$'}}WdE59++- 	F**Du*EE	F 	Wq)1:bR 
5,78
5<<1DEF--56--56))U23..'9:))U23,,45	F 	Fr   c                    ddl m}  G d d|      } |d      }d}d}d}t               }| j                         }|j	                  ||||       |j	                  ||||       | j                         \  }	}
|	5  |j                  |||       d d d        | j                  |j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rh   c                       e Zd Zy)FComponentsTests.test_unregisterUtility_w_existing_subscr.<locals>.IFooNrF   r&   r   r   rI   r   0  rJ   r   rI   rP   r   r   ro   
rR   rC   rS   r   rT   r"   r   r(   r.   rt   r   s              r   (test_unregisterUtility_w_existing_subscrz8ComponentsTests.test_unregisterUtility_w_existing_subscr-  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   rh   c                       e Zd Zy)SComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable.<locals>.IFooNrF   r&   r   r   rI   r  B  rJ   r   rI   rP   r   r   ro   )
rR   rC   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   rh   )_UtilityRegistrationsc                       e Zd Zy)_ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_fresh_cache.<locals>.IFooNrF   r&   r   r   rI   r  W  rJ   r   rI   rP   r   r   ro   )rR   rC   rr   r  r   r   rT   r"   r   r(   r.   rt   )r   rC   r  rI   rU   rV   r   r   re   r3   r!   r   s               r   Atest_unregisterUtility_w_existing_subscr_non_hashable_fresh_cachezQComponentsTests.test_unregisterUtility_w_existing_subscr_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   rh   c                       e Zd Zy)]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted.<locals>.IFooNrF   r&   r   r   rI   r  l  rJ   r   rI   rP   r   r   r6   )rR   rC   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_reinittedg  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   rh   c                       e Zd Zy)VComponentsTests.test_unregisterUtility_w_existing_subscr_other_component.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   rP   r   r   ro   r   r   s               r   8test_unregisterUtility_w_existing_subscr_other_componentzHComponentsTests.test_unregisterUtility_w_existing_subscr_other_component  s    >	> 	F|X
(}}Zvu=WdFE:++- 	:""7D&9	:44Q7=bA$	(	: 	:   CCc                    ddl m}  G d d|      } |d      }d}d}d}t               }t               }| j	                         }	|	j                  ||||       |	j                  ||||       | j                         \  }
}|
5  |	j                  |||       d d d        | j                  |	j                  j                  d   |   d   |f       y # 1 sw Y   :xY w)	Nr   rh   c                       e Zd Zy)aComponentsTests.test_unregisterUtility_w_existing_subscr_other_component_mixed_hash.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   rP   r   r   ro   )rR   rC   rS   r   r   rT   r"   r   r(   r.   rt   r   s               r   Ctest_unregisterUtility_w_existing_subscr_other_component_mixed_hashzSComponentsTests.test_unregisterUtility_w_existing_subscr_other_component_mixed_hash  s    >	> 	F|X
&}}Zvu=WdFE:++- 	:""7D&9	:44Q7=bA$	(	: 	:r  c                 v    | j                         }| j                  t        |j                               g        y r   )r   r(   r   r   r:   s     r   test_registeredUtilities_emptyz.ComponentsTests.test_registeredUtilities_empty  s+    }}d66892>r   c                    ddl m} ddlm}  G d d|      } |d      }d}d}d}t	               }| j                         }	|	j                  ||||       |	j                  ||||       t        |	j                         d	 
      }
| j                  t        |
      d       | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |u        | j                  |
d   j                   |u        | j                  |
d   j"                  |u        | j                  |
d   j$                  d u        | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |u        | j                  |
d   j                   |u        | j                  |
d   j"                  |u        | j                  |
d   j$                  d u        y )Nr   rh   rk   c                       e Zd Zy)?ComponentsTests.test_registeredUtilities_notempty.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   rP   r   r   c                     | j                   S r   r   rs    r   <lambda>zCComponentsTests.test_registeredUtilities_notempty.<locals>.<lambda>  s
    qvv r   keyr   rp   )rR   rC   rr   rl   rS   r   rT   sortedr   r(   ru   r+   r,   r   rv   r   r_   rP   r`   )r   rC   rl   rI   rU   rV   r   r   re   r3   regs              r   !test_registeredUtilities_notemptyz1ComponentsTests.test_registeredUtilities_notempty  s   >?	> 	F|(}}WdFE:WdFE:T--/5EFS1%
3q6+>?@A4/0A4/0Av-.A((G34Au,-A$./
3q6+>?@A4/0A4/0Av-.A((G34Au,-A$./r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  |j	                  |      d u        y )Nr   rh   c                       e Zd Zy)?ComponentsTests.test_queryUtility_miss_no_default.<locals>.IFooNrF   r&   r   r   rI   r(    rJ   r   rI   )rR   rC   r   r+   queryUtilityr   rC   rI   rU   r3   s        r   !test_queryUtility_miss_no_defaultz1ComponentsTests.test_queryUtility_miss_no_default  sA    >	> 	F|}}))$/478r   c                     ddl m}  G d d|      } |d      }| j                         }t               }| j	                  |j                  ||      |u        y )Nr   rh   c                       e Zd Zy)>ComponentsTests.test_queryUtility_miss_w_default.<locals>.IFooNrF   r&   r   r   rI   r.    rJ   r   rI   default)rR   rC   r   rS   r+   r)  )r   rC   rI   rU   r3   _defaults         r    test_queryUtility_miss_w_defaultz0ComponentsTests.test_queryUtility_miss_w_default  sM    >	> 	F|}}8))$)AXMNr   c                     ddl m}  G d d|      } |d      }t               }| j                         }|j	                  ||       | j                  |j                  |      |u        y )Nr   rh   c                       e Zd Zy)3ComponentsTests.test_queryUtility_hit.<locals>.IFooNrF   r&   r   r   rI   r5    rJ   r   rI   )rR   rC   rS   r   rT   r+   r)  r   rC   rI   rU   re   r3   s         r   test_queryUtility_hitz%ComponentsTests.test_queryUtility_hit  sX    >	> 	F|(}}Wd+))$/7:;r   c                     ddl m} ddlm}  G d d|      } |d      }| j	                         }| j                  ||j                  |       y )Nr   rh   ComponentLookupErrorc                       e Zd Zy)2ComponentsTests.test_getUtility_miss.<locals>.IFooNrF   r&   r   r   rI   r<    rJ   r   rI   )rR   rC   rq   r:  r   rb   
getUtility)r   rC   r:  rI   rU   r3   s         r   test_getUtility_missz$ComponentsTests.test_getUtility_miss  s?    >B	> 	F|}}.Fr   c                     ddl m}  G d d|      } |d      }t               }| j                         }|j	                  ||       | j                  |j                  |      |u        y )Nr   rh   c                       e Zd Zy)1ComponentsTests.test_getUtility_hit.<locals>.IFooNrF   r&   r   r   rI   rA    rJ   r   rI   )rR   rC   rS   r   rT   r+   r=  r6  s         r   test_getUtility_hitz#ComponentsTests.test_getUtility_hit  sV    >	> 	F|(}}Wd+-89r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t	        |j                  |            g        y )Nr   rh   c                       e Zd Zy)7ComponentsTests.test_getUtilitiesFor_miss.<locals>.IFooNrF   r&   r   r   rI   rE    rJ   r   rI   )rR   rC   r   r(   r   getUtilitiesForr*  s        r   test_getUtilitiesFor_missz)ComponentsTests.test_getUtilitiesFor_miss  sE    >	> 	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   rh   c                       e Zd Zy)6ComponentsTests.test_getUtilitiesFor_hit.<locals>.IFooNrF   r&   r   r   rI   rJ    rJ   r   rI   r   r   r  )rR   rC   rS   r   rT   r(   r#  rF  r   rC   rI   rU   r   r   re   r3   s           r   test_getUtilitiesFor_hitz(ComponentsTests.test_getUtilitiesFor_hit  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   rh   c                       e Zd Zy)DComponentsTests.test_getAllUtilitiesRegisteredFor_miss.<locals>.IFooNrF   r&   r   r   rI   rO    rJ   r   rI   )rR   rC   r   r(   r   getAllUtilitiesRegisteredForr*  s        r   &test_getAllUtilitiesRegisteredFor_missz6ComponentsTests.test_getAllUtilitiesRegisteredFor_miss  sE    >	> 	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   rh   c                       e Zd Zy)CComponentsTests.test_getAllUtilitiesRegisteredFor_hit.<locals>.IFooNrF   r&   r   r   rI   rT    rJ   r   rI   r   r   r  )rR   rC   rS   r   rT   r(   r   rP  rK  s           r   %test_getAllUtilitiesRegisteredFor_hitz5ComponentsTests.test_getAllUtilitiesRegisteredFor_hit  s    >	> 	F|(}}Wd8Wd8d??EF!	$r   c                    ddl m}m}  G d d|      } |d      } |d      } |d       G d dt                     }d	}| j	                         }|j                  ||f||
       | j                  |j                  |f|df   ||f       y )Nr   rA   c                       e Zd Zy)FComponentsTests.test_registerAdapter_with_component_name.<locals>.IFooNrF   r&   r   r   rI   rX  /  rJ   r   rI   r   rK   c                       e Zd Zy)EComponentsTests.test_registerAdapter_with_component_name.<locals>.FooNrF   r&   r   r   rN   rZ  4  rO   r   rN   rP   rQ   )rR   rB   rC   rS   r   registerAdapterr(   r0   )	r   rB   rC   rI   rU   ibarrN   rV   r3   s	            r   (test_registerAdapter_with_component_namez8ComponentsTests.test_registerAdapter_with_component_name+  s    E	> 	F|F|	v	& 	 
	}}S4'4e<''v(=>%L	r   c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d}d	}d
 }	| j                         }
| j                         \  }}|5  |
j                  |	|f|||       d d d        | j                  |
j                  j                  d   |   |   |   |	u        | j                  |
j                  |f||f   |	|f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |
u        | j                  |j                   j$                  |u        | j                  |j                   j&                  |f       | j                  |j                   j(                  |u        | j                  |j                   j*                  |u        | j                  |j                   j,                  |	u        y # 1 sw Y   xY w)Nr   rh   ri   AdapterRegistrationc                       e Zd Zy)SComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>.IFooNrF   r&   r   r   rI   rb  E  rJ   r   rI   r   rP   r   c                     t               r   rZ   contexts    r   r\   zWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>._factoryL  r]   r   rp   )rR   rC   rq   rj   rr   r`  r   r"   r[  r+   r-   rs   r(   r0   ru   r,   rS   r   rv   requiredr   rP   r`   )r   rC   rj   r`  rI   rU   r\  rV   rw   r\   r3   r!   r   r   r   rx   s                   r   5test_registerAdapter_w_explicit_provided_and_requiredzEComponentsTests.test_registerAdapter_w_explicit_provided_and_required@  s   >8?	> 	F|F|	(}}++- 	H  D7D%G	H//248>uE#$ 	%44dWdE5IJ"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..8))U23))U23,,89#	H 	Hs   H55H?c                     ddl m}  G d d|      } |d      }d}d} G d d	t              }| j                         }| j	                  t
        |j                  ||f||
       y )Nr   rh   c                       e Zd Zy)HComponentsTests.test_registerAdapter_no_provided_available.<locals>.IFooNrF   r&   r   r   rI   rj  f  rJ   r   rI   r   rP   r   c                       e Zd Zy)LComponentsTests.test_registerAdapter_no_provided_available.<locals>._FactoryNrF   r&   r   r   _Factoryrl  m  rJ   r   rm  r   rP   rR   rC   rS   r   rb   rc   r[  )r   rC   rI   r\  rV   rw   rm  r3   s           r   *test_registerAdapter_no_provided_availablez:ComponentsTests.test_registerAdapter_no_provided_availablec  sg    >	> 	 F|	v 	 }})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
}	t               }
 ||       G d dt                     }| j                         }| j                         \  }}|5  |j                  ||f|	|       d d d        | j                  |j                  j                  d   |   |   |	   |u        | j                  |j                  |f||	f   ||f       | j                  t!        |      d       |d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j                  |             | j                  |j                  j$                  |u        | j                  |j                  j&                  |u        | j                  |j                  j(                  |f       | j                  |j                  j*                  |	u        | j                  |j                  j,                  |u        | j                  |j                  j.                  |u        y # 1 sw Y   xY w)Nr   rh   implementerri   r_  c                       e Zd Zy)GComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   ru  z  rJ   r   rI   r   rP   r   c                       e Zd Zy)KComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>._FactoryNrF   r&   r   r   rm  rw    rO   r   rm  rn  rp   )rR   rC   rs  rq   rj   rr   r`  rS   r   r"   r[  r+   r-   rs   r(   r0   ru   r,   r   rv   rf  r   rP   r`   )r   rC   rs  rj   r`  rI   rU   r\  rV   rw   re   rm  r3   r!   r   r   r   rx   s                     r   )test_registerAdapter_wo_explicit_providedz9ComponentsTests.test_registerAdapter_wo_explicit_providedt  s   >;8?	> 	F|F|(	T		v 	 
	 }}++- 	L  D7U K	L//248>uE#$ 	%44dWdE5IJ"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..8))U23))U23,,89#	L 	Ls   II&c                     ddl m}  G d d|      } |d      }d}d} G d dt              }| j                         }| j	                  t
        |j                  ||||	       y )
Nr   rh   c                       e Zd Zy)HComponentsTests.test_registerAdapter_no_required_available.<locals>.IFooNrF   r&   r   r   rI   r{    rJ   r   rI   rP   r   c                       e Zd Zy)LComponentsTests.test_registerAdapter_no_required_available.<locals>._FactoryNrF   r&   r   r   rm  r}    s    r   rm  rv   r   rP   ro  r   rC   rI   rU   rV   rw   rm  r3   s           r   *test_registerAdapter_no_required_availablez:ComponentsTests.test_registerAdapter_no_required_available  sd    >	> 	F|	v 	 }})T%9%98#'e% 	 	Ar   c           	          ddl m}  G d d|      } |d      } |d      }d}d} G d d	t              }| j                         }| j	                  t
        |j                  |||||
       y )Nr   rh   c                       e Zd Zy)EComponentsTests.test_registerAdapter_w_invalid_required.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   rP   r   c                       e Zd Zy)IComponentsTests.test_registerAdapter_w_invalid_required.<locals>._FactoryNrF   r&   r   r   rm  r    rJ   r   rm  r~  ro  )	r   rC   rI   rU   r\  rV   rw   rm  r3   s	            r   'test_registerAdapter_w_invalid_requiredz7ComponentsTests.test_registerAdapter_w_invalid_required  sm    >	> 	F|F|	v 	}})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t              }	| j                         }
| j                         \  }}|5  |
j                  |	d g|||       d d d        | j                  |
j                  j                  d   |   |   |   |	u        | j                  |
j                   |f||f   |	|f       | j                  t#        |      d       |d   \  }}|\  }| j                  |i        | j                  t%        ||             | j                  t%        |j                  |             | j                  |j                  j&                  |
u        | j                  |j                  j(                  |u        | j                  |j                  j*                  |f       | j                  |j                  j,                  |u        | j                  |j                  j.                  |u        | j                  |j                  j0                  |	u        y # 1 sw Y   xY w)Nr   rh   r   ri   r_  c                       e Zd Zy)MComponentsTests.test_registerAdapter_w_required_containing_None.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   rP   r   c                       e Zd Zy)QComponentsTests.test_registerAdapter_w_required_containing_None.<locals>._FactoryNrF   r&   r   r   rm  r    rJ   r   rm  r~  rp   )rR   rC   zope.interface.interfacer   rq   rj   rr   r`  rS   r   r"   r[  r+   r-   rs   r(   r0   ru   r,   r   rv   rf  r   rP   r`   )r   rC   r   rj   r`  rI   rU   rV   rw   rm  r3   r!   r   r   r   rx   s                   r   /test_registerAdapter_w_required_containing_Nonez?ComponentsTests.test_registerAdapter_w_required_containing_None  s   >68?	> 	F|	v 	}}++- 	9  D6D&+% ! 9	9 	//29=dCEJ#$ 	%44i\45NO"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..=))U23))U23,,89%	9 	9s   $I  I
c                    ddl m} ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d	      }d
}	d}
 G d dt              } ||       G d dt                     } ||      }| j                         }| j                         \  }}|5  |j                  ||g||
|	       d d d        | j                  |j                  j                  d   |   |   |
   |u        | j                  |j                   |f||
f   ||	f       | j                  t#        |      d       |d   \  }}|\  }| j                  |i        | j                  t%        ||             | j                  t%        |j                  |             | j                  |j                  j&                  |u        | j                  |j                  j(                  |u        | j                  |j                  j*                  |f       | j                  |j                  j,                  |
u        | j                  |j                  j.                  |	u        | j                  |j                  j0                  |u        y # 1 sw Y   xY w)Nr   rh   rr  )implementedByri   r_  c                       e Zd Zy)NComponentsTests.test_registerAdapter_w_required_containing_class.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   rP   r   c                       e Zd Zy)RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._FactoryNrF   r&   r   r   rm  r    rJ   r   rm  c                       e Zd Zy)RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._ContextNrF   r&   r   r   _Contextr    rO   r   r  r~  rp   )rR   rC   rs  r  rq   rj   rr   r`  rS   r   r"   r[  r+   r-   rs   r(   r0   ru   r,   r   rv   rf  r   rP   r`   )r   rC   rs  r  rj   r`  rI   rU   r\  rV   rw   rm  r  	_ctx_implr3   r!   r   r   r   rx   s                       r   0test_registerAdapter_w_required_containing_classz@ComponentsTests.test_registerAdapter_w_required_containing_class  s-   >;=8?	> 	F|F|	v 	 
T		v 	 
	!(+	}}++- 	9  H:&+% ! 9	9 	//29=dCEJ#$ 	%44i\45NO"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..=))U23))U23,,89%	9 	9s   I00I:c           	          ddl m}  G d d|      } |d      }d}d} G d dt              }| j                         }| j	                  t
        |j                  |t               g|||	       y )
Nr   rh   c                       e Zd Zy)MComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>.IFooNrF   r&   r   r   rI   r  
  rJ   r   rI   rP   r   c                       e Zd Zy)QComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>._FactoryNrF   r&   r   r   rm  r    rJ   r   rm  r~  ro  r  s           r   /test_registerAdapter_w_required_containing_junkz?ComponentsTests.test_registerAdapter_w_required_containing_junk  sh    >	> 	F|	v 	}})T%9%98fhZ#'e% 	 	Ar   c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      d}d	} G fd
dt              }| j                         }	| j                         \  }
}|
5  |	j                  ||||       d d d        | j                  |	j                  j                  d      |   |   |u        | j                  |	j                  f||f   ||f       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t!        ||             | j                  t!        |j                  |             | j                  |j                  j"                  |	u        | j                  |j                  j$                  |u        | j                  |j                  j&                  f       | j                  |j                  j(                  |u        | j                  |j                  j*                  |u        | j                  |j                  j,                  |u        y # 1 sw Y   xY w)Nr   rh   ri   r_  c                       e Zd Zy)GComponentsTests.test_registerAdapter_wo_explicit_required.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   rP   r   c                       e Zd ZW  fZy)KComponentsTests.test_registerAdapter_wo_explicit_required.<locals>._FactoryNr)   rG   rH   __component_adapts__r\  s   r   rm  r  !      $(7 r   rm  r~  rp   )rR   rC   rq   rj   rr   r`  rS   r   r"   r[  r+   r-   rs   r(   r0   ru   r,   r   rv   rf  r   rP   r`   )r   rC   rj   r`  rI   rU   rV   rw   rm  r3   r!   r   r   r   rx   r\  s                  @r   )test_registerAdapter_wo_explicit_requiredz9ComponentsTests.test_registerAdapter_wo_explicit_required  s   >8?	> 	F|F|	+v 	+ }}++- 	-  Du&+ ! -	- 	//248>uE#$ 	%44dWdE5IJ"E*	,Wq)1:bR 
5*56
5<<1DEF--56--56..8))U23))U23,,89%	- 	-s   )IIc           	      .   ddl m}  G d d|      } |d      } |d      }d}d}d }| j                         }| j                         \  }	}
|	5  |j	                  ||f|||d	
       d d d        | j                  t        |
      d       y # 1 sw Y   %xY w)Nr   rh   c                       e Zd Zy);ComponentsTests.test_registerAdapter_wo_event.<locals>.IFooNrF   r&   r   r   rI   r  =  rJ   r   rI   r   rP   r   c                     t               r   rZ   rd  s    r   r\   z?ComponentsTests.test_registerAdapter_wo_event.<locals>._factoryD  r]   r   F)rx   )rR   rC   r   r"   r[  r(   ru   )r   rC   rI   rU   r\  rV   rw   r\   r3   r!   r   s              r   test_registerAdapter_wo_eventz-ComponentsTests.test_registerAdapter_wo_event:  s    >	> 	F|F|	(}}++- 	.  D7D%', ! .	. 	Wq)	. 	.s   BBc                 j    | j                         }| j                  t        |j                  d d        y N)r`   rv   )r   rb   rc   unregisterAdapterr:   s     r   3test_unregisterAdapter_neither_factory_nor_providedzCComponentsTests.test_unregisterAdapter_neither_factory_nor_providedM  s/    }})T%;%;"& 	 	7r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t        |j
                  d |d        y )Nr   rh   c                       e Zd Zy)QComponentsTests.test_unregisterAdapter_neither_factory_nor_required.<locals>.IFooNrF   r&   r   r   rI   r  T  rJ   r   rI   r`   rv   rf  )rR   rC   r   rb   rc   r  r*  s        r   3test_unregisterAdapter_neither_factory_nor_requiredzCComponentsTests.test_unregisterAdapter_neither_factory_nor_requiredR  sJ    >	> 	F|}})T%;%;"& 	 	Fr   c                 "   ddl m}  G d d|      } |d      } |d      } G d dt              }| j                         }| j	                         \  }}|5  |j                  ||f|      }	d d d        | j                  	       y # 1 sw Y   xY w)Nr   rh   c                       e Zd Zy)9ComponentsTests.test_unregisterAdapter_miss.<locals>.IFooNrF   r&   r   r   rI   r  ]  rJ   r   rI   r   c                       e Zd Zy)=ComponentsTests.test_unregisterAdapter_miss.<locals>._FactoryNrF   r&   r   r   rm  r  a  rJ   r   rm  )rR   rC   rS   r   r"   r  r   
r   rC   rI   rU   r\  rm  r3   r!   r   r   s
             r   test_unregisterAdapter_missz+ComponentsTests.test_unregisterAdapter_miss[  s    >	> 	F|F|	v 	 }}++- 	D**8dWdCE	D	D 	Ds   BBc                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } G d d	t              }| j                         }|j                  ||f|       | j                         \  }	}
|	5  |j                  ||f|      }d d d        | j                         | j                  |j                  j                         | j                  |j                         | j!                  t#        |
      d
       |
d   \  }}|\  }| j!                  |i        | j                  t%        ||             | j                  t%        |j                  |             | j                  |j                  j&                  |u        | j                  |j                  j(                  |u        | j!                  |j                  j*                  |f       | j!                  |j                  j,                  d       | j!                  |j                  j.                  d       | j                  |j                  j0                  |u        y # 1 sw Y   xY w)Nr   rh   r   r_  c                       e Zd Zy)YComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>.IFooNrF   r&   r   r   rI   r  n  rJ   r   rI   r   c                       e Zd Zy)]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>._FactoryNrF   r&   r   r   rm  r  r  rJ   r   rm  rp   ro   )rR   rC   rq   r   rr   r`  rS   r   r[  r"   r  r+   r   r-   rs   r0   r(   ru   r,   r   rv   rf  r   rP   r`   )r   rC   r   r`  rI   rU   r\  rm  r3   r!   r   r   r   r   rx   s                  r   ;test_unregisterAdapter_hit_w_explicit_provided_and_requiredzKComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_requiredj  s   >:?	> 	F|F|	v 	 }}Xw5++- 	D**8dWdCE	D001445Wq)1:bR 
5,78
5<<1DEF--56--56..8**B/**B/,,89!	D 	D   6IIc                 F   ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } ||       G d	 d
t                     }| j                         }	|	j                  ||f|       | j                         \  }
}|
5  |	j                  ||f      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |	u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |f       | j                  |j                  j&                  d       | j                  |j                  j(                  d       | j                  |j                  j*                  |u        y # 1 sw Y   }xY w)Nr   rh   rr  r   r_  c                       e Zd Zy)IComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd Zy)MComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>._FactoryNrF   r&   r   r   rm  r    rO   r   rm  rp   ro   )rR   rC   rs  rq   r   rr   r`  rS   r   r[  r"   r  r+   r(   ru   r,   r   rv   rf  r   rP   r`   )r   rC   rs  r   r`  rI   rU   r\  rm  r3   r!   r   r   r   r   rx   s                   r   +test_unregisterAdapter_wo_explicit_providedz;ComponentsTests.test_unregisterAdapter_wo_explicit_provided  s   >;:?	> 	F|F|	T		v 	 
	 }}Xw5++- 	>**8dW=E	>Wq)1:bR 
5,78
5<<1DEF--56--56..8**B/**B/,,89	> 	>   HH c                 *   ddl m} ddlm} ddlm}  G d d|      } |d      } |d       G fdd	t              }| j                         }|j                  |f|       | j                         \  }}	|5  |j                  ||
      }
d d d        | j                  
       | j                  t        |	      d       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  f       | j                  |j                  j$                  d       | j                  |j                  j&                  d       | j                  |j                  j(                  |u        y # 1 sw Y   }xY w)Nr   rh   r   r_  c                       e Zd Zy)IComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd ZW  fZy)MComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rm  r    r  r   rm  rv   rp   ro   )rR   rC   rq   r   rr   r`  rS   r   r[  r"   r  r+   r(   ru   r,   r   rv   rf  r   rP   r`   )r   rC   r   r`  rI   rU   rm  r3   r!   r   r   r   r   rx   r\  s                 @r   +test_unregisterAdapter_wo_explicit_requiredz;ComponentsTests.test_unregisterAdapter_wo_explicit_required  s   >:?	> 	F|F|	+v 	+ }}Xw5++- 	D**8d*CE	DWq)1:bR 
5,78
5<<1DEF--56--56..8**B/**B/,,89	D 	D   9HHc                 v    | j                         }| j                  t        |j                               g        y r   )r   r(   r   registeredAdaptersr:   s     r   test_registeredAdapters_emptyz-ComponentsTests.test_registeredAdapters_empty  s+    }}d5578"=r   c                    ddl m} ddlm}  G d d|      } |d      } |d      }d}d}d} G d	 d
t              }	| j                         }
|
j                  |	|f|||       |
j                  |	|f|||       t        |
j                         d       }| j                  t        |      d       | j                  t        |d   |             | j                  |d   j                  |
u        | j                  |d   j                  |u        | j                  |d   j                  |f       | j                  |d   j                   |u        | j                  |d   j"                  |u        | j                  |d   j$                  |	u        | j                  t        |d   |             | j                  |d   j                  |
u        | j                  |d   j                  |u        | j                  |d   j                  |f       | j                  |d   j                   |u        | j                  |d   j"                  |u        | j                  |d   j$                  |	u        y )Nr   rh   r_  c                       e Zd Zy)>ComponentsTests.test_registeredAdapters_notempty.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   rP   r   r   c                       e Zd Zy)BComponentsTests.test_registeredAdapters_notempty.<locals>._FactoryNrF   r&   r   r   rm  r    rJ   r   rm  c                     | j                   S r   r  r  s    r   r   zBComponentsTests.test_registeredAdapters_notempty.<locals>.<lambda>  s
    aff r   r!  r   rp   )rR   rC   rr   r`  rS   r   r[  r#  r  r(   ru   r+   r,   r   rv   rf  r   rP   r`   )r   rC   r`  rI   rU   r\  rV   r   r   rm  r3   r$  s               r    test_registeredAdapters_notemptyz0ComponentsTests.test_registeredAdapters_notempty  s   >?	> 	F|F|	v 	 }}XwfeDXwfeDT,,.4DES1%
3q6+>?@A4/0A4/0Q4'2Av-.Au,-A(23
3q6+>?@A4/0A4/0Q4'2Av-.Au,-A(23r   c                     ddl m}  G d d|      } |d      }| j                         }t               }| j	                  |j                  ||      d u        y )Nr   rh   c                       e Zd Zy)?ComponentsTests.test_queryAdapter_miss_no_default.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   rR   rC   r   rS   r+   queryAdapter)r   rC   rI   rU   r3   _contexts         r   !test_queryAdapter_miss_no_defaultz1ComponentsTests.test_queryAdapter_miss_no_default  sJ    >	> 	F|}}8))(D9TABr   c                     ddl m}  G d d|      } |d      }| j                         }t               }t               }| j	                  |j                  |||      |u        y )Nr   rh   c                       e Zd Zy)>ComponentsTests.test_queryAdapter_miss_w_default.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r/  r  )r   rC   rI   rU   r3   r  r1  s          r    test_queryAdapter_miss_w_defaultz0ComponentsTests.test_queryAdapter_miss_w_default  sZ    >	> 	F|}}88hh?8K	Mr   c                    ddl m} ddl m}  G d d|      } |d      } |d      } G d dt              } ||       G d	 d
t                     } |       }| j	                         }	|	j                  ||f|       |	j                  ||      }
| j                  t        |
|             | j                  |
j                  |u        y )Nr   rh   rr  c                       e Zd Zy)3ComponentsTests.test_queryAdapter_hit.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd Zd Zy)7ComponentsTests.test_queryAdapter_hit.<locals>._Factoryc                     || _         y r   rd  r   re  s     r   r  z@ComponentsTests.test_queryAdapter_hit.<locals>._Factory.__init__
  	    &r   Nr)   rG   rH   r  r&   r   r   rm  r  	      'r   rm  c                       e Zd Zy)7ComponentsTests.test_queryAdapter_hit.<locals>._ContextNrF   r&   r   r   r  r    rO   r   r  )
rR   rC   rs  rS   r   r[  r  r+   r,   re  r   rC   rs  rI   rU   r\  rm  r  r  r3   adapters              r   test_queryAdapter_hitz%ComponentsTests.test_queryAdapter_hit  s    >;	> 	F|F|	'v 	' 
T		v 	 
	:}}Xw5##Hd3
7H56834r   c                     ddl m} ddl m} ddlm}  G d d|      } |d      } |d      } ||       G d d	t
                     } |       }| j                         }	| j                  ||	j                  ||       y )
Nr   rh   rr  r9  c                       e Zd Zy)2ComponentsTests.test_getAdapter_miss.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd Zy)6ComponentsTests.test_getAdapter_miss.<locals>._ContextNrF   r&   r   r   r  r    rO   r   r  )	rR   rC   rs  rq   r:  rS   r   rb   
getAdapter)
r   rC   rs  r:  rI   rU   r\  r  r  r3   s
             r   test_getAdapter_missz$ComponentsTests.test_getAdapter_miss  su    >;B	> 	F|F|	T		v 	 
	:}}.//8T	;r   c                 z   ddl m} ddl m}  G d d|      } |d      } |d      } G d dt              } ||       G d	 d
t                     } |       }| j	                         }	|	j                  ||f|       |	j                  ||      }
| j                  |
|       | j                  |
j                  |       y )Nr   rh   rr  c                       e Zd Zy)1ComponentsTests.test_getAdapter_hit.<locals>.IFooNrF   r&   r   r   rI   r  )  rJ   r   rI   r   c                       e Zd Zd Zy)5ComponentsTests.test_getAdapter_hit.<locals>._Factoryc                     || _         y r   rd  r  s     r   r  z>ComponentsTests.test_getAdapter_hit.<locals>._Factory.__init__.  r  r   Nr  r&   r   r   rm  r  -  r  r   rm  c                       e Zd Zy)5ComponentsTests.test_getAdapter_hit.<locals>._ContextNrF   r&   r   r   r  r  0  rO   r   r  )
rR   rC   rs  rS   r   r[  r  assertIsInstanceassertIsre  r  s              r   test_getAdapter_hitz#ComponentsTests.test_getAdapter_hit&  s    >;	> 	F|F|	'v 	' 
T		v 	 
	:}}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t                     } ||       G d d|             } G d dt              } G d dt              }	| j                         }
|
j                  |	|f|       |
j                  ||f|       | j                  |
        |       }|
j                  ||      }| j                  ||	       | j                  |j                  |       t        ||      }|
j                  ||      }| j                  ||       | j                  |j                  |       y )Nr   r   rr  c                       e Zd Zy)8ComponentsTests.test_getAdapter_hit_super.<locals>.IBaseNrF   r&   r   r   IBaser  >  rJ   r   r  c                       e Zd Zy);ComponentsTests.test_getAdapter_hit_super.<locals>.IDerivedNrF   r&   r   r   IDerivedr  A  rJ   r   r  c                       e Zd Zy)7ComponentsTests.test_getAdapter_hit_super.<locals>.IFooNrF   r&   r   r   rI   r  D  rJ   r   rI   c                       e Zd Zy)7ComponentsTests.test_getAdapter_hit_super.<locals>.BaseNrF   r&   r   r   Baser  G  rO   r   r  c                       e Zd Zy):ComponentsTests.test_getAdapter_hit_super.<locals>.DerivedNrF   r&   r   r   Derivedr  K  rO   r   r  c                       e Zd Zd Zy)>ComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBasec                     || _         y r   rd  r  s     r   r  zGComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBase.__init__P  r  r   Nr  r&   r   r   AdapterBaser  O  r  r   r  c                       e Zd Zd Zy)AComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerivedc                     || _         y r   rd  r  s     r   r  zJComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerived.__init__T  r  r   Nr  r&   r   r   AdapterDerivedr  S  r  r   r   r   r   rR   rs  rS   r   r[  _should_not_changer  r  r  re  r   r   r   rs  r  r  rI   r  r  r  r   r3   derivedr  super   s                 r   test_getAdapter_hit_superz)ComponentsTests.test_getAdapter_hit_super:  s?   ,;	I 		u 		9 	 
U		6 	 
	 
X		d 	 
		'& 	'	'V 	' }}^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t              } G d d|      } ||       G d d|             } ||       G d d||             }	 G d dt              }
 G d dt              }| j                         }|j                  ||f|       |j                  |
|f|       | j                  |        |	       }|j                  ||      }| j                  ||       | j                  |j                  |       t        |	|      }|j                  ||      }| j                  ||
       | j                  |j                  |       y )Nr   r   rr  c                       e Zd Zy)aComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.IBaseNrF   r&   r   r   r  r)  j  rJ   r   r  c                       e Zd Zy)dComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.IDerivedNrF   r&   r   r   r  r+  m  rJ   r   r  c                       e Zd Zy)`ComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.IFooNrF   r&   r   r   rI   r-  p  rJ   r   rI   c                       e Zd Zy)`ComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.BaseNrF   r&   r   r   r  r/  s  rJ   r   r  c                       e Zd Zy)bComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.Child1NrF   r&   r   r   Child1r1  v  rJ   r   r2  c                       e Zd Zy)bComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.Child2NrF   r&   r   r   Child2r4  y  rO   r   r5  c                       e Zd Zy)cComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.DerivedNrF   r&   r   r   r  r7  }  rO   r   r  c                       e Zd Zd Zy)gComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.AdapterBasec                     || _         y r   rd  r  s     r   r  zpComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.AdapterBase.__init__  r  r   Nr  r&   r   r   r  r9    r  r   r  c                       e Zd Zd Zy)jComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.AdapterDerivedc                     || _         y r   rd  r  s     r   r  zsComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond.<locals>.AdapterDerived.__init__  r  r   Nr  r&   r   r   r   r<    r  r   r   r!  )r   r   rs  r  r  rI   r  r2  r5  r  r  r   r3   r$  r  r%  r   s                   r   Btest_getAdapter_hit_super_when_parent_implements_interface_diamondzRComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamondf  sY   ,;	I 		u 		9 		6 		T 	 
U		T 	 
	 
X		ff 	 
		'& 	'	'V 	' }}^h[$?[5(D9%)//'40g~6goow/Wg&//$-g{3goow/r   c                 N   ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	t                     } ||       G d
 dt                     } |       }	 |       }
| j	                         }| j                  |j                  |	|
f|      d        y )Nr   rh   rr  c                       e Zd Zy)9ComponentsTests.test_queryMultiAdapter_miss.<locals>.IFooNrF   r&   r   r   rI   rA    rJ   r   rI   r   IBazc                       e Zd Zy)>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context1NrF   r&   r   r   	_Context1rD    rO   r   rE  c                       e Zd Zy)>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context2NrF   r&   r   r   	_Context2rG    rO   r   rH  )rR   rC   rs  rS   r   r(   queryMultiAdapterr   rC   rs  rI   rU   r\  ibazrE  rH  	_context1	_context2r3   s               r   test_queryMultiAdapter_missz+ComponentsTests.test_queryMultiAdapter_miss  s    >;	> 	F|F|F|	T		 	 
		T		 	 
	K	K	}}//I0FM	r   c                 h   ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	t                     } ||       G d
 dt                     } |       }	 |       }
t               }| j	                         }| j                  |j                  |	|
f||      |u        y )Nr   rh   rr  c                       e Zd Zy)CComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>.IFooNrF   r&   r   r   rI   rQ    rJ   r   rI   r   rB  c                       e Zd Zy)HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context1NrF   r&   r   r   rE  rS    rO   r   rE  c                       e Zd Zy)HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context2NrF   r&   r   r   rH  rU    rO   r   rH  r/  )rR   rC   rs  rS   r   r+   rI  )r   rC   rs  rI   rU   r\  rK  rE  rH  rL  rM  r1  r3   s                r   %test_queryMultiAdapter_miss_w_defaultz5ComponentsTests.test_queryMultiAdapter_miss_w_default  s    >;	> 	F|F|F|	T		 	 
		T		 	 
	K	K	8}}""Iy#94+3 # 58@A	Br   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	t                     } ||       G d
 dt                     } |       }	 |       }
 G d dt              }| j	                         }|j                  |||f|       |j                  |	|
f|      }| j                  t        ||             | j                  |j                  |	|
f       y )Nr   rh   rr  c                       e Zd Zy)8ComponentsTests.test_queryMultiAdapter_hit.<locals>.IFooNrF   r&   r   r   rI   rY    rJ   r   rI   r   rB  c                       e Zd Zy)=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context1NrF   r&   r   r   rE  r[    rO   r   rE  c                       e Zd Zy)=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context2NrF   r&   r   r   rH  r]    rO   r   rH  c                       e Zd Zd Zy)<ComponentsTests.test_queryMultiAdapter_hit.<locals>._Factoryc                     ||f| _         y r   rd  r   context1context2s      r   r  zEComponentsTests.test_queryMultiAdapter_hit.<locals>._Factory.__init__      '1r   Nr  r&   r   r   rm  r_        2r   rm  )rR   rC   rs  rS   r   r[  rI  r+   r,   r(   re  r   rC   rs  rI   rU   r\  rK  rE  rH  rL  rM  rm  r3   r  s                 r   test_queryMultiAdapter_hitz*ComponentsTests.test_queryMultiAdapter_hit  s    >;	> 	F|F|F|	T		 	 
		T		 	 
	K	K		2v 	2 }}Xd|T:(()Y)?F
7H569i*@Ar   c                 R   ddl m} ddl m} ddlm}  G d d|      } |d      } |d      } |d      } ||       G d	 d
t
                     } ||       G d dt
                     }	 |       }
 |	       }| j                         }| j                  ||j                  |
|f|       y )Nr   rh   rr  r9  c                       e Zd Zy)7ComponentsTests.test_getMultiAdapter_miss.<locals>.IFooNrF   r&   r   r   rI   rj    rJ   r   rI   r   rB  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context1NrF   r&   r   r   rE  rl    rO   r   rE  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context2NrF   r&   r   r   rH  rn    rO   r   rH  )	rR   rC   rs  rq   r:  rS   r   rb   getMultiAdapter)r   rC   rs  r:  rI   rU   r\  rK  rE  rH  rL  rM  r3   s                r   test_getMultiAdapter_missz)ComponentsTests.test_getMultiAdapter_miss  s    >;B	> 	F|F|F|	T		 	 
		T		 	 
	K	K	}}...I0F	Nr   c                    ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	t                     } ||       G d
 dt                     } |       }	 |       }
 G d dt              }| j	                         }|j                  |||f|       |j                  |	|
f|      }| j                  t        ||             | j                  |j                  |	|
f       y )Nr   rh   rr  c                       e Zd Zy)6ComponentsTests.test_getMultiAdapter_hit.<locals>.IFooNrF   r&   r   r   rI   rs    rJ   r   rI   r   rB  c                       e Zd Zy);ComponentsTests.test_getMultiAdapter_hit.<locals>._Context1NrF   r&   r   r   rE  ru    rO   r   rE  c                       e Zd Zy);ComponentsTests.test_getMultiAdapter_hit.<locals>._Context2NrF   r&   r   r   rH  rw    rO   r   rH  c                       e Zd Zd Zy):ComponentsTests.test_getMultiAdapter_hit.<locals>._Factoryc                     ||f| _         y r   rd  ra  s      r   r  zCComponentsTests.test_getMultiAdapter_hit.<locals>._Factory.__init__  rd  r   Nr  r&   r   r   rm  ry     re  r   rm  )rR   rC   rs  rS   r   r[  ro  r+   r,   r(   re  rf  s                 r   test_getMultiAdapter_hitz(ComponentsTests.test_getMultiAdapter_hit  s    >;	> 	F|F|F|	T		 	 
		T		 	 
	K	K		2v 	2 }}Xd|T:&&	9'=tD
7H569i*@Ar   c                 v      fd}||_         ||j                  _         ||j                  j                  _         y )Nc                  (    j                  d       y )NzNothing should get changed)fail)r   r   s    r   
no_changesz6ComponentsTests._should_not_change.<locals>.no_changes  s    II23r   )changedr-   	_v_lookup)r   r3   r  s   `  r   r"  z"ComponentsTests._should_not_change	  s-    	4! **4'r   c                 L   ddl m} ddlm}  G d d|      } G d d|      } G d d	|      } ||       G d
 dt                     } ||       G d d|             } G d dt              } 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   rr  c                       e Zd Zy)=ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IBaseNrF   r&   r   r   r  r    rJ   r   r  c                       e Zd Zy)@ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IDerivedNrF   r&   r   r   r  r    rJ   r   r  c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   c                       e Zd Zy)<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.BaseNrF   r&   r   r   r  r     rO   r   r  c                       e Zd Zy)?ComponentsTests.test_getMultiAdapter_hit_super.<locals>.DerivedNrF   r&   r   r   r  r  $  rO   r   r  c                       e Zd Zd Zy)CComponentsTests.test_getMultiAdapter_hit_super.<locals>.AdapterBasec                      || _         || _        y r   )rb  rc  ra  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>.AdapterDerivedNrF   r&   r   r   r   r  -  rJ   r   r   )r   r   rR   rs  rS   r   r[  r"  ro  r  r  rb  rc  r   assertNotIsInstancer#  s                 r   test_getMultiAdapter_hit_superz.ComponentsTests.test_getMultiAdapter_hit_super  s   ,;	I 		u 		9 	 
U		6 	 
	 
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                 `   ddl m} ddl m}  G d d|      } |d      } |d      } |d      } ||       G d d	t                     } ||       G d
 dt                     } |       }	 |       }
| j	                         }| j                  t        |j                  |	|
f|            g        y )Nr   rh   rr  c                       e Zd Zy)4ComponentsTests.test_getAdapters_empty.<locals>.IFooNrF   r&   r   r   rI   r  E  rJ   r   rI   r   rB  c                       e Zd Zy)9ComponentsTests.test_getAdapters_empty.<locals>._Context1NrF   r&   r   r   rE  r  J  rO   r   rE  c                       e Zd Zy)9ComponentsTests.test_getAdapters_empty.<locals>._Context2NrF   r&   r   r   rH  r  M  rO   r   rH  )rR   rC   rs  rS   r   r(   r   getAdaptersrJ  s               r   test_getAdapters_emptyz&ComponentsTests.test_getAdapters_emptyB  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	t                     } ||       G d
 dt                     } |       }	 |       }
| j	                         }g fd}|j                  |||f|       | j                  t        |j                  |	|
f|            g        | j                  |	|
fg       y )Nr   rh   rr  c                       e Zd Zy)CComponentsTests.test_getAdapters_factory_returns_None.<locals>.IFooNrF   r&   r   r   rI   r  Y  rJ   r   rI   r   rB  c                       e Zd Zy)HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context1NrF   r&   r   r   rE  r  ^  rO   r   rE  c                       e Zd Zy)HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context2NrF   r&   r   r   rH  r  a  rO   r   rH  c                 ,    j                  | |f       y r   r   )rb  rc  _called_withs     r   _side_effect_onlyzPComponentsTests.test_getAdapters_factory_returns_None.<locals>._side_effect_onlyh  s    8 45r   )	rR   rC   rs  rS   r   r[  r(   r   r  )r   rC   rs  rI   rU   r\  rK  rE  rH  rL  rM  r3   r  r  s                @r   %test_getAdapters_factory_returns_Nonez5ComponentsTests.test_getAdapters_factory_returns_NoneV  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	t                     } ||       G d
 dt                     } |       }	 |       }
 G d dt              } G d dt              }d}d}| j	                         }|j                  |||f||       |j                  |||f||       t        |j                  |	|
f|            }| j                  t        |      d       | j                  |d   d   |       | j                  t        |d   d   |             | j                  |d   d   |       | j                  t        |d   d   |             y )Nr   rh   rr  c                       e Zd Zy)8ComponentsTests.test_getAdapters_non_empty.<locals>.IFooNrF   r&   r   r   rI   r  t  rJ   r   rI   r   rB  c                       e Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Context1NrF   r&   r   r   rE  r  y  rO   r   rE  c                       e Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Context2NrF   r&   r   r   rH  r  |  rO   r   rH  c                       e Zd Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory1c                     ||f| _         y r   rd  ra  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory1.__init__  rd  r   Nr  r&   r   r   	_Factory1r    re  r   r  c                       e Zd Zd Zy)=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory2c                     ||f| _         y r   rd  ra  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory2.__init__  rd  r   Nr  r&   r   r   	_Factory2r    re  r   r  r   r   r  r   rp   )rR   rC   rs  rS   r   r[  r#  r  r(   ru   r+   r,   )r   rC   rs  rI   rU   r\  rK  rE  rH  rL  rM  r  r  r   r   r3   founds                    r   test_getAdapters_non_emptyz*ComponentsTests.test_getAdapters_non_emptyp  st   >;	> 	F|F|F|	T		 	 
		T		 	 
	K	K		2 	2	2 	2 }}YtdHYtdHt''I(>EFUQ'q!f-
58A;	:;q!f-
58A;	:;r   c           	          ddl m}  G d d|      } |d      } |d      }d}d}d }| j                         }| j                  t        |j
                  ||f|||       y )	Nr   rh   c                       e Zd Zy)NComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   r   rP   c                     t               r   rZ   rd  s    r   r\   zRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>._factory  r]   r   )rR   rC   r   rb   rc   registerSubscriptionAdapter)	r   rC   rI   rU   r\  rw   rV   r\   r3   s	            r   0test_registerSubscriptionAdapter_w_nonblank_namez@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name  se    >	> 	F|F|	( }})T%E%E"TGT5%	Ar   c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d}d	}d
 }	| j                         }
| j                         \  }}|5  |
j                  |	|f||       d d d        |
j                  j                  d   |   |   |   }| j                  t        |      d       | j                  |d   |	u        | j                  |
j                  |f|||	|fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |
u        | j                  |j                   j$                  |u        | j                  |j                   j&                  |f       | j                  |j                   j(                  |       | j                  |j                   j*                  |u        | j                  |j                   j,                  |	u        y # 1 sw Y   xY w)Nr   rh   ri   SubscriptionRegistrationc                       e Zd Zy)_ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   ro   rP   c                     t               r   rZ   rd  s    r   r\   zcComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required.<locals>._factory  r]   r   rQ   rp   )rR   rC   rq   rj   rr   r  r   r"   r  r-   rt   r(   ru   r+   r1   r,   rS   r   rv   rf  r   rP   r`   )r   rC   rj   r  rI   rU   r\  _blankrV   r\   r3   r!   r   r$  r   r   rx   s                    r   Atest_registerSubscriptionAdapter_w_explicit_provided_and_requiredzQComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required  s	   >8D	> 	F|F|	(}}++- 	9,,Xw27 - 9	9 mm((+D1$7?S1%A(*+99 7D&(EBC	EWq)1:bR 
5*56
5<<1IJK--56--56..8**F3))U23,,89'	9 	9s   IIc                    ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      }d	}d
}	 ||       G d dt                     }
| j                         }| j                         \  }}|5  |j                  |
|f|       d d d        |j                  j                  d   |   |   |	   }| j                  t        |      d       | j                  |d   |
u        | j                  |j                   |f||	|
|fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t#        ||             | j                  t#        |j                  |             | j                  |j                  j$                  |u        | j                  |j                  j&                  |u        | j                  |j                  j(                  |f       | j                  |j                  j*                  |	       | j                  |j                  j,                  |u        | j                  |j                  j.                  |
u        y # 1 sw Y   xY w)Nr   rh   rr  ri   r  c                       e Zd Zy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   rP   ro   c                       e Zd Zy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrF   r&   r   r   rm  r    rO   r   rm  rQ   rp   )rR   rC   rs  rq   rj   rr   r  rS   r   r"   r  r-   rt   r(   ru   r+   r1   r,   r   rv   rf  r   rP   r`   )r   rC   rs  rj   r  rI   rU   r\  rV   r  rm  r3   r!   r   r$  r   r   rx   s                     r   5test_registerSubscriptionAdapter_wo_explicit_providedzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided  s"   >;8D	> 	F|F|	T		v 	 
	 }}++- 	L,,XwU,K	Lmm((+D1$7?S1%A(*+99 7D&(EBC	EWq)1:bR 
5*56
5<<1IJK--56--56..8**F3))U23,,89%	L 	Ls   7I..I8c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      d}d	} G fd
dt              }| j                         }	| j                         \  }
}|
5  |	j                  |||       d d d        |	j                  j                  d      |   |   }| j                  t        |      d       | j                  |d   |u        | j                  |	j                  f||||fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t!        ||             | j                  t!        |j                  |             | j                  |j                  j"                  |	u        | j                  |j                  j$                  |u        | j                  |j                  j&                  f       | j                  |j                  j(                  |       | j                  |j                  j*                  |u        | j                  |j                  j,                  |u        y # 1 sw Y   xY w)Nr   rh   ri   r  c                       e Zd Zy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   rP   ro   c                       e Zd ZW  fZy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rm  r    r  r   rm  )rv   rP   rp   )rR   rC   rq   rj   rr   r  rS   r   r"   r  r-   rt   r(   ru   r+   r1   r,   r   rv   rf  r   rP   r`   )r   rC   rj   r  rI   rU   rV   r  rm  r3   r!   r   r$  r   r   rx   r\  s                   @r   5test_registerSubscriptionAdapter_wo_explicit_requiredzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required  s   >8D	> 	F|F|	+v 	+ }}++- 	9,,t% - 9	9 mm((+D1$7?S1%A(*+99 7D&(EBC	EWq)1:bR 
5*56
5<<1IJK--56--56..8**F3))U23,,89'	9 	9s   )II)c                 ,   ddl m}  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   rh   c                       e Zd Zy)GComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   ro   rP   c                     t               r   rZ   rd  s    r   r\   zKComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>._factory  r]   r   FrP   rx   )rR   rC   r   r"   r  r(   ru   )r   rC   rI   rU   r\  r  rV   r\   r3   r!   r   s              r   )test_registerSubscriptionAdapter_wo_eventz9ComponentsTests.test_registerSubscriptionAdapter_wo_event  s    >	> 	F|F|	( }}++- 	F,,Xw27u - F	F 	Wq)	F 	Fs   B

Bc                 v    | j                         }| j                  t        |j                               g        y r   )r   r(   r   registeredSubscriptionAdaptersr:   s     r   )test_registeredSubscriptionAdapters_emptyz9ComponentsTests.test_registeredSubscriptionAdapters_empty'  s+    }}dAACDbIr   c                    ddl m} ddlm}  G d d|      } |d      } |d      }d}d} G d d	t              }| j                         }	|	j                  ||f||
       |	j                  ||f||
       t        |	j                               }
| j                  t        |
      d       | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |f       | j                  |
d   j                   |       | j                  |
d   j"                  |u        | j                  |
d   j$                  |u        | j                  t        |
d   |             | j                  |
d   j                  |	u        | j                  |
d   j                  |u        | j                  |
d   j                  |f       | j                  |
d   j                   |       | j                  |
d   j"                  |u        | j                  |
d   j$                  |u        y )Nr   rh   r  c                       e Zd Zy)JComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>.IFooNrF   r&   r   r   rI   r  /  rJ   r   rI   rP   ro   c                       e Zd Zy)NComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>._FactoryNrF   r&   r   r   rm  r  5  rJ   r   rm  rQ   r   rp   )rR   rC   rr   r  rS   r   r  r   r  r(   ru   r+   r,   r   rv   rf  r   rP   r`   )r   rC   r  rI   rU   r\  rV   r  rm  r3   r$  s              r   ,test_registeredSubscriptionAdapters_notemptyz<ComponentsTests.test_registeredSubscriptionAdapters_notempty+  s   >D	> 	F|F|	v 	 }}((D7Du(M((D7Du(M46689S1%
3q6+CDEA4/0A4/0Q4'2Qf-Au,-A(23
3q6+CDEA4/0A4/0Q4'2Qf-Au,-A(23r   c                     ddl m}  G d d|      } |d      } |d      }d}| j                         }| j                  t        |j
                  |||       y )Nr   rh   c                       e Zd Zy)PComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrF   r&   r   r   rI   r  O  rJ   r   rI   r   nonblank)rf  rv   r   rR   rC   r   rb   rc   unregisterSubscriptionAdapter)r   rC   rI   rU   r\  	_nonblankr3   s          r   2test_unregisterSubscriptionAdapter_w_nonblank_namezBComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_nameL  sX    >	> 	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_providedX  s/    }})T%G%G"& 	 	7r   c                     ddl m}  G d d|      } |d      }| j                         }| j                  t        |j
                  d |d        y )Nr   rh   c                       e Zd Zy)]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required.<locals>.IFooNrF   r&   r   r   rI   r  _  rJ   r   rI   r  r  r*  s        r   ?test_unregisterSubscriptionAdapter_neither_factory_nor_requiredzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required]  sJ    >	> 	F|}})T%G%G"& 	 	Fr   c                 D   ddl m}  G d d|      } |d      } |d      } G d dt              }| j                         }| j	                         \  }}|5  |j                  ||f|      }	d d d        | j                  	       | j                  |       y # 1 sw Y   ,xY w)Nr   rh   c                       e Zd Zy)EComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>.IFooNrF   r&   r   r   rI   r  h  rJ   r   rI   r   c                       e Zd Zy)IComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>._FactoryNrF   r&   r   r   rm  r  l  rJ   r   rm  )rR   rC   rS   r   r"   r  r   r  s
             r   'test_unregisterSubscriptionAdapter_missz7ComponentsTests.test_unregisterSubscriptionAdapter_missf  s    >	> 	F|F|	v 	 }}++- 	P66x$$OE	P!	P 	Ps   BBc                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } G d d	t              }| j                         }|j                  ||f|       | j                         \  }	}
|	5  |j                  d |f|      }d d d        | j                         | j                  |j                  j                         | j                  |j                         | j!                  t#        |
      d
       |
d   \  }}|\  }| j!                  |i        | j                  t%        ||             | j                  t%        |j                  |             | j                  |j                  j&                  |u        | j                  |j                  j(                  |u        | j!                  |j                  j*                  |f       | j!                  |j                  j,                  d       | j!                  |j                  j.                  d       | j                  |j                  j0                  d u        y # 1 sw Y   xY w)Nr   rh   r   r  c                       e Zd Zy)OComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>.IFooNrF   r&   r   r   rI   r  z  rJ   r   rI   r   c                       e Zd Zy)SComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>._FactoryNrF   r&   r   r   rm  r  ~  rJ   r   rm  rp   ro   rR   rC   rq   r   rr   r  rS   r   r  r"   r  r+   r   r-   rt   r1   r(   ru   r,   r   rv   rf  r   rP   r`   r   rC   r   r  rI   rU   r\  rm  r3   r!   r   r   r   r   rx   s                  r   1test_unregisterSubscriptionAdapter_hit_wo_factoryzAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factoryv  s   >:D	> 	F|F|	v 	 }}((D7DA++- 	L66tdWdKE	L33499:Wq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,45!	L 	Lr  c                    ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } G d d	t              }| j                         }|j                  ||f|       | j                         \  }	}
|	5  |j                  ||f|      }d d d        | j                         | j                  |j                  j                         | j                  |j                         | j!                  t#        |
      d
       |
d   \  }}|\  }| j!                  |i        | j                  t%        ||             | j                  t%        |j                  |             | j                  |j                  j&                  |u        | j                  |j                  j(                  |u        | j!                  |j                  j*                  |f       | j!                  |j                  j,                  d       | j!                  |j                  j.                  d       | j                  |j                  j0                  |u        y # 1 sw Y   xY w)Nr   rh   r   r  c                       e Zd Zy)NComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>.IFooNrF   r&   r   r   rI   r     rJ   r   rI   r   c                       e Zd Zy)RComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>._FactoryNrF   r&   r   r   rm  r    rJ   r   rm  rp   ro   r  r  s                  r   0test_unregisterSubscriptionAdapter_hit_w_factoryz@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory  s   >:D	> 	F|F|	v 	 }}((D7DA++- 	P66x$$OE	P33499:Wq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,89!	P 	Pr  c                 F   ddl m} ddl m} ddlm} ddlm}  G d d|      } |d      } |d      } ||       G d	 d
t                     }| j                         }	|	j                  ||f|       | j                         \  }
}|
5  |	j                  ||f      }d d d        | j                         | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                   |	u        | j                  |j                  j"                  |u        | j                  |j                  j$                  |f       | j                  |j                  j&                  d       | j                  |j                  j(                  d       | j                  |j                  j*                  |u        y # 1 sw Y   }xY w)Nr   rh   rr  r   r  c                       e Zd Zy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd Zy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrF   r&   r   r   rm  r    rO   r   rm  rp   ro   )rR   rC   rs  rq   r   rr   r  rS   r   r  r"   r  r+   r(   ru   r,   r   rv   rf  r   rP   r`   )r   rC   rs  r   r  rI   rU   r\  rm  r3   r!   r   r   r   r   rx   s                   r   7test_unregisterSubscriptionAdapter_wo_explicit_providedzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided  s   >;:D	> 	F|F|	T		v 	 
	 }}((D7DA++- 	J66x$IE	JWq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,89	J 	Jr  c                 *   ddl m} ddlm} ddlm}  G d d|      } |d      } |d       G fdd	t              }| j                         }|j                  |f|       | j                         \  }}	|5  |j                  ||
      }
d d d        | j                  
       | j                  t        |	      d       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |u        | j                  |j                  j"                  f       | j                  |j                  j$                  d       | j                  |j                  j&                  d       | j                  |j                  j(                  |u        y # 1 sw Y   }xY w)Nr   rh   r   r  c                       e Zd Zy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd ZW  fZy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rm  r    r  r   rm  r  rp   ro   )rR   rC   rq   r   rr   r  rS   r   r  r"   r  r+   r(   ru   r,   r   rv   rf  r   rP   r`   )r   rC   r   r  rI   rU   rm  r3   r!   r   r   r   r   rx   r\  s                 @r   7test_unregisterSubscriptionAdapter_wo_explicit_requiredzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required  s   >:D	> 	F|F|	+v 	+ }}((D7DA++- 	P66x$6OE	PWq)1:bR 
5,78
5<<1IJK--56--56..8**B/**B/,,89	P 	Pr  c                    ddl m} ddl m}  G d d|      } |d      } |d      }| j                         } ||       G d dt                     } |       }| j                  t        |j                  |f|            g        y )	Nr   rh   rr  c                       e Zd Zy)4ComponentsTests.test_subscribers_empty.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   r   c                       e Zd Zy)3ComponentsTests.test_subscribers_empty.<locals>.BarNrF   r&   r   r   Barr    rO   r   r  )rR   rC   rs  r   rS   r(   r   subscribers)	r   rC   rs  rI   rU   r\  r3   r  bars	            r   test_subscribers_emptyz&ComponentsTests.test_subscribers_empty  sz    >;	> 	F|F|}}	T		& 	 
	ed..vt<=rBr   c                 2   ddl m} ddl m}  G d d|      } |d      } |d       G fddt              } G d	 d
|      }| j	                         }|j                  |f|       |j                  |f|        |       G d dt                     } |       }	|j                  |	f|      }
d }t        |
|      }
| j                  t        |
      d       | j                  t        |
d   |             | j                  t        |
d   |             y )Nr   rh   rr  c                       e Zd Zy)8ComponentsTests.test_subscribers_non_empty.<locals>.IFooNrF   r&   r   r   rI   r    rJ   r   rI   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)   rG   rH   r  r  r  s   r   rm  r  	  s    $(7 (r   rm  c                       e Zd Zy)<ComponentsTests.test_subscribers_non_empty.<locals>._DerivedNrF   r&   r   r   _Derivedr     rJ   r   r!  c                       e Zd Zy)7ComponentsTests.test_subscribers_non_empty.<locals>.BarNrF   r&   r   r   r  r#    rO   r   r  c                 .    | j                   j                  S r   )r   r)   xs    r   
_klassnamez>ComponentsTests.test_subscribers_non_empty.<locals>._klassname  s    ;;'''r   r!  r   rp   )rR   rC   rs  rS   r   r  r  r#  r(   ru   r+   r,   )r   rC   rs  rI   rU   rm  r!  r3   r  r  r  r'  r\  s               @r   test_subscribers_non_emptyz*ComponentsTests.test_subscribers_non_empty  s    >;	> 	F|F|	(v 	(	x 	}}((D7DA((D7DA	T		& 	 
	e&&vt4	([j9[)1-
;q>8<=
;q>8<=r   c                     ddl m}  G d d|      } |d      }d}| j                         }d }| j                  t        |j
                  |||       y )Nr   rh   c                       e Zd Zy)BComponentsTests.test_registerHandler_w_nonblank_name.<locals>.IFooNrF   r&   r   r   rI   r+  !  rJ   r   rI   r  c                     t               r   rZ   rd  s    r   r\   zFComponentsTests.test_registerHandler_w_nonblank_name.<locals>._factory&  r]   r   rf  r   )rR   rC   r   rb   rc   registerHandler)r   rC   rI   rU   r  r3   r\   s          r   $test_registerHandler_w_nonblank_namez4ComponentsTests.test_registerHandler_w_nonblank_name  sU    >	> 	F|	}}	( 	)T%9%98#'i 	 	9r   c                 \   ddl m} ddlm} ddlm}  G d d|      } |d      }d}d}d	 }| j                         }	| j                         \  }
}|
5  |	j                  ||f|
       d d d        |	j                  j                  d   |   d    |   }| j                  t        |      d       | j                  |d   |u        | j                  |	j                  |f|||fg       | j                  t        |      d       |d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                   |             | j                  |j                   j"                  |	u        | j                  |j                   j$                  |f       | j                  |j                   j&                  |       | j                  |j                   j(                  |u        | j                  |j                   j*                  |u        y # 1 sw Y   xY w)Nr   rh   ri   HandlerRegistrationc                       e Zd Zy)FComponentsTests.test_registerHandler_w_explicit_required.<locals>.IFooNrF   r&   r   r   rI   r4  1  rJ   r   rI   ro   rP   c                     t               r   rZ   rd  s    r   r\   zJComponentsTests.test_registerHandler_w_explicit_required.<locals>._factory6  r]   r   rQ   rp   )rR   rC   rq   rj   rr   r2  r   r"   r.  r-   rt   r(   ru   r+   r2   r,   rS   r   rf  r   rP   r`   )r   rC   rj   r2  rI   rU   r  rV   r\   r3   r!   r   r$  r   r   rx   s                   r   (test_registerHandler_w_explicit_requiredz8ComponentsTests.test_registerHandler_w_explicit_required,  s   >8?	> 	F|	( }}++- 	@  D7 ?	@mm((+D1$7?S1%A(*+44 7FHe<=	?Wq)1:bR 
5*56
5<<1DEF--56..8**F3))U23,,89#	@ 	@s   H!!H+c                   
 ddl m}  G d d|      } |d      
d}d} G 
fddt              }| j                         }| j	                         \  }}|5  |j                  ||d	
       d d d        |j                  j                  d   
   d    |   }	| j                  t        |	      d       | j                  |	d   |u        | j                  |j                  
f|||fg       | j                  t        |      d       y # 1 sw Y   xY w)Nr   rh   c                       e Zd Zy)PComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>.IFooNrF   r&   r   r   rI   r9  Q  rJ   r   rI   rP   ro   c                       e Zd ZW  fZy)TComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>._FactoryNr  rU   s   r   rm  r;  V  s    $(7 r   rm  Fr  rp   )rR   rC   rS   r   r"   r.  r-   rt   r(   ru   r+   r2   )r   rC   rI   rV   r  rm  r3   r!   r   r$  rU   s             @r   2test_registerHandler_wo_explicit_required_no_eventzBComponentsTests.test_registerHandler_wo_explicit_required_no_eventN  s	   >	> 	F|	v 	 }}++- 	D  U C	Dmm((+D1$7?S1%A(*+44 7FHe<=	?Wq)	D 	Ds   DDc                 t    | j                         }| j                  t        |j                                      y r   )r   r   r   registeredHandlersr:   s     r   test_registeredHandlers_emptyz-ComponentsTests.test_registeredHandlers_emptye  s)    }}d55789r   c                    ddl m} ddlm}  G d d|      } |d      }d }d }| j	                         }|j                  ||f       |j                  ||f       d }t        |j                         |	      }	| j                  t        |	      d
       | j                  t        |	d   |             | j                  |	d   j                  |f       | j                  |	d   j                  d       | j                  |	d   j                  |       | j                  |	d   j                  d       | j                  t        |	d   |             | j                  |	d   j                  |f       | j                  |	d   j                  d       | j                  |	d   j                  |       | j                  |	d   j                  d       y )Nr   rh   r1  c                       e Zd Zy)?ComponentsTests.test_registeredHandlers_non_empty.<locals>.IFooNrF   r&   r   r   rI   rC  l  rJ   r   rI   c                     t               r   rZ   rd  s    r   	_factory1zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory1o  r]   r   c                     t               r   rZ   rd  s    r   	_factory2zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory2q  r]   r   c                 B    | j                   j                  j                  S r   )r`   __code__co_namer%  s    r   _factory_namezHComponentsTests.test_registeredHandlers_non_empty.<locals>._factory_namev  s    99%%---r   r!  r   ro   rp   )rR   rC   rr   r2  r   r.  r#  r?  r(   ru   r+   r,   rf  r   r`   rP   )
r   rC   r2  rI   rU   rE  rG  r3   rK  r  s
             r   !test_registeredHandlers_non_emptyz1ComponentsTests.test_registeredHandlers_non_emptyi  s   >?	> 	F|	(	(}}Y0Y0	.T446MJ[)1-
;q>3FGHQ004':Q,,b1Q//;Q,,b1
;q>3FGHQ004':Q,,b1Q//;Q,,b1r   c                     ddl m}  G d d|      } |d      }d}| j                         }| j                  t        |j
                  |f|       y )Nr   rh   c                       e Zd Zy)DComponentsTests.test_unregisterHandler_w_nonblank_name.<locals>.IFooNrF   r&   r   r   rI   rO    rJ   r   rI   r  r-  )rR   rC   r   rb   rc   unregisterHandler)r   rC   rI   rU   r  r3   s         r   &test_unregisterHandler_w_nonblank_namez6ComponentsTests.test_unregisterHandler_w_nonblank_name  sN    >	> 	F|	}})T%;%;$(7 	 	<r   c                 d    | j                         }| j                  t        |j                         y r   )r   rb   rc   rP  r:   s     r   3test_unregisterHandler_neither_factory_nor_requiredzCComponentsTests.test_unregisterHandler_neither_factory_nor_required  s#    }})T%;%;<r   c                     ddl m}  G d d|      } |d      }| j                         }|j                  |f      }| j	                  |       y )Nr   rh   c                       e Zd Zy)9ComponentsTests.test_unregisterHandler_miss.<locals>.IFooNrF   r&   r   r   rI   rV    rJ   r   rI   rf  )rR   rC   r   rP  r   )r   rC   rI   rU   r3   r   s         r   test_unregisterHandler_missz+ComponentsTests.test_unregisterHandler_miss  sH    >	> 	F|}}&&&8r   c                    ddl m} ddlm} ddlm}  G d d|      } |d      }| j                         }d }| j                         }|j                  ||f       | j                         \  }}	|5  |j                  ||f      }
d d d        | j                  
       | j                  t        |	      d       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |f       | j                  |j                  j"                  d	       | j                  |j                  j$                  |u        y # 1 sw Y   0xY w)
Nr   rh   r   r1  c                       e Zd Zy)XComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   r[    rJ   r   rI   c                     t               r   rZ   rd  s    r   r\   z\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>._factory  r]   r   rp   ro   rR   rC   rq   r   rr   r2  r   r.  r"   rP  r+   r(   ru   r,   rS   r   rf  r   r`   r   rC   r   r2  rI   rU   r3   r\   r!   r   r   r   r   rx   s                 r   :test_unregisterHandler_hit_w_factory_and_explicit_providedzJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided  sg   >:?	> 	F|}}	(}}Xw/++- 	>**8dW=E	>Wq)1:bR 
5,78
5<<1DEF--56..8**B/,,89	> 	>   1F33F=c                    ddl m} ddlm} ddlm}  G d d|      } |d      }| j                         }d }| j                         }|j                  ||f       | j                         \  }}	|5  |j                  |f      }
d d d        | j                  
       | j                  t        |	      d	       |	d   \  }}|\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   |f       | j                  |j                  j"                  d
       | j                  |j                  j$                  d u        y # 1 sw Y   0xY w)Nr   rh   r   r1  c                       e Zd Zy)QComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>.IFooNrF   r&   r   r   rI   rc    rJ   r   rI   c                     t               r   rZ   rd  s    r   r\   zUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>._factory  r]   r   rW  rp   ro   r]  r^  s                 r   3test_unregisterHandler_hit_w_only_explicit_providedzCComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided  sh   >:?	> 	F|}}	(}}Xw/++- 	=**TG*<E	=Wq)1:bR 
5,78
5<<1DEF--56..8**B/,,45	= 	=r`  c                    ddl m} ddlm} ddlm}  G d d|      } |d       G fddt              }| j                         }|j                  |       | j                         \  }}|5  |j                  |      }	d d d        | j                  	       | j                  t        |      d	       |d   \  }
}|
\  }| j                  |i        | j                  t        ||             | j                  t        |j                  |             | j                  |j                  j                  |u        | j                  |j                  j                   f       | j                  |j                  j"                  d
       | j                  |j                  j$                  d
       | j                  |j                  j&                  |u        y # 1 sw Y   VxY w)Nr   rh   r   r1  c                       e Zd Zy)IComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>.IFooNrF   r&   r   r   rI   rh    rJ   r   rI   c                       e Zd ZW  fZy)MComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>._FactoryNr  r<  s   r   rm  rj    r  r   rm  rp   ro   )rR   rC   rq   r   rr   r2  rS   r   r.  r"   rP  r+   r(   ru   r,   r   rf  r   rP   r`   )r   rC   r   r2  rI   rm  r3   r!   r   r   r   r   rx   rU   s                @r   +test_unregisterHandler_wo_explicit_requiredz;ComponentsTests.test_unregisterHandler_wo_explicit_required  sx   >:?	> 	F|	+v 	+ }}X&++- 	5**84E	5Wq)1:bR 
5,78
5<<1DEF--56..8**B/**B/,,89	5 	5s   .GGc                     ddl m} ddl m}  G d d|      } |d      }| j                         } ||       G d dt                     } |       }|j                  |f       y )Nr   rh   rr  c                       e Zd Zy)/ComponentsTests.test_handle_empty.<locals>.IFooNrF   r&   r   r   rI   rn    rJ   r   rI   c                       e Zd Zy).ComponentsTests.test_handle_empty.<locals>.BarNrF   r&   r   r   r  rp    rO   r   r  )rR   rC   rs  r   rS   handle)r   rC   rs  rI   rU   r3   r  r  s           r   test_handle_emptyz!ComponentsTests.test_handle_empty  s[    >;	> 	F|}}	T		& 	 
	eSFr   c                 ~  
 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	t
                     } |       }	|j                  |	       | j                  
|	g       | j                  |	g       y )
Nr   rh   rr  c                       e Zd Zy)3ComponentsTests.test_handle_non_empty.<locals>.IFooNrF   r&   r   r   rI   ru    rJ   r   rI   c                 (    j                  |        y r   r   )re  	_called_1s    r   
_factory_1z9ComponentsTests.test_handle_non_empty.<locals>._factory_1	        )r   c                 (    j                  |        y r   r   )re  	_called_2s    r   
_factory_2z9ComponentsTests.test_handle_non_empty.<locals>._factory_2	  ry  r   c                       e Zd Zy)2ComponentsTests.test_handle_non_empty.<locals>.BarNrF   r&   r   r   r  r~  	  rO   r   r  )rR   rC   rs  r   r.  rS   rq  r(   )r   rC   rs  rI   rU   rx  r|  r3   r  r  rw  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>.IFooNrF   r&   r   r   rI   r  	  rJ   r   rI   r  r  r   rp   ro   r      r   )r   r   rS   rT   r(   ru   r.   rt   	_providedr   r+   )r   	identicalrI   r3   firstsecondress          r   3test_register_unregister_identical_objects_providedzCComponentsTests.test_register_unregister_identical_objects_provided	  sU   	9 	 }}#UT2Vd?T^^8891=442IyE6?C8
 7 	 	11y!a4
 	 $$UT$:$$Vd$G1126T^^8891=r   c                 (    | j                  d       y )NF)r  )r  r   s    r   2test_register_unregister_nonequal_objects_providedzBComponentsTests.test_register_unregister_nonequal_objects_provided/	  s    @@5@Qr   c                      G d dt               } G d dt              }| 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        d	      t        |
            }
|d   |   |
   |	|
<   , | j                  ||        t        |             x}|j
                  _
        |j                  i        i x}	|d   |<   d|	d	<   t        dd      D ]5  }
 t        d	      t        |
            }
|d   |   |
   }|	d	xx   |fz  cc<   7 |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)   rG   rH   __doc__r&   r   r   rI   r  3	      r   rI   c                       e Zd ZdZy)YComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.UtilityImplementingFoor  Nr  r&   r   r   UtilityImplementingFoor  6	  r  r   r     r  rp   r   ro   
   r&                  )did_not_registerneeded_registereddid_not_subscribeneeded_subscribedT)rebuild)r   rS   r   rangerT   r.   _generationrs   r(   ru   rt   typer   strassertNotEqual$rebuildUtilityRegistryFromLocalCacheassertIn)r   rI   r  compsiorig_generationorig_adaptersorig_subscribersnew_adaptersdr   new_subscribersr3   rebuild_results_preflightrebuild_resultsorig_subscriberpreflight_afterrebuild_afters                     r   )test_rebuildUtilityRegistryFromLocalCachez9ComponentsTests.test_rebuildUtilityRegistryFromLocalCache2	  s   	9 		V 	 r 	UA!!"8":DPQ!T	U  //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6s;<bA 4G43F3HHu0B$&&LOD!"I 	3D49SY'D#A&t,T2AdG	3 	M<89O>N9O9QQ%//6r"'))OAt$#!RL 	D49SY'D #D)$/DcFtgF	 %*$N$N$P!44oF2 "!#!"!#5
 	  DDTDR 	44o6IJ2OD}5"4(-. #D)#./	1  0248= 	JOMM/?1+=d+CC+HI	J  DDF "!"!#!"+
 	 BB4BP844o6IJr   )test)T)vr)   rG   rH   r   r   r"   r4   r7   r;   r?   rW   rf   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r%  r+  r2  r7  r>  rB  rG  rL  rQ  rU  r]  rg  rp  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r&  r>  rN  rV  rg  rp  r{  r"  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r(  r/  r6  r=  r@  rL  rQ  rS  rX  r_  re  rk  rr  r  r  r  r  r   r   s   @r   r	   r	      sw   9 :F=	= (?6@:<	M6@* %*10'6RO"*C,C>G
?"6>:> 6D!6FO$O$O,>6(((,?0>9O<G:?AL$*!:F2"%:NA G!:F(:TA":H*&7
F :@:@:<> 4DC	M5(; 1(*0X00d(B,B2N*B25-1^F(A4!<FA ":H%:N#:J*(J4B
H7
F" 6@:@:@:<C>89 :D*.:28	<= :666:8+.>8RT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>.ComponentsNrF   r&   r   r   r   r  	  rJ   r   r   )r   r  r   r   )r   r   r   s     r   r   z)UnhashableComponentsTests._getTargetClass	  s#    	8$OQSW 	r   )r)   rG   rH   r   r   r  s   @r   r  r  	  s     r   r  c                       e Zd Zd ZddZd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)UtilityRegistrationTestsc                     ddl m} |S )Nr   rk   )rr   rl   )r   rl   s     r   r   z(UtilityRegistrationTests._getTargetClass	      ?""r   Nc                     ddl m}  G d d|      } |d      } G d dt              } |       }d}d	}	| j                         }
 |
|||||	|      ||fS )
Nr   rh   c                       e Zd Zy)AUtilityRegistrationTests._makeOne.<locals>.InterfaceClassSubclassNrF   r&   r   r   InterfaceClassSubclassr  	  rJ   r   r  rI   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)   rG   rH   r  r&   r   r   	_Registryr  	      #r   r  r   	DOCSTRINGrR   rC   rS   r   )r   r_   r`   rC   r  rU   r  r   r   docklasss              r   r   z!UtilityRegistrationTests._makeOne	  sl    >	^ 	 &f-	# 	# ;$$&hdIsGD 	r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   verifyClassIUtilityRegistration)zope.interface.verifyr  rq   r  r   )r   r  r  s      r   +test_class_conforms_to_IUtilityRegistrationzDUtilityRegistrationTests.test_class_conforms_to_IUtilityRegistration	      5B($*>*>*@Ar   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   verifyObjectr  )r  r  rq   r  r   )r   r  r  ur_s        r   .test_instance_conforms_to_IUtilityRegistrationzGUtilityRegistrationTests.test_instance_conforms_to_IUtilityRegistration	  $    6BMMOAq)2.r   c                      G d dt               } |       }| j                  |      \  }}}| j                  t        |      d|z         y )Nc                       e Zd ZdZ y):UtilityRegistrationTests.test___repr__.<locals>._ComponentTESTNrF   r&   r   r   
_Componentr  	      Hr   r  zAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')rS   r   r(   r9   r   r  
_componentr  	_registryrw   s         r   r;   z&UtilityRegistrationTests.test___repr__	  sI    	 	\
#}}Z8IubO$&	'r   c                      G d dt               } |       }| 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')rS   r   rv   r(   r9   r  s         r   test___repr___provided_wo_namez7UtilityRegistrationTests.test___repr___provided_wo_name	  T    	 	  \
#}}Z8IuhbO$&	'r   c                      G d dt               } |       }| 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   rS   r   r(   __hash__idr   r  r  r  rw   s        r   test___hash__z&UtilityRegistrationTests.test___hash__	  8    X
#}}Z8Iu2/r   c                 j    t               }| j                  |      \  }}}| j                  ||k(         y r   rS   r   r+   r  s        r   test___eq___identityz-UtilityRegistrationTests.test___eq___identity	  .    X
#}}Z8Iub!r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   r  r   r  r  r  rw   ur2r  s          r   test___eq___hitz(UtilityRegistrationTests.test___eq___hit	  B    X
#}}Z8IuMM*-	Qc	"r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   rS   r   r   r   r  _component2r  r  rw   r
  r  s           r   test___eq___missz)UtilityRegistrationTests.test___eq___miss	  K    X
h#}}Z8IuMM+.	Qs#r   c                 j    t               }| j                  |      \  }}}| j                  ||k7         y r   r  r  s        r   test___ne___identityz-UtilityRegistrationTests.test___ne___identity	  0    X
#}}Z8Iur"r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  r	  s          r   test___ne___hitz(UtilityRegistrationTests.test___ne___hit	  D    X
#}}Z8IuMM*-	Qs#r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  r  s           r   test___ne___missz)UtilityRegistrationTests.test___ne___miss	  I    X
h#}}Z8IuMM+.	Qc	"r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  r  s        r   test___lt___identityz-UtilityRegistrationTests.test___lt___identity
  0    X
#}}Z8Iub!r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  r	  s          r   test___lt___hitz(UtilityRegistrationTests.test___lt___hit
  D    X
#}}Z8IuMM*-	Qc"r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y N2rS   r   r   r+   r  s           r   test___lt___missz)UtilityRegistrationTests.test___lt___miss
  T    X
h#}}Z8IuMM+.	Q3;S!r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  r  s        r   test___le___identityz-UtilityRegistrationTests.test___le___identity
  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  r	  s          r   test___le___hitz(UtilityRegistrationTests.test___le___hit
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y r#  r%  r  s           r   test___le___missz)UtilityRegistrationTests.test___le___miss 
  T    X
h#}}Z8IuMM+.	Q3;c	"r   c                 j    t               }| j                  |      \  }}}| j                  ||kD         y r   r  r  s        r   test___gt___identityz-UtilityRegistrationTests.test___gt___identity(
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||kD         y r#  r%  r  s           r   test___gt___hitz(UtilityRegistrationTests.test___gt___hit-
  T    X
h#}}Z8IuMM+.	Q3;b!r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||kD         y r   r  r	  s          r   test___gt___missz)UtilityRegistrationTests.test___gt___miss5
  D    X
#}}Z8IuMM*-	Qr"r   c                 j    t               }| j                  |      \  }}}| j                  ||k\         y r   r  r  s        r   test___ge___identityz-UtilityRegistrationTests.test___ge___identity;
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r#  rS   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                  ||k\         y r#  r%  r	  s          r   test___ge___hitz(UtilityRegistrationTests.test___ge___hitH
  M    X
#}}Z8IuMM*-	Q3;r	"r   )NN)r)   rG   rH   r   r   r  r  r;   r  r  r  r  r  r  r  r  r  r  r   r&  r)  r+  r-  r0  r2  r5  r8  r;  r>  r&   r   r   r  r  	  s    #&B
/'	'	'0
"
#$#
$#"
#""
##"
"#"
$#r   r  c                       e Zd Zd ZddZd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)AdapterRegistrationTestsc                     ddl m} |S )Nr   r_  )rr   r`  )r   r`  s     r   r   z(AdapterRegistrationTests._getTargetClassR
  r  r   Nc                     ddl m}  G d d|      } |d      } |d      } G d dt              } |       }d}d	}	| j                         }
 |
||f||||	      ||fS )
Nr   rh   c                       e Zd Zy)/AdapterRegistrationTests._makeOne.<locals>.IFooNrF   r&   r   r   rI   rE  Y
  rJ   r   rI   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  rG  ]
  r  r   r  r   r  r  r   r_   rC   rI   rU   r\  r  r   r   r  r  s              r   r   z!AdapterRegistrationTests._makeOneV
  t    >	> 	F|F|	# 	# ;$$&htYD 	r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   r  IAdapterRegistration)r  r  rq   rM  r   )r   r  rM  s      r   +test_class_conforms_to_IAdapterRegistrationzDAdapterRegistrationTests.test_class_conforms_to_IAdapterRegistrationi
  r  r   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   r  rL  )r  r  rq   rM  r   )r   r  rM  arr  s        r   .test_instance_conforms_to_IAdapterRegistrationzGAdapterRegistrationTests.test_instance_conforms_to_IAdapterRegistrationn
  r  r   c                      G d dt               } |       }| j                  |      \  }}}| j                  t        |      d|z         y )Nc                       e Zd ZdZ y):AdapterRegistrationTests.test___repr__.<locals>._Componentr  NrF   r&   r   r   r  rT  u
  r  r   r  zCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')r  r   r  r  rP  r  rw   s         r   r;   z&AdapterRegistrationTests.test___repr__t
  sK    	 	\
#}}Z8Iub %'	(r   c                      G d dt               } |       }| 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  rX  ~
  r  r   r  CAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')r  rU  s         r   r  z7AdapterRegistrationTests.test___repr___provided_wo_name}
  V    	 	  \
#}}Z8Iuhb %'	(r   c                      G d dt               } |       }| j                  |      \  }}}t               |_        | j                  t	        |      d|z         y )Nc                       e Zd Zd Zy)LAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Componentc                      yr  r&   r   s    r   r  zUAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Component.__repr__
  r  r   Nr  r&   r   r   r  r^  
  r  r   r  rZ  r  rU  s         r   r  z8AdapterRegistrationTests.test___repr___component_wo_name
  r[  r   c                     t               }| j                  |      \  }}}| j                  |j                         t	        |             y r   r  r   r  rP  r  rw   s        r   r  z&AdapterRegistrationTests.test___hash__
  r  r   c                 j    t               }| j                  |      \  }}}| j                  ||k(         y r   r  ra  s        r   r  z-AdapterRegistrationTests.test___eq___identity
  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   r  r   r  rP  r  rw   ar2r  s          r   r  z(AdapterRegistrationTests.test___eq___hit
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k(         y r   r  r   r  r  rP  r  rw   re  r  s           r   r  z)AdapterRegistrationTests.test___eq___miss
  r  r   c                 j    t               }| j                  |      \  }}}| j                  ||k7         y r   r  ra  s        r   r  z-AdapterRegistrationTests.test___ne___identity
  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  rd  s          r   r  z)AdapterRegistrationTests.test___ne___miss
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k7         y r   r  rg  s           r   test___ne___hit_componentz2AdapterRegistrationTests.test___ne___hit_component
  r  r   c                     ddl m}  G d d|      } |d      }t               }| j                  |      \  }}}| j                  |      \  }}	}	||_        | j                  ||k7         y )Nr   rh   c                       e Zd Zy)?AdapterRegistrationTests.test___ne___hit_provided.<locals>.IFooNrF   r&   r   r   rI   rn  
  rJ   r   rI   rB  )rR   rC   rS   r   rv   r+   )
r   rC   rI   rK  r  rP  r  rw   re  r  s
             r   test___ne___hit_providedz1AdapterRegistrationTests.test___ne___hit_provided
  sa    >	> 	F|X
#}}Z8IuMM*-	Qc	"r   c                     ddl m}  G d d|      } |d      }t               }t               }| j                  |      \  }}}| j                  |      \  }	}
}
|f|	_        | j                  ||	k7         y )Nr   rh   c                       e Zd Zy)?AdapterRegistrationTests.test___ne___hit_required.<locals>.IFooNrF   r&   r   r   rI   rr  
  rJ   r   rI   rB  )rR   rC   rS   r   rf  r+   )r   rC   rI   rK  r  r  rP  r  rw   re  r  s              r   test___ne___hit_requiredz1AdapterRegistrationTests.test___ne___hit_required
  sj    >	> 	F|X
h#}}Z8IuMM+.	Qwc	"r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  ra  s        r   r  z-AdapterRegistrationTests.test___lt___identity
  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  rd  s          r   r   z(AdapterRegistrationTests.test___lt___hit
  r!  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y r#  r%  rg  s           r   r&  z)AdapterRegistrationTests.test___lt___miss
  r'  r   c                 j    t               }| j                  |      \  }}}| j                  ||k         y r   r  ra  s        r   r)  z-AdapterRegistrationTests.test___le___identity
  r  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||k         y r   r  rd  s          r   r+  z(AdapterRegistrationTests.test___le___hit
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k         y r#  r%  rg  s           r   r-  z)AdapterRegistrationTests.test___le___miss
  r.  r   c                 j    t               }| j                  |      \  }}}| j                  ||kD         y r   r  ra  s        r   r0  z-AdapterRegistrationTests.test___gt___identity
  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||kD         y r#  r%  rg  s           r   r2  z(AdapterRegistrationTests.test___gt___hit
  r3  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}| j                  ||kD         y r   r  rd  s          r   r5  z)AdapterRegistrationTests.test___gt___miss  r6  r   c                 j    t               }| j                  |      \  }}}| j                  ||k\         y r   r  ra  s        r   r8  z-AdapterRegistrationTests.test___ge___identity  r  r   c                     t               }t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r#  r:  rg  s           r   r;  z)AdapterRegistrationTests.test___ge___miss  r<  r   c                     t               }| j                  |      \  }}}| j                  |      \  }}}|dz   |_        | j                  ||k\         y r#  r%  rd  s          r   r>  z(AdapterRegistrationTests.test___ge___hit  r?  r   r   )r)   rG   rH   r   r   rN  rQ  r;   r  r  r  r  r  r  r  r  rk  ro  rs  r  r   r&  r)  r+  r-  r0  r2  r5  r8  r;  r>  r&   r   r   rA  rA  P
  s    #&B
/(	(	(0
"
#$#
$#	#
#"
#""
##"
"#"
$#r   rA  c                   &    e Zd Zd ZddZd Zd Zy)SubscriptionRegistrationTestsc                     ddl m} |S )Nr   r  )rr   r  )r   r  s     r   r   z-SubscriptionRegistrationTests._getTargetClass#  s    D''r   Nc                     ddl m}  G d d|      } |d      } |d      } G d dt              } |       }d}d	}	| j                         }
 |
||f||||	      ||fS )
Nr   rh   c                       e Zd Zy)4SubscriptionRegistrationTests._makeOne.<locals>.IFooNrF   r&   r   r   rI   r  *  rJ   r   rI   r   c                       e Zd Zd Zy)9SubscriptionRegistrationTests._makeOne.<locals>._Registryc                      yr  r&   r   s    r   r  zBSubscriptionRegistrationTests._makeOne.<locals>._Registry.__repr__/  r  r   Nr  r&   r   r   r  r  .  r  r   r  r   r  r  rI  s              r   r   z&SubscriptionRegistrationTests._makeOne'  rJ  r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   r   ISubscriptionAdapterRegistration)r  r  rq   r  r   )r   r  r  s      r   7test_class_conforms_to_ISubscriptionAdapterRegistrationzUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistration:  s    5N4d6J6J6LMr   c                 V    ddl m} ddlm} | j	                         \  }}} |||       y )Nr   r  r  )r  r  rq   r  r   )r   r  r  sarr  s        r   :test_instance_conforms_to_ISubscriptionAdapterRegistrationzXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistration?  s$    6N]]_	Q5s;r   r   )r)   rG   rH   r   r   r  r  r&   r   r   r  r  !  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   r1  )rr   r2  )r   r2  s     r   r   z(HandlerRegistrationTests._getTargetClassH  r  r   Nc                     ddl m}  G d d|      } |d      } G d dt              } |       }d}d}| j                         }	 |	||f|||      ||fS )	Nr   rh   c                       e Zd Zy)/HandlerRegistrationTests._makeOne.<locals>.IFooNrF   r&   r   r   rI   r  O  rJ   r   rI   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__S  r  r   Nr  r&   r   r   r  r  R  r  r   r  r   r  r  )
r   r_   rC   rI   rU   r  r   r   r  r  s
             r   r   z!HandlerRegistrationTests._makeOneL  si    >	> 	F|	# 	# ;$$&hy#> 	r   c                 J    ddl m} ddlm}  ||| j	                                y )Nr   r  IHandlerRegistration)r  r  rq   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  )r  r  rq   r  r   )r   r  r  hrr  s        r   .test_instance_conforms_to_IHandlerRegistrationzGHandlerRegistrationTests.test_instance_conforms_to_IHandlerRegistrationc  r  r   c                     d }| j                  |      \  }}}| j                  |j                  |u        | j                  |j                  |j                  u        | j                  |j                  d u        y )Nc                     t               r   rZ   rd  s    r   r\   z:HandlerRegistrationTests.test_properties.<locals>._factoryj  r]   r   )r   r+   handlerr`   rv   )r   r\   r  r  s       r   test_propertiesz(HandlerRegistrationTests.test_propertiesi  s^    	(MM(+Aq

h./

bjj01t+,r   c                      G d dt               }| j                   |             \  }}}| j                  t        |      d|z         y )Nc                       e Zd ZdZ y)GHandlerRegistrationTests.test___repr___factory_w_name.<locals>._Factoryr  NrF   r&   r   r   rm  r  r  r  r   rm  =HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')r  r   rm  r  r  rw   s        r   test___repr___factory_w_namez5HandlerRegistrationTests.test___repr___factory_w_nameq  sF    	v 	 $hj 9Iub %'	(r   c                      G d dt               }| 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   rm  r  z  r  r   rm  r  r  r  s        r   test___repr___factory_wo_namez6HandlerRegistrationTests.test___repr___factory_wo_namey  sH    	v 	 !%hj 9Iub %'	(r   r   )
r)   rG   rH   r   r   r  r  r  r  r  r&   r   r   r  r  F  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)   rG   rH   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)   rG   rH   r  r&   r   r   r  r    s    5r   r  c                       e Zd Zy)PersistentDictComponentsNrF   r&   r   r   r  r    s    r   r  c                       e Zd Zd Zy)PersistentComponentsDictc                 Z    t         j                  |        t        j                  | |       y r   )r   r  r  )r   r   s     r   r  z!PersistentComponentsDict.__init__  s    d%%dD1r   Nr  r&   r   r   r  r    s    2r   r  c                   $    e Zd Zd Zd Zd Zd Zy)TestPersistentComponentsc                     t        d      S )Nr  )r  r   s    r   r   z!TestPersistentComponents._makeOne  s    #F++r   c                      y r   r&   r   mades     r   _check_equality_after_picklez5TestPersistentComponents._check_equality_after_pickle  s    r   c                     dd l }| j                         }|j                  |       |j                  |j                  |            }| j	                  |j
                  d       y Nr   r  )pickler   dumpsloadsr(   r)   )r   r  r3   comp2s       r   test_pickles_emptyz+TestPersistentComponents.test_pickles_empty  sG    }}TV\\$/00r   c                    dd l }| j                         }t               }|j                  |t               | j                  ||j                  t                     |j                  |j                  |            }| j                  |j                  d       | j                  |j                  t                     |j                  |t               | j                  ||j                  t                     | j                  |       y r  )r  r   rS   rT   r   r  r=  r  r  r(   r)   assertIsNotNoner  )r   r  r3   utilityr  s        r   &test_pickles_with_utility_registrationz?TestPersistentComponents.test_pickles_with_utility_registration  s    }}(	 	gooi0	2 V\\$/00 	U--i89 		 	g&&y1	3 	))%0r   N)r)   rG   rH   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)   rG   rH   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)   rG   rH   r   r&   r   r   r  r    s    (r   r  c                       e Zd Zd Zd Zd Zy)r    c           
          || _         t        |D cg c]  }|t        ||      f c}      | _        |j	                         D ]  \  }}t        |||        y c c}w r   )moduler   getattr
to_restoreitemssetattr)r   r  r   r"  values        r   r  z_Monkey.__init__  sW    rJgfc&: ;JK((* 	(JCFC'	(  K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)   rG   rH   r  r  r  r&   r   r   r    r      s    (-r   r    )r  unittestr   r   r'   r   rr   r   TestCaser	   r  r  rA  r  r  r  r  r   r  r  r  r  r  rS   r    r&   r   r   <module>r     s      $ ; .o%Kh'' o%KdK w#x00 w#tN#x00 N#b"<H$5$5 "<J:(x00 :(x% 8 %"5: 5	3T 	
2t%9 2(1x00 (1V*#; *(#? (
-f -r   