
    i׷                       d Z ddlZddlmZ ddlmZ ddlmZ  G d dej                  Z	 G d d	e	          Z
 G d
 dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d de          Z G d de          Z G d dee          Z G d dee          Z G d dej                  Z G d de          Z G d de          Z G d  d!          ZdS )"zComponent Registry Tests    N	Interface)VerifyingAdapterRegistry
Componentsc                       e Zd Zd Zdud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/ Z0d0 Z1d1 Z2d2 Z3d3 Z4d4 Z5d5 Z6d6 Z7d7 Z8d8 Z9d9 Z:d: Z;d; Z<d< Z=d= Z>d> Z?d? Z@d@ ZAdA ZBdB ZCdC ZDdD ZEdE ZFdF ZG fdGZH fdHZIdI ZJdJ ZKdK ZLdL ZMdM ZNdN ZO fdOZPdP ZQdQ ZRdR ZSdS ZTdT ZUdU ZVdV ZWdW ZXdX ZYdY ZZdZ Z[d[ Z\d\ Z]d] Z^d^ Z_d_ Z`d` Zada Zbdb Zcdc Zddd Zede Zfdf Zgdg Zhdh Zidi Zjdj Zkdk Zldl Zmdm Zndn Zodo Zpdp Zq	 dvdrZrds Zsdt Zt xZuS )wComponentsTestsc                     t           S Nr   selfs    M/usr/local/lib/python3.11/dist-packages/zope/interface/tests/test_registry.py_getTargetClasszComponentsTests._getTargetClass   s        testc                 >     |                                  |g|R i |S r   r   )r   nameargskws       r   _makeOnezComponentsTests._makeOne   s.    %t##%%d8T888R888r   c                 H    ddl m} g fd}t          ||          }|fS )Nr   )registryc                  6                         | |f           d S 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   sR    ++++++	' 	' 	' 	' 	' (7333r   c                 l   ddl m} |                     d          }|                     |j        d           |                     |j        d           |                     |j        |           |                     |j        |           |                     |j        j        d           |                     |j        j        d           |                     |j	        i            |                     |j
        i            |                     |j        g            |                     |j        g            d S )Nr   )AdapterRegistrytesting )zope.interface.adapterr%   r   assertEqual__name__	__bases__assertIsInstanceadapters	utilities_utility_registrations_adapter_registrations_subscription_registrations_handler_registrations)r   r%   comps      r   test_ctor_no_basesz"ComponentsTests.test_ctor_no_bases)   s%   ::::::}}Y''	222,,,dm_===dno>>>0"555126664b9994b99992>>>4b99999r   c                 d   |                      d          }|                      d|f          }|                     |j        d           |                     |j        |f           |                     |j        j        |j        f           |                     |j        j        |j        f           d S )Nbaser&   )r   r)   r*   r+   r-   r.   )r   r6   r3   s      r   test_ctor_w_basez ComponentsTests.test_ctor_w_base7   s    }}V$$}}Y00	222$11104=2BCCC1DN3DEEEEEr   c                 v    |                      d          }|                     t          |          d           d S )Nr&   z<Components testing>r   r)   reprr   r3   s     r   test___repr__zComponentsTests.test___repr__?   s6    }}Y''d%;<<<<<r   c                 ~   |                      d          }|                      d          }|                                  }||f|_        |                     |j        ||f           |                     |j        j        |j        |j        f           |                     |j        j        |j        |j        f           d S )Nbase1base2)r   r+   r)   r-   r.   )r   r>   r?   r3   s       r   test_assign_to___bases__z(ComponentsTests.test_assign_to___bases__E   s    g&&g&&}}%8880.%.9	; 	; 	;1/5?;	= 	= 	= 	= 	=r   c                 H   ddl m} ddl m}  G d d|          } |d          } |d           G d d                      } |            }d	}|                                 }|                    |||
           |                     |j        |df         ||d f           d S )Nr   InterfaceClassnamedc                       e Zd ZdS )FComponentsTests.test_registerUtility_with_component_name.<locals>.IFooNr*   
__module____qualname__r'   r   r   IFoorG   T           Dr   rK   fooc                       e Zd ZdS )EComponentsTests.test_registerUtility_with_component_name.<locals>.FooNrH   r'   r   r   FoorO   Y           Dr   rP   inforR   )zope.interface.declarationsrC   rE   r   registerUtilityr)   r/   )	r   rC   rE   rK   ifoorP   rM   _infor3   s	            r   (test_registerUtility_with_component_namez8ComponentsTests.test_registerUtility_with_component_nameP   s   >>>>>>555555	 	 	 	 	> 	 	 	 tF||	u	 	 	 	 	 	 	 
	 cee}}S$U333'e4%	  	  	  	  	 r   c                     d }t                      }|                                 }|                     t          |j        ||           d S )Nc                      t                      r   NotImplementedErrorr'   r   r   _factoryzQComponentsTests.test_registerUtility_both_factory_and_component.<locals>._factoryg       %'''r   	componentfactory)objectr   assertRaises	TypeErrorrU   r   r]   _to_regr3   s       r   /test_registerUtility_both_factory_and_componentz?ComponentsTests.test_registerUtility_both_factory_and_componentf   sZ    	( 	( 	(((}})T%9$+X 	 	? 	? 	? 	? 	?r   c                    ddl m} ddlm} ddlm}  G d d|          } |d          }d}d}t                      }|                                 }	|                                 \  }
}|
5  |		                    ||||           d d d            n# 1 swxY w Y   | 
                    |	j        j        d         |         |         |           |                     |	j        ||f         ||d f           |                     |	j        j        d         |         d	         |f           |                     t!          |          d
           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           | 
                    |j        j        |	           | 
                    |j        j        |           | 
                    |j        j        |           | 
                    |j        j        |           | 
                    |j        j        |           |                     |j        j                   d S )Nr   rB   
RegisteredUtilityRegistrationc                       e Zd ZdS )>ComponentsTests.test_registerUtility_w_component.<locals>.IFooNrH   r'   r   r   rK   rn   s   rL   r   rK   rR   r       )rT   rC   zope.interface.interfacesrj   zope.interface.registryrl   rb   r   r#   rU   assertIsr.   	_adaptersr)   r/   _subscriberslenr,   r   providedr   r`   rR   assertIsNonera   )r   rC   rj   rl   rK   rV   rW   _namerf   r3   r"   r   r   r   events                  r    test_registerUtility_w_componentz0ComponentsTests.test_registerUtility_w_componentn   s   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||((}}++-- 	> 	>  $u===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>dn.q1$7>HHH4T5[A!5$/	1 	1 	14Q7=bAG:NNNWq)))1:bR   eZ000el,?@@@el+T222el+T222el'///el,g666el'///%,./////s   +BBBc                    ddl m} ddlm} ddlm}  G d d|          } |d          }d}d}t                      fd	}|                                 }	|                                 \  }
}|
5  |		                    d ||||
           d d d            n# 1 swxY w Y   | 
                    t          |          d           |d         \  }}|\  }| 
                    |i            |                     ||           |                     |j        |           |                     |j        j        |	           |                     |j        j        |           |                     |j        j        |           |                     |j        j                   |                     |j        j        |           |                     |j        j        |           d S )Nr   rB   ri   rk   c                       e Zd ZdS )<ComponentsTests.test_registerUtility_w_factory.<locals>.IFooNrH   r'   r   r   rK   r~      rL   r   rK   rR   r   c                       S r   r'   rf   s   r   r]   z@ComponentsTests.test_registerUtility_w_factory.<locals>._factory       Nr   ra   rp   )rT   rC   rq   rj   rr   rl   rb   r   r#   rU   r)   rv   r,   rs   r   rw   r   r`   rR   ra   )r   rC   rj   rl   rK   rV   rW   ry   r]   r3   r"   r   r   r   rz   rf   s                  @r   test_registerUtility_w_factoryz.ComponentsTests.test_registerUtility_w_factory   s_   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||((	 	 	 	 	 }}++-- 	M 	M  tUE8 LLL	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	MWq)))1:bR   eZ000el,?@@@el+T222el+T222el'///el,g666el'///el*H55555s   1BBBc                      G d d          }d}d} |            }|                                  }|                     t          |j        |d ||           d S )Nc                       e Zd ZdS )GComponentsTests.test_registerUtility_no_provided_available.<locals>.FooNrH   r'   r   r   rP   r      rL   r   rP   rR   r   )r   rc   rd   rU   )r   rP   rW   ry   rf   r3   s         r   *test_registerUtility_no_provided_availablez:ComponentsTests.test_registerUtility_no_provided_available   s    	 	 	 	 	 	 	 	 #%%}}).ue	M 	M 	M 	M 	Mr   c                    ddl m} ddl m} ddlm} ddlm}  G d d|          } G d d	          } |d          }d
}d}	 |            }
 ||
|           |                                 }|                                 \  }}|5  |	                    |
d |	|           d d d            n# 1 swxY w Y   | 
                    t          |          d           |d         \  }}|\  }| 
                    |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |	           |                     |j        j        |
           |                     |j        j        |           |                     |j        j                   d S )Nr   rB   directlyProvidesri   rk   c                       e Zd ZdS )>ComponentsTests.test_registerUtility_wo_provided.<locals>.IFooNrH   r'   r   r   rK   r      rL   r   rK   c                       e Zd ZdS )=ComponentsTests.test_registerUtility_wo_provided.<locals>.FooNrH   r'   r   r   rP   r      rL   r   rP   rR   r   rp   )rT   rC   r   rq   rj   rr   rl   r   r#   rU   r)   rv   r,   rb   rs   r   rw   r   r`   rR   rx   ra   )r   rC   r   rj   rl   rK   rP   rV   rW   ry   rf   r3   r"   r   r   r   rz   s                    r    test_registerUtility_wo_providedz0ComponentsTests.test_registerUtility_wo_provided   s|   >>>>>>@@@@@@888888??????	 	 	 	 	> 	 	 		 	 	 	 	 	 	 	 tF||#%%$'''}}++-- 	> 	>  $u===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>Wq)))1:bR   eZ000el,?@@@el+T222el+T222el'///el,g666el'///%,./////s   B++B/2B/c                    ddl m}  G d d|          } |d          }d}d}t                      }|                                 }|                    ||||           |                                 \  }}	|5  |                    ||||           d d d            n# 1 swxY w Y   |                     t          |	          d           d S )Nr   rB   c                       e Zd ZdS )JComponentsTests.test_registerUtility_duplicates_existing_reg.<locals>.IFooNrH   r'   r   r   rK   r      rL   r   rK   rR   r   )rT   rC   rb   r   rU   r#   r)   rv   
r   rC   rK   rV   rW   ry   rf   r3   r"   r   s
             r   ,test_registerUtility_duplicates_existing_regz<ComponentsTests.test_registerUtility_duplicates_existing_reg   s4   >>>>>>	 	 	 	 	> 	 	 	 tF||((}}WdE5999++-- 	> 	>  $u===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>Wq)))))s   7BB #B c                 N   ddl m}  G d d|          } |d          }d}d}d}t                      }|                                 }|                    ||||           |                                 \  }	}
|	5  |                    ||||           d d d            n# 1 swxY w Y   |                     t          |
          d           |                     |j        ||f         ||d f           |                     |j	        j
        d         |         d	         |f           d S )
Nr   rB   c                       e Zd ZdS )CComponentsTests.test_registerUtility_w_different_info.<locals>.IFooNrH   r'   r   r   rK   r      rL   r   rK   info1info2r      ro   rT   rC   rb   r   rU   r#   r)   rv   r/   r.   ru   )r   rC   rK   rV   _info1_info2ry   rf   r3   r"   r   s              r   %test_registerUtility_w_different_infoz5ComponentsTests.test_registerUtility_w_different_info   s   >>>>>>	 	 	 	 	> 	 	 	 tF||((}}WdE6:::++-- 	? 	?  $v>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?Wq)))4dE]C!640	2 	2 	24Q7=bA!	% 	% 	% 	% 	%   9BB"%B"c                    ddl m}  G d d|          } |d          }d}d}d}t                      }t                      }|                                 }	|	                    ||||           |                                 \  }
}|
5  |	                    ||||           d d d            n# 1 swxY w Y   |                     t          |          d           |                     |	j        ||f         ||d f           |                     |	j        ||f         ||d f           |                     |	j	        j
        d         |         d	         ||f           d S )
Nr   rB   c                       e Zd ZdS )SComponentsTests.test_registerUtility_w_different_names_same_component.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   rR   name1name2rp   ro   r   r   rC   rK   rV   rW   _name1_name2
_other_regrf   r3   r"   r   s               r   5test_registerUtility_w_different_names_same_componentzEComponentsTests.test_registerUtility_w_different_names_same_component  s   >>>>>>	 	 	 	 	> 	 	 	 tF||XX
((}}Zvu===++-- 	? 	?  $>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?Wq)))4dF^D$eT2	4 	4 	44dF^D!5$/	1 	1 	14Q7=bA$g/	1 	1 	1 	1 	1s   B,,B03B0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                      }
}	|                                 }|	                    |	|||           | 
                                \  }}|5  |	                    |
|||           d d d            n# 1 swxY w Y   |                     t          |          d
           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |	           |                     |j        j        |           |                     |j        j                   |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |
           |                     |j        j        |           |                     |j        j                   d S )Nr   rB   ri   Unregisteredrk   c                       e Zd ZdS )HComponentsTests.test_registerUtility_replaces_existing_reg.<locals>.IFooNrH   r'   r   r   rK   r   $  rL   r   rK   rR   r   r   rp   )rT   rC   rq   rj   r   rr   rl   rb   r   rU   r#   r)   rv   r,   rs   r   rw   r   r`   rR   rx   ra   )r   rC   rj   r   rl   rK   rV   rW   ry   _before_afterr3   r"   r   r   r   rz   s                    r   *test_registerUtility_replaces_existing_regz:ComponentsTests.test_registerUtility_replaces_existing_reg  sP   >>>>>>888888::::::??????	 	 	 	 	> 	 	 	 tF|| ((FHH}}WdE5999++-- 	= 	=  ue<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=Wq)))1:bR   e\222el,?@@@el+T222el+T222el'///el,g666el'///%,.///1:bR   eZ000el,?@@@el+T222el+T222el'///el,f555el'///%,./////s   B<<C C c                    ddl m}  G d d|          } |d          }d}d}d}t                      }|                                 }|                    ||||           |                                 \  }	}
|	5  |                    ||||           d d d            n# 1 swxY w Y   |                     |j        j        d         |         d         |f           d S )	Nr   rB   c                       e Zd ZdS )DComponentsTests.test_registerUtility_w_existing_subscr.<locals>.IFooNrH   r'   r   r   rK   r   K  rL   r   rK   rR   r   r   ro   )	rT   rC   rb   r   rU   r#   r)   r.   ru   r   rC   rK   rV   rW   r   r   rf   r3   r"   r   s              r   &test_registerUtility_w_existing_subscrz6ComponentsTests.test_registerUtility_w_existing_subscrH  sI   >>>>>>	 	 	 	 	> 	 	 	 tF||((}}WdFE:::++-- 	? 	?  $>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?4Q7=bAG:NNNNNr   c                 j   ddl m}  G d d|          } |d          }d}d}t                      }|                                 }|                                 \  }}	|5  |                    ||||d           d d d            n# 1 swxY w Y   |                     t          |	          d           d S )Nr   rB   c                       e Zd ZdS );ComponentsTests.test_registerUtility_wo_event.<locals>.IFooNrH   r'   r   r   rK   r   ]  rL   r   rK   rR   r   F)rT   rC   rb   r   r#   rU   r)   rv   r   s
             r   test_registerUtility_wo_eventz-ComponentsTests.test_registerUtility_wo_eventZ  s-   >>>>>>	 	 	 	 	> 	 	 	 tF||((}}++-- 	E 	E  $ueDDD	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	EWq)))))s   BB	B	c                     G d d|                                            } |            }|                    t                      t                     |                     t          t          |                                                    d            G d dt                    }|                    t                      |           |                     t          t          |                                                    d           d S )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        |  | j         dk    rt          | j                  | _        d S d S )Nrp   )	reg_countsuperrU   dictr/   r   r   	__class__s     r   rU   ztComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Reg.registerUtilityp  sZ    !#''..>Q&&2633 3D/// '&r   r*   rI   rJ   r   rU   __classcell__r   s   @r   CompThatChangesAfter1Regr   m  s=        I        r   r   rp   c                       e Zd ZdS )PComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.IFooNrH   r'   r   r   rK   r   }  rL   r   rK   r   r   rU   rb   r   r)   rv   listregisteredUtilities)r   r   r3   rK   s       r   2test_registerUtility_changes_object_identity_afterzBComponentsTests.test_registerUtility_changes_object_identity_afterj  s   		 		 		 		 		t';';'='= 		 		 		 ('))VXXy111T$":":"<"<==>>BBB	 	 	 	 	9 	 	 	 	VXXt,,,T$":":"<"<==>>BBBBBr   c                     G d d|                                            } |            }|                    t                      t                     |                     t          t          |                                                    d            G d dt                    }|                    t                      |           |                     t          t          |                                                    d            G d dt                    }|                    t                      |           |                     t          t          |                                                    d	           d S )
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                      j        |  d S )Nrp   r   )r   r   r/   r   rU   r   s     r   rU   zuComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Reg.registerUtility  sT    !#>Q&&2633 3D/ ('....r   r   r   s   @r   CompThatChangesAfter2Regr     s=        I/ / / / / / / / /r   r   rp   c                       e Zd ZdS )QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   r   c                       e Zd ZdS )QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IBarNrH   r'   r   r   IBarr     rL   r   r      r   )r   r   r3   rK   r   s        r   3test_registerUtility_changes_object_identity_beforezCComponentsTests.test_registerUtility_changes_object_identity_before  s   
	/ 
	/ 
	/ 
	/ 
	/t';';'='= 
	/ 
	/ 
	/ ('))VXXy111T$":":"<"<==>>BBB	 	 	 	 	9 	 	 	 	VXXt,,,T$":":"<"<==>>BBB	 	 	 	 	9 	 	 	 	VXXt,,,T$":":"<"<==>>BBBBBr   c                 v    |                                  }|                     t          |j        d d d            d S )N)r`   rw   ra   )r   rc   rd   unregisterUtilityr;   s     r   <test_unregisterUtility_wo_factory_nor_component_nor_providedzLComponentsTests.test_unregisterUtility_wo_factory_nor_component_nor_provided  sI    }})T%;$(4 	 	G 	G 	G 	G 	Gr   c                     d }t                      }|                                 }|                     t          |j        ||           d S )Nc                      t                      r   r[   r'   r   r   r]   zSComponentsTests.test_unregisterUtility_both_factory_and_component.<locals>._factory  r^   r   r_   )rb   r   rc   rd   r   re   s       r   1test_unregisterUtility_both_factory_and_componentzAComponentsTests.test_unregisterUtility_both_factory_and_component  sZ    	( 	( 	(((}})T%;$+X 	 	? 	? 	? 	? 	?r   c                 p   ddl m}  G d d|          } |d          }d}t                      }|                                 }|                                 \  }}|5  |                    |||          }	d d d            n# 1 swxY w Y   |                     |	           |                     |           d S )Nr   rB   c                       e Zd ZdS )EComponentsTests.test_unregisterUtility_w_component_miss.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   r   )rT   rC   rb   r   r#   r   assertFalse)
r   rC   rK   rV   ry   rf   r3   r"   r   unregs
             r   'test_unregisterUtility_w_component_missz7ComponentsTests.test_unregisterUtility_w_component_miss  s/   >>>>>>	 	 	 	 	> 	 	 	 tF||((}}++-- 	A 	A**7D%@@E	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A!!!!!s   BBBc                 r   ddl m} ddlm} ddlm}  G d d|          } |d          }d}t                      }|                                 }|                    |||           | 	                                \  }	}
|	5  |
                    |||          }d d d            n# 1 swxY w Y   |                     |           |                     |j        j                   |                     ||f|j                   |                     |j        j                   |                     t'          |
          d           |
d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j                   d S )	Nr   rB   r   rk   c                       e Zd ZdS )@ComponentsTests.test_unregisterUtility_w_component.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   r   rp   )rT   rC   rq   r   rr   rl   rb   r   rU   r#   r   
assertTruer   r.   rt   assertNotInr/   ru   r)   rv   r,   rs   r   rw   r   r`   rx   ra   )r   rC   r   rl   rK   rV   ry   rf   r3   r"   r   r   r   r   rz   s                  r   "test_unregisterUtility_w_componentz2ComponentsTests.test_unregisterUtility_w_component  s   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||((}}WdE222++-- 	A 	A**7D%@@E	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A1222$(CDDD4555Wq)))1:bR   e\222el,?@@@el+T222el+T222el'///el,g666%,./////s    B$$B(+B(c                    ddl m} ddlm} ddlm}  G d d|          } |d          }d}d}t                      fd	}|                                 }	|	                    d ||||
           | 	                                \  }
}|
5  |	
                    d |||
          }d d d            n# 1 swxY w Y   |                     |           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |	           |                     |j        j        |           |                     |j        j        |           |                     |j        j                   |                     |j        j        |           d S )Nr   rB   r   rk   c                       e Zd ZdS )>ComponentsTests.test_unregisterUtility_w_factory.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   rR   r   c                       S r   r'   r   s   r   r]   zBComponentsTests.test_unregisterUtility_w_factory.<locals>._factory  r   r   r   rp   )rT   rC   rq   r   rr   rl   rb   r   rU   r#   r   r   r)   rv   r,   rs   r   rw   r   r`   ra   )r   rC   r   rl   rK   rV   rW   ry   r]   r3   r"   r   r   r   r   rz   rf   s                   @r    test_unregisterUtility_w_factoryz0ComponentsTests.test_unregisterUtility_w_factory  st   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||((	 	 	 	 	 }}T4xHHH++-- 	P 	P**4uh*OOE	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	PWq)))1:bR   e\222el,?@@@el+T222el+T222el'///el,g666el*H55555s   B11B58B5c                 8   ddl m} ddl m} ddlm} ddlm}  G d d|          } G d d	          } |d          }d
}d}	 |            }
 ||
|           |                                 }|                    |
||	|           | 	                                \  }}|5  |
                    |
d |	          }d d d            n# 1 swxY w Y   |                     |           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |	           |                     |j        j        |
           |                     |j        j        |           |                     |j        j                   d S )Nr   rB   r   r   rk   c                       e Zd ZdS )IComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   c                       e Zd ZdS )HComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.FooNrH   r'   r   r   rP   r     rL   r   rP   rR   r   rp   rT   rC   r   rq   r   rr   rl   r   rU   r#   r   r   r)   rv   r,   rb   rs   r   rw   r   r`   rR   rx   ra   r   rC   r   r   rl   rK   rP   rV   rW   ry   rf   r3   r"   r   r   r   r   rz   s                     r   +test_unregisterUtility_wo_explicit_providedz;ComponentsTests.test_unregisterUtility_wo_explicit_provided  s   >>>>>>@@@@@@::::::??????	 	 	 	 	> 	 	 		 	 	 	 	 	 	 	 tF||#%%$'''}}WdE5999++-- 	A 	A**7D%@@E	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	AWq)))1:bR   e\222el,?@@@el+T222el+T222el'///el,g666el'///%,./////   CC	Cc                 8   ddl m} ddl m} ddlm} ddlm}  G d d|          } G d d	          } |d          }d
}d}	 |            }
 ||
|           |                                 }|                    |
||	|           | 	                                \  }}|5  |
                    ||	          }d d d            n# 1 swxY w Y   |                     |           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |	           |                     |j        j        |
           |                     |j        j        |           |                     |j        j                   d S )Nr   rB   r   r   rk   c                       e Zd ZdS )LComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.IFooNrH   r'   r   r   rK   r   ,  rL   r   rK   c                       e Zd ZdS )KComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.FooNrH   r'   r   r   rP   r   /  rL   r   rP   rR   r   rw   r   rp   r   r   s                     r   .test_unregisterUtility_wo_component_or_factoryz>ComponentsTests.test_unregisterUtility_wo_component_or_factory&  s   >>>>>>@@@@@@::::::??????	 	 	 	 	> 	 	 		 	 	 	 	 	 	 	 tF||#%%$'''}}WdE5999++-- 	F 	F**Du*EEE	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	Wq)))1:bR   e\222el,?@@@el+T222el+T222el'///el,g666el'///%,./////r   c                    ddl m}  G d d|          } |d          }d}d}d}t                      }|                                 }|                    ||||           |                    ||||           |                                 \  }	}
|	5  |                    |||           d d d            n# 1 swxY w Y   |                     |j        j	        d         |         d         |f           d S )	Nr   rB   c                       e Zd ZdS )FComponentsTests.test_unregisterUtility_w_existing_subscr.<locals>.IFooNrH   r'   r   r   rK   r  N  rL   r   rK   rR   r   r   ro   
rT   rC   rb   r   rU   r#   r   r)   r.   ru   r   s              r   (test_unregisterUtility_w_existing_subscrz8ComponentsTests.test_unregisterUtility_w_existing_subscrK  sa   >>>>>>	 	 	 	 	> 	 	 	 tF||((}}WdFE:::WdFE:::++-- 	: 	:""7D&999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:4Q7=bAG:NNNNN   B55B9<B9c                    ddl m}  G d d|          } |d          }d}d}d}t                      }|                                 }|                    ||||           |                    ||||           |                                 \  }	}
|	5  |                    |||           d d d            n# 1 swxY w Y   |                     |j        j	        d         |         d         |f           d S )	Nr   rB   c                       e Zd ZdS )SComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable.<locals>.IFooNrH   r'   r   r   rK   r	  a  rL   r   rK   rR   r   r   ro   )
rT   rC   r   r   rU   r#   r   r)   r.   ru   r   s              r   5test_unregisterUtility_w_existing_subscr_non_hashablezEComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable^  sa   >>>>>>	 	 	 	 	> 	 	 	 tF||&&}}WdFE:::WdFE:::++-- 	: 	:""7D&999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:4Q7=bAG:NNNNNr  c                    ddl m} ddlm}  G d d|          } |d          }d}d}d}t	                      }|                                 }	|	                    ||||           |	                    ||||           |                                 \  }
}|
5  |	                    |||           d d d            n# 1 swxY w Y   | 	                    |	j
        j        d         |         d	         |f           d S )
Nr   rB   )_UtilityRegistrationsc                       e Zd ZdS )]ComponentsTests.test_unregisterUtility_w_existing_subs_non_hashable_fresh_cache.<locals>.IFooNrH   r'   r   r   rK   r  w  rL   r   rK   rR   r   r   ro   )rT   rC   rr   r  r   r   rU   r#   r   r)   r.   ru   )r   rC   r  rK   rV   rW   r   r   rf   r3   r"   r   s               r   ?test_unregisterUtility_w_existing_subs_non_hashable_fresh_cachezOComponentsTests.test_unregisterUtility_w_existing_subs_non_hashable_fresh_cacheq  su    	?>>>>>AAAAAA	 	 	 	 	> 	 	 	 tF||&&}}WdFE:::WdFE:::++-- 	: 	:""7D&999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:4Q7=bAG:NNNNNs   B;;B?B?c                 8   ddl m}  G d d|          } |d          }d}d}d}t                      }|                                 }|                    ||||           |                    ||||           |                    d           |                    ||||           |                                 \  }	}
|	5  |                    |||           d d d            n# 1 swxY w Y   |                     dt          |j
        j                             d S )	Nr   rB   c                       e Zd ZdS )]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   rR   r   r   r6   )rT   rC   r   r   rU   __init__r#   r   r)   rv   r.   ru   r   s              r   ?test_unregisterUtility_w_existing_subscr_non_hashable_reinittedzOComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted  s    	?>>>>>	 	 	 	 	> 	 	 	 tF||&&}}WdFE:::WdFE::: 	fWdFE:::++-- 	: 	:""7D&999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	C ;<<=====s   >C""C&)C&c                    ddl m}  G d d|          } |d          }d}d}d}t                      }t                      }|                                 }	|	                    ||||           |	                    ||||           |                                 \  }
}|
5  |	                    |||           d d d            n# 1 swxY w Y   |                     |	j        j	        d         |         d         |f           d S )	Nr   rB   c                       e Zd ZdS )VComponentsTests.test_unregisterUtility_w_existing_subscr_other_component.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   rR   r   r   ro   r  r   s               r   8test_unregisterUtility_w_existing_subscr_other_componentzHComponentsTests.test_unregisterUtility_w_existing_subscr_other_component  su   >>>>>>	 	 	 	 	> 	 	 	 tF||XX
((}}Zvu===WdFE:::++-- 	: 	:""7D&999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:4Q7=bA$	( 	( 	( 	( 	(   CC
Cc                    ddl m}  G d d|          } |d          }d}d}d}t                      }t                      }|                                 }	|	                    ||||           |	                    ||||           |                                 \  }
}|
5  |	                    |||           d d d            n# 1 swxY w Y   |                     |	j	        j
        d         |         d         |f           d S )	Nr   rB   c                       e Zd ZdS )[ComponentsTests.test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hash.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   rR   r   r   ro   )rT   rC   rb   r   r   rU   r#   r   r)   r.   ru   r   s               r   =test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hashzMComponentsTests.test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hash  su   >>>>>>	 	 	 	 	> 	 	 	 tF||XX
&&}}Zvu===WdFE:::++-- 	: 	:""7D&999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:4Q7=bA$	( 	( 	( 	( 	(r  c                     |                                  }|                     t          |                                          g            d S r   )r   r)   r   r   r;   s     r   test_registeredUtilities_emptyz.ComponentsTests.test_registeredUtilities_empty  s?    }}d6688992>>>>>r   c                    ddl m} ddlm}  G d d|          } |d          }d}d}d}t	                      }|                                 }	|	                    ||||           |	                    ||||           t          |	                                d	 
          }
| 	                    t          |
          d           |                     |
d         |           |                     |
d         j        |	           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j                   |                     |
d         |           |                     |
d         j        |	           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j                   d S )Nr   rB   rk   c                       e Zd ZdS )?ComponentsTests.test_registeredUtilities_notempty.<locals>.IFooNrH   r'   r   r   rK   r"    rL   r   rK   rR   r   r   c                     | j         S r   r   rs    r   <lambda>zCComponentsTests.test_registeredUtilities_notempty.<locals>.<lambda>  s    qv r   keyr   rp   )rT   rC   rr   rl   rb   r   rU   sortedr   r)   rv   r,   rs   r   rw   r   r`   rR   rx   ra   )r   rC   rl   rK   rV   rW   r   r   rf   r3   regs              r   !test_registeredUtilities_notemptyz1ComponentsTests.test_registeredUtilities_notempty  sl   >>>>>>??????	 	 	 	 	> 	 	 	 tF||((}}WdFE:::WdFE:::T--//5E5EFFFS1%%%c!f&9:::c!fot,,,c!fot,,,c!fk6***c!f&000c!fk5)))#a&.)))c!f&9:::c!fot,,,c!fot,,,c!fk6***c!f&000c!fk5)))#a&.)))))r   c                     ddl m}  G d d|          } |d          }|                                 }|                     |                    |                     d S )Nr   rB   c                       e Zd ZdS )?ComponentsTests.test_queryUtility_miss_no_default.<locals>.IFooNrH   r'   r   r   rK   r/    rL   r   rK   )rT   rC   r   rx   queryUtilityr   rC   rK   rV   r3   s        r   !test_queryUtility_miss_no_defaultz1ComponentsTests.test_queryUtility_miss_no_default  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}$++D1122222r   c                     ddl m}  G d d|          } |d          }|                                 }t                      }|                     |                    ||          |           d S )Nr   rB   c                       e Zd ZdS )>ComponentsTests.test_queryUtility_miss_w_default.<locals>.IFooNrH   r'   r   r   rK   r5    rL   r   rK   default)rT   rC   r   rb   rs   r0  )r   rC   rK   rV   r3   _defaults         r    test_queryUtility_miss_w_defaultz0ComponentsTests.test_queryUtility_miss_w_default  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}88d''h'??JJJJJr   c                    ddl m}  G d d|          } |d          }t                      }|                                 }|                    ||           |                     |                    |          |           d S )Nr   rB   c                       e Zd ZdS )3ComponentsTests.test_queryUtility_hit.<locals>.IFooNrH   r'   r   r   rK   r<    rL   r   rK   )rT   rC   rb   r   rU   rs   r0  r   rC   rK   rV   rf   r3   s         r   test_queryUtility_hitz%ComponentsTests.test_queryUtility_hit	  s    >>>>>>	 	 	 	 	> 	 	 	 tF||((}}Wd+++d''--w77777r   c                     ddl m} ddlm}  G d d|          } |d          }|                                 }|                     ||j        |           d S )Nr   rB   ComponentLookupErrorc                       e Zd ZdS )2ComponentsTests.test_getUtility_miss.<locals>.IFooNrH   r'   r   r   rK   rC    rL   r   rK   )rT   rC   rq   rA  r   rc   
getUtility)r   rC   rA  rK   rV   r3   s         r   test_getUtility_missz$ComponentsTests.test_getUtility_miss  s    >>>>>>BBBBBB	 	 	 	 	> 	 	 	 tF||}}.FFFFFr   c                    ddl m}  G d d|          } |d          }t                      }|                                 }|                    ||           |                     |                    |          |           d S )Nr   rB   c                       e Zd ZdS )1ComponentsTests.test_getUtility_hit.<locals>.IFooNrH   r'   r   r   rK   rH  #  rL   r   rK   )rT   rC   rb   r   rU   rs   rD  r=  s         r   test_getUtility_hitz#ComponentsTests.test_getUtility_hit   s    >>>>>>	 	 	 	 	> 	 	 	 tF||((}}Wd+++dood++W55555r   c                     ddl m}  G d d|          } |d          }|                                 }|                     t	          |                    |                    g            d S )Nr   rB   c                       e Zd ZdS )7ComponentsTests.test_getUtilitiesFor_miss.<locals>.IFooNrH   r'   r   r   rK   rL  /  rL   r   rK   )rT   rC   r   r)   r   getUtilitiesForr1  s        r   test_getUtilitiesFor_missz)ComponentsTests.test_getUtilitiesFor_miss,  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}d22488992>>>>>r   c                 h   ddl m}  G d d|          } |d          }d}d}t                      }|                                 }|                    |||           |                    |||           |                     t          |                    |                    ||f||fg           d S )Nr   rB   c                       e Zd ZdS )6ComponentsTests.test_getUtilitiesFor_hit.<locals>.IFooNrH   r'   r   r   rK   rQ  9  rL   r   rK   r   r   r$  )rT   rC   rb   r   rU   r)   r*  rM  r   rC   rK   rV   r   r   rf   r3   s           r   test_getUtilitiesFor_hitz(ComponentsTests.test_getUtilitiesFor_hit6  s    >>>>>>	 	 	 	 	> 	 	 	 tF||((}}Wd888Wd888 4 4T : :;;!7+fg->?	A 	A 	A 	A 	Ar   c                     ddl m}  G d d|          } |d          }|                                 }|                     t	          |                    |                    g            d S )Nr   rB   c                       e Zd ZdS )DComponentsTests.test_getAllUtilitiesRegisteredFor_miss.<locals>.IFooNrH   r'   r   r   rK   rV  I  rL   r   rK   )rT   rC   r   r)   r   getAllUtilitiesRegisteredForr1  s        r   &test_getAllUtilitiesRegisteredFor_missz6ComponentsTests.test_getAllUtilitiesRegisteredFor_missF  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}d??EEFFKKKKKr   c                 ^   ddl m}  G d d|          } |d          }d}d}t                      }|                                 }|                    |||           |                    |||           |                     t          |                    |                    |g           d S )Nr   rB   c                       e Zd ZdS )CComponentsTests.test_getAllUtilitiesRegisteredFor_hit.<locals>.IFooNrH   r'   r   r   rK   r[  S  rL   r   rK   r   r   r$  )rT   rC   rb   r   rU   r)   r   rW  rR  s           r   %test_getAllUtilitiesRegisteredFor_hitz5ComponentsTests.test_getAllUtilitiesRegisteredFor_hitP  s    >>>>>>	 	 	 	 	> 	 	 	 tF||((}}Wd888Wd888d??EEFF!	$ 	$ 	$ 	$ 	$r   c                 P   ddl m} ddl m}  G d d|          } |d          } |d          } |d           G d d	                      }d
}|                                 }|                    ||f||           |                     |j        |f|df         ||f           d S )Nr   rB   rD   c                       e Zd ZdS )FComponentsTests.test_registerAdapter_with_component_name.<locals>.IFooNrH   r'   r   r   rK   r_  d  rL   r   rK   r   rM   c                       e Zd ZdS )EComponentsTests.test_registerAdapter_with_component_name.<locals>.FooNrH   r'   r   r   rP   ra  j  rQ   r   rP   rR   rS   )rT   rC   rE   r   registerAdapterr)   r0   )	r   rC   rE   rK   rV   ibarrP   rW   r3   s	            r   (test_registerAdapter_with_component_namez8ComponentsTests.test_registerAdapter_with_component_name`  s   >>>>>>555555	 	 	 	 	> 	 	 	 tF||tF||	u	 	 	 	 	 	 	 
	}}S4'4e<<<'u(<=%L	 	 	 	 	r   c                 p   ddl m} ddlm} ddlm}  G d d|          } |d          } |d          }d}d	}d
 }	|                                 }
|                                 \  }}|5  |
                    |	|f|||           d d d            n# 1 swxY w Y   | 	                    |
j
        j        d         |         |         |         |	           |                     |
j        |f||f         |	|f           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           | 	                    |j        j        |
           | 	                    |j        j        |           |                     |j        j        |f           | 	                    |j        j        |           | 	                    |j        j        |           | 	                    |j        j        |	           d S )Nr   rB   ri   AdapterRegistrationc                       e Zd ZdS )SComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>.IFooNrH   r'   r   r   rK   ri  {  rL   r   rK   r   rR   r   c                     t                      r   r[   contexts    r   r]   zWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>._factory  r^   r   rp   rT   rC   rq   rj   rr   rg  r   r#   rb  rs   r-   rt   r)   r0   rv   r,   rb   r   rw   requiredr   rR   ra   )r   rC   rj   rg  rK   rV   rc  rW   ry   r]   r3   r"   r   r   r   rz   s                   r   5test_registerAdapter_w_explicit_provided_and_requiredzEComponentsTests.test_registerAdapter_w_explicit_provided_and_requiredv  s   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||tF||	( 	( 	(}}++-- 	H 	H  D7D%GGG	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	HM#A&t,T259	
 	
 	
 	4dWdE5IJ"E*	, 	, 	,Wq)))1:bR   eZ000el,?@@@el+T222el+T222.888el'///el'///el*H55555   +BBBc                     ddl m}  G d d|          } |d          }d}d} G d d	          }|                                 }|                     t          |j        ||f||
           d S )Nr   rB   c                       e Zd ZdS )HComponentsTests.test_registerAdapter_no_provided_available.<locals>.IFooNrH   r'   r   r   rK   rs    rL   r   rK   r   rR   r   c                       e Zd ZdS )LComponentsTests.test_registerAdapter_no_provided_available.<locals>._FactoryNrH   r'   r   r   _Factoryru    rL   r   rv  r   rR   rT   rC   r   rc   rd   rb  )r   rC   rK   rc  rW   ry   rv  r3   s           r   *test_registerAdapter_no_provided_availablez:ComponentsTests.test_registerAdapter_no_provided_available  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	 	 	 	 	 	 	 	 }})T%98dW$5 	 	2 	2 	2 	2 	2r   c                    ddl m} ddl m} ddlm} ddlm}  G d d|          } |d          } |d          }d	}d
}	 ||           G d d                      }
|                                 }|                                 \  }}|5  |	                    |
|f|	|           d d d            n# 1 swxY w Y   | 
                    |j        j        d         |         |         |	         |
           |                     |j        |f||	f         |
|f           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           | 
                    |j        j        |           | 
                    |j        j        |           |                     |j        j        |f           | 
                    |j        j        |	           | 
                    |j        j        |           | 
                    |j        j        |
           d S )Nr   rB   implementerri   rf  c                       e Zd ZdS )GComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   r~    rL   r   rK   r   rR   r   c                       e Zd ZdS )KComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>._FactoryNrH   r'   r   r   rv  r    rQ   r   rv  rw  rp   )rT   rC   r|  rq   rj   rr   rg  r   r#   rb  rs   r-   rt   r)   r0   rv   r,   rb   r   rw   rn  r   rR   ra   )r   rC   r|  rj   rg  rK   rV   rc  rW   ry   rv  r3   r"   r   r   r   rz   s                    r   )test_registerAdapter_wo_explicit_providedz9ComponentsTests.test_registerAdapter_wo_explicit_provided  s   >>>>>>;;;;;;888888??????	 	 	 	 	> 	 	 	 tF||tF||	T			 	 	 	 	 	 	 
		 }}++-- 	L 	L  D7U KKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	LM#A&t,T259	
 	
 	
 	4dWdE5IJ"E*	, 	, 	,Wq)))1:bR   eZ000el,?@@@el+T222el+T222.888el'///el'///el*H55555s   B33B7:B7c                     ddl m}  G d d|          } |d          }d}d} G d d          }|                                 }|                     t          |j        ||||	           d S )
Nr   rB   c                       e Zd ZdS )HComponentsTests.test_registerAdapter_no_required_available.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   rR   r   c                       e Zd ZdS )LComponentsTests.test_registerAdapter_no_required_available.<locals>._FactoryNrH   r'   r   r   rv  r    rL   r   rv  rw   r   rR   rx  r   rC   rK   rV   rW   ry   rv  r3   s           r   *test_registerAdapter_no_required_availablez:ComponentsTests.test_registerAdapter_no_required_available  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	 	 	 	 	 	 	 	 }})T%98#'e% 	 	A 	A 	A 	A 	Ar   c           	          ddl m}  G d d|          } |d          } |d          }d}d} G d d	          }|                                 }|                     t          |j        |||||
           d S )Nr   rB   c                       e Zd ZdS )EComponentsTests.test_registerAdapter_w_invalid_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rR   r   c                       e Zd ZdS )IComponentsTests.test_registerAdapter_w_invalid_required.<locals>._FactoryNrH   r'   r   r   rv  r    rL   r   rv  r  rx  )	r   rC   rK   rV   rc  rW   ry   rv  r3   s	            r   'test_registerAdapter_w_invalid_requiredz7ComponentsTests.test_registerAdapter_w_invalid_required  s    >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }})T%98E 	 	G 	G 	G 	G 	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          }	|                                 }
| 	                                \  }}|5  |

                    |	d g|||           d d d            n# 1 swxY w Y   |                     |
j        j        d         |         |         |         |	           |                     |
j        |f||f         |	|f           |                     t!          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |
           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |	           d S )Nr   rB   r   ri   rf  c                       e Zd ZdS )MComponentsTests.test_registerAdapter_w_required_containing_None.<locals>.IFooNrH   r'   r   r   rK   r     rL   r   rK   rR   r   c                       e Zd ZdS )QComponentsTests.test_registerAdapter_w_required_containing_None.<locals>._FactoryNrH   r'   r   r   rv  r    rL   r   rv  r  rp   )rT   rC   zope.interface.interfacer   rq   rj   rr   rg  r   r#   rb  rs   r-   rt   r)   r0   rv   r,   rb   r   rw   rn  r   rR   ra   )r   rC   r   rj   rg  rK   rV   rW   ry   rv  r3   r"   r   r   r   rz   s                   r   /test_registerAdapter_w_required_containing_Nonez?ComponentsTests.test_registerAdapter_w_required_containing_None  s   >>>>>>666666888888??????	 	 	 	 	> 	 	 	 tF||	 	 	 	 	 	 	 	 }}++-- 	9 	9  D6D&+% ! 9 9 9	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	M#A&y1$7>	
 	
 	
 	'dE(ABu	
 	
 	
 	Wq)))1:bR   eZ000el,?@@@el+T222el+T222.===el'///el'///el*H55555s   0BBBc                    ddl m} ddl m} ddl m} ddlm} ddlm}  G d d|          } |d          } |d	          }d
}	d}
 G d d          } ||           G d d                      } ||          }|                                 }| 	                                \  }}|5  |
                    ||g||
|	           d d d            n# 1 swxY w Y   |                     |j        j        d         |         |         |
         |           |                     |j        |f||
f         ||	f           |                     t!          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        |
           |                     |j        j        |	           |                     |j        j        |           d S )Nr   rB   )implementedByr{  ri   rf  c                       e Zd ZdS )NComponentsTests.test_registerAdapter_w_required_containing_class.<locals>.IFooNrH   r'   r   r   rK   r  +  rL   r   rK   r   rR   r   c                       e Zd ZdS )RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._FactoryNrH   r'   r   r   rv  r  3  rL   r   rv  c                       e Zd ZdS )RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._ContextNrH   r'   r   r   _Contextr  6  rQ   r   r  r  rp   )rT   rC   r  r|  rq   rj   rr   rg  r   r#   rb  rs   r-   rt   r)   r0   rv   r,   rb   r   rw   rn  r   rR   ra   )r   rC   r  r|  rj   rg  rK   rV   rc  rW   ry   rv  r  	_ctx_implr3   r"   r   r   r   rz   s                       r   0test_registerAdapter_w_required_containing_classz@ComponentsTests.test_registerAdapter_w_required_containing_class$  sP   >>>>>>======;;;;;;888888??????	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 
T			 	 	 	 	 	 	 
		 "M(++	}}++-- 	9 	9  H:&+% ! 9 9 9	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	M#A&y1$7>	
 	
 	
 	'dE(ABu	
 	
 	
 	Wq)))1:bR   eZ000el,?@@@el+T222el+T222.===el'///el'///el*H55555s   *CCCc                 B   ddl m}  G d d|          } |d          }d}d} G d d          }|                                 }|                     t                    5  |                    |t                      g|||	           d d d            d S # 1 swxY w Y   d S )
Nr   rB   c                       e Zd ZdS )MComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>.IFooNrH   r'   r   r   rK   r  X  rL   r   rK   rR   r   c                       e Zd ZdS )QComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>._FactoryNrH   r'   r   r   rv  r  `  rL   r   rv  r  )rT   rC   r   rc   rd   rb  rb   r  s           r   /test_registerAdapter_w_required_containing_junkz?ComponentsTests.test_registerAdapter_w_required_containing_junkU  s4   >>>>>>	 	 	 	 	> 	 	 	 tF||	 	 	 	 	 	 	 	 }}y)) 	 	  688*t%e !   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   (BBBc                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d          d}d	} G fd
d          }|                                 }	|                                 \  }
}|
5  |	                    ||||           d d d            n# 1 swxY w Y   | 	                    |	j
        j        d                  |         |         |           |                     |	j        f||f         ||f           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           | 	                    |j        j        |	           | 	                    |j        j        |           |                     |j        j        f           | 	                    |j        j        |           | 	                    |j        j        |           | 	                    |j        j        |           d S )Nr   rB   ri   rf  c                       e Zd ZdS )GComponentsTests.test_registerAdapter_wo_explicit_required.<locals>.IFooNrH   r'   r   r   rK   r  n  rL   r   rK   r   rR   r   c                       e Zd Z fZdS )KComponentsTests.test_registerAdapter_wo_explicit_required.<locals>._FactoryNr*   rI   rJ   __component_adapts__rc  s   r   rv  r  v          $(7   r   rv  r  rp   rm  )r   rC   rj   rg  rK   rV   rW   ry   rv  r3   r"   r   r   r   rz   rc  s                  @r   )test_registerAdapter_wo_explicit_requiredz9ComponentsTests.test_registerAdapter_wo_explicit_requiredi  s   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||tF||	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ }}++-- 	- 	-  Du&+ ! - - -	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	M#A&t,T259	
 	
 	
 	4dWdE5IJ"E*	, 	, 	,Wq)))1:bR   eZ000el,?@@@el+T222el+T222.888el'///el'///el*H55555s   8BB"%B"c           	      p   ddl m}  G d d|          } |d          } |d          }d}d}d }|                                 }|                                 \  }	}
|	5  |                    ||f|||d	
           d d d            n# 1 swxY w Y   |                     t          |
          d           d S )Nr   rB   c                       e Zd ZdS );ComponentsTests.test_registerAdapter_wo_event.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rR   r   c                     t                      r   r[   rk  s    r   r]   z?ComponentsTests.test_registerAdapter_wo_event.<locals>._factory  r^   r   F)rz   )rT   rC   r   r#   rb  r)   rv   )r   rC   rK   rV   rc  rW   ry   r]   r3   r"   r   s              r   test_registerAdapter_wo_eventz-ComponentsTests.test_registerAdapter_wo_event  sA   >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	( 	( 	(}}++-- 	. 	.  D7D%', ! . . .	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	Wq)))))s   BBBc                 t    |                                  }|                     t          |j        d d            d S N)ra   rw   )r   rc   rd   unregisterAdapterr;   s     r   3test_unregisterAdapter_neither_factory_nor_providedzCComponentsTests.test_unregisterAdapter_neither_factory_nor_provided  sB    }})T%;"& 	 	7 	7 	7 	7 	7r   c                     ddl m}  G d d|          } |d          }|                                 }|                     t          |j        d |d            d S )Nr   rB   c                       e Zd ZdS )QComponentsTests.test_unregisterAdapter_neither_factory_nor_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   ra   rw   rn  )rT   rC   r   rc   rd   r  r1  s        r   3test_unregisterAdapter_neither_factory_nor_requiredzCComponentsTests.test_unregisterAdapter_neither_factory_nor_required  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}})T%;"& 	 	F 	F 	F 	F 	Fr   c                 X   ddl m}  G d d|          } |d          } |d          } G d d          }|                                 }|                                 \  }}|5  |                    ||f|          }	d d d            n# 1 swxY w Y   |                     |	           d S )Nr   rB   c                       e Zd ZdS )9ComponentsTests.test_unregisterAdapter_miss.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd ZdS )=ComponentsTests.test_unregisterAdapter_miss.<locals>._FactoryNrH   r'   r   r   rv  r    rL   r   rv  )rT   rC   r   r#   r  r   
r   rC   rK   rV   rc  rv  r3   r"   r   r   s
             r   test_unregisterAdapter_missz+ComponentsTests.test_unregisterAdapter_miss  sF   >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}++-- 	D 	D**8dWdCCE	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D   %B

BBc                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d          } G d d	          }|                                 }|                    ||f|           |                                 \  }	}
|	5  |	                    ||f|          }d d d            n# 1 swxY w Y   | 
                    |           |                     |j        j                   |                     |j                   |                     t!          |
          d
           |
d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |           d S )Nr   rB   r   rf  c                       e Zd ZdS )YComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd ZdS )]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>._FactoryNrH   r'   r   r   rv  r    rL   r   rv  rp   ro   )rT   rC   rq   r   rr   rg  r   rb  r#   r  r   r   r-   rt   r0   r)   rv   r,   rb   rs   r   rw   rn  r   rR   ra   )r   rC   r   rg  rK   rV   rc  rv  r3   r"   r   r   r   r   rz   s                  r   ;test_unregisterAdapter_hit_w_explicit_provided_and_requiredzKComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required  s   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}Xw555++-- 	D 	D**8dWdCCE	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D01114555Wq)))1:bR   e\222el,?@@@el+T222el+T222.888*B///*B///el*H55555   	B..B25B2c                 @   ddl m} ddl m} ddlm} ddlm}  G d d|          } |d          } |d          } ||           G d	 d
                      }|                                 }	|	                    ||f|           | 	                                \  }
}|
5  |	
                    ||f          }d d d            n# 1 swxY w Y   |                     |           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |	           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |           d S )Nr   rB   r{  r   rf  c                       e Zd ZdS )IComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd ZdS )MComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>._FactoryNrH   r'   r   r   rv  r    rQ   r   rv  rp   ro   )rT   rC   r|  rq   r   rr   rg  r   rb  r#   r  r   r)   rv   r,   rb   rs   r   rw   rn  r   rR   ra   )r   rC   r|  r   rg  rK   rV   rc  rv  r3   r"   r   r   r   r   rz   s                   r   +test_unregisterAdapter_wo_explicit_providedz;ComponentsTests.test_unregisterAdapter_wo_explicit_provided  s   >>>>>>;;;;;;::::::??????	 	 	 	 	> 	 	 	 tF||tF||	T			 	 	 	 	 	 	 
		 }}Xw555++-- 	> 	>**8dW==E	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>Wq)))1:bR   e\222el,?@@@el+T222el+T222.888*B///*B///el*H55555    CCCc                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d           G fdd	          }|                                 }|                    |f|           |                                 \  }}	|5  |	                    ||
          }
d d d            n# 1 swxY w Y   | 
                    |
           |                     t          |	          d           |	d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |           d S )Nr   rB   r   rf  c                       e Zd ZdS )IComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd Z fZdS )MComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rv  r    r  r   rv  rw   rp   ro   )rT   rC   rq   r   rr   rg  r   rb  r#   r  r   r)   rv   r,   rb   rs   r   rw   rn  r   rR   ra   )r   rC   r   rg  rK   rV   rv  r3   r"   r   r   r   r   rz   rc  s                 @r   +test_unregisterAdapter_wo_explicit_requiredz;ComponentsTests.test_unregisterAdapter_wo_explicit_required  s   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||tF||	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ }}Xw555++-- 	D 	D**8d*CCE	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	DWq)))1:bR   e\222el,?@@@el+T222el+T222.888*B///*B///el*H55555   B00B47B4c                     |                                  }|                     t          |                                          g            d S r   )r   r)   r   registeredAdaptersr;   s     r   test_registeredAdapters_emptyz-ComponentsTests.test_registeredAdapters_empty.  s?    }}d557788"=====r   c                 6   ddl m} ddlm}  G d d|          } |d          } |d          }d}d}d} G d	 d
          }	|                                 }
|
                    |	|f|||           |
                    |	|f|||           t          |
                                d           }|                     t          |          d           | 
                    |d         |           |                     |d         j        |
           |                     |d         j        |           |                     |d         j        |f           |                     |d         j        |           |                     |d         j        |           |                     |d         j        |	           | 
                    |d         |           |                     |d         j        |
           |                     |d         j        |           |                     |d         j        |f           |                     |d         j        |           |                     |d         j        |           |                     |d         j        |	           d S )Nr   rB   rf  c                       e Zd ZdS )>ComponentsTests.test_registeredAdapters_notempty.<locals>.IFooNrH   r'   r   r   rK   r  6  rL   r   rK   rR   r   r   c                       e Zd ZdS )BComponentsTests.test_registeredAdapters_notempty.<locals>._FactoryNrH   r'   r   r   rv  r  ?  rL   r   rv  c                     | j         S r   r$  r%  s    r   r'  zBComponentsTests.test_registeredAdapters_notempty.<locals>.<lambda>E  s    af r   r(  r   rp   )rT   rC   rr   rg  r   rb  r*  r  r)   rv   r,   rs   r   rw   rn  r   rR   ra   )r   rC   rg  rK   rV   rc  rW   r   r   rv  r3   r+  s               r    test_registeredAdapters_notemptyz0ComponentsTests.test_registeredAdapters_notempty2  s   >>>>>>??????	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}XwfeDDDXwfeDDDT,,..4D4DEEES1%%%c!f&9:::c!fot,,,c!fot,,,Q4'222c!fk6***c!fk5)))c!fnh///c!f&9:::c!fot,,,c!fot,,,Q4'222c!fk6***c!fk5)))c!fnh/////r   c                     ddl m}  G d d|          } |d          }|                                 }t                      }|                     |                    ||                     d S )Nr   rB   c                       e Zd ZdS )?ComponentsTests.test_queryAdapter_miss_no_default.<locals>.IFooNrH   r'   r   r   rK   r  Y  rL   r   rK   )rT   rC   r   rb   rx   queryAdapter)r   rC   rK   rV   r3   _contexts         r   !test_queryAdapter_miss_no_defaultz1ComponentsTests.test_queryAdapter_miss_no_defaultV  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}88$++Hd;;<<<<<r   c                     ddl m}  G d d|          } |d          }|                                 }t                      }t                      }|                     |                    |||          |           d S )Nr   rB   c                       e Zd ZdS )>ComponentsTests.test_queryAdapter_miss_w_default.<locals>.IFooNrH   r'   r   r   rK   r  d  rL   r   rK   r6  )rT   rC   r   rb   rs   r  )r   rC   rK   rV   r3   r  r8  s          r    test_queryAdapter_miss_w_defaultz0ComponentsTests.test_queryAdapter_miss_w_defaulta  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}8888hh??	
 	
 	
 	
 	
r   c                    ddl m} ddl m}  G d d|          } |d          } |d          } G d d          } ||           G d	 d
                      } |            }|                                 }	|	                    ||f|           |	                    ||          }
|                     |
|           |                     |
j        |           d S )Nr   rB   r{  c                       e Zd ZdS )3ComponentsTests.test_queryAdapter_hit.<locals>.IFooNrH   r'   r   r   rK   r  t  rL   r   rK   r   c                       e Zd Zd ZdS )7ComponentsTests.test_queryAdapter_hit.<locals>._Factoryc                     || _         d S r   rk  r   rl  s     r   r  z@ComponentsTests.test_queryAdapter_hit.<locals>._Factory.__init__{      &r   Nr*   rI   rJ   r  r'   r   r   rv  r  z  #        ' ' ' ' 'r   rv  c                       e Zd ZdS )7ComponentsTests.test_queryAdapter_hit.<locals>._ContextNrH   r'   r   r   r  r  ~  rQ   r   r  )	rT   rC   r|  r   rb  r  r,   rs   rl  r   rC   r|  rK   rV   rc  rv  r  r  r3   adapters              r   test_queryAdapter_hitz%ComponentsTests.test_queryAdapter_hitp  sN   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||	' 	' 	' 	' 	' 	' 	' 	' 
T			 	 	 	 	 	 	 
		 8::}}Xw555##Hd33gx000gox00000r   c                 $   ddl m} ddl m} ddlm}  G d d|          } |d          } |d          } ||           G d d	                      } |            }|                                 }	|                     ||	j        ||           d S )
Nr   rB   r{  r@  c                       e Zd ZdS )2ComponentsTests.test_getAdapter_miss.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd ZdS )6ComponentsTests.test_getAdapter_miss.<locals>._ContextNrH   r'   r   r   r  r    rQ   r   r  )rT   rC   r|  rq   rA  r   rc   
getAdapter)
r   rC   r|  rA  rK   rV   rc  r  r  r3   s
             r   test_getAdapter_missz$ComponentsTests.test_getAdapter_miss  s   >>>>>>;;;;;;BBBBBB	 	 	 	 	> 	 	 	 tF||tF||	T			 	 	 	 	 	 	 
		 8::}}./8T	; 	; 	; 	; 	;r   c                    ddl m} ddl m}  G d d|          } |d          } |d          } G d d          } ||           G d	 d
                      } |            }|                                 }	|	                    ||f|           |	                    ||          }
|                     |
|           |                     |
j        |           d S )Nr   rB   r{  c                       e Zd ZdS )1ComponentsTests.test_getAdapter_hit.<locals>.IFooNrH   r'   r   r   rK   r
    rL   r   rK   r   c                       e Zd Zd ZdS )5ComponentsTests.test_getAdapter_hit.<locals>._Factoryc                     || _         d S r   rk  r  s     r   r  z>ComponentsTests.test_getAdapter_hit.<locals>._Factory.__init__  r  r   Nr  r'   r   r   rv  r    r  r   rv  c                       e Zd ZdS )5ComponentsTests.test_getAdapter_hit.<locals>._ContextNrH   r'   r   r   r  r    rQ   r   r  )	rT   rC   r|  r   rb  r  r,   rs   rl  r  s              r   test_getAdapter_hitz#ComponentsTests.test_getAdapter_hit  sL   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||	' 	' 	' 	' 	' 	' 	' 	' 
T			 	 	 	 	 	 	 
		 8::}}Xw555//(D11gx000gox00000r   c                 $   ddl m} ddlm}  G d d|          } G d d|          } G d d	|          } ||           G d
 d                      } ||           G d d|                      } G d d          } G d d          }	|                                 }
|
                    |	|f|           |
                    ||f|           |                     |
            |            }|
                    ||          }|                     ||	           | 	                    |j
        |           t          ||          }|
                    ||          }|                     ||           | 	                    |j
        |           d S )Nr   r   r{  c                       e Zd ZdS )8ComponentsTests.test_getAdapter_hit_super.<locals>.IBaseNrH   r'   r   r   IBaser    rL   r   r  c                       e Zd ZdS );ComponentsTests.test_getAdapter_hit_super.<locals>.IDerivedNrH   r'   r   r   IDerivedr    rL   r   r  c                       e Zd ZdS )7ComponentsTests.test_getAdapter_hit_super.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   c                       e Zd ZdS )7ComponentsTests.test_getAdapter_hit_super.<locals>.BaseNrH   r'   r   r   Baser    rQ   r   r  c                       e Zd ZdS ):ComponentsTests.test_getAdapter_hit_super.<locals>.DerivedNrH   r'   r   r   Derivedr    rQ   r   r  c                       e Zd Zd ZdS )>ComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBasec                     || _         d S r   rk  r  s     r   r  zGComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBase.__init__  r  r   Nr  r'   r   r   AdapterBaser!    r  r   r#  c                       e Zd Zd ZdS )AComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerivedc                     || _         d S r   rk  r  s     r   r  zJComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerived.__init__  r  r   Nr  r'   r   r   AdapterDerivedr%    r  r   r'  r    r   rT   r|  r   rb  _should_not_changer  r,   rs   rl  r   r   r   r|  r  r  rK   r  r  r#  r'  r3   derivedr  super   s                 r   test_getAdapter_hit_superz)ComponentsTests.test_getAdapter_hit_super  sj   ,,,,,,;;;;;;	 	 	 	 	I 	 	 		 	 	 	 	u 	 	 		 	 	 	 	9 	 	 	 
U			 	 	 	 	 	 	 
		 
X			 	 	 	 	d 	 	 
			' 	' 	' 	' 	' 	' 	' 	'	' 	' 	' 	' 	' 	' 	' 	' }}^h[$???[5(D999%%%'))//'400g~666gow///Wg&&//$--g{333gow/////r   c                 ^   ddl m} ddlm}  G d d|          } G d d|          } G d d	|          } G d
 d          } G d d|          } ||           G d d|                      } ||           G d d||                      }	 G d d          }
 G d d          }|                                 }|                    ||f|           |                    |
|f|           |                     |            |	            }|                    ||          }|                     ||           | 	                    |j
        |           t          |	|          }|                    ||          }|                     ||
           | 	                    |j
        |           d S )Nr   r   r{  c                       e Zd ZdS )^ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IBaseNrH   r'   r   r   r  r0    rL   r   r  c                       e Zd ZdS )aComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IDerivedNrH   r'   r   r   r  r2    rL   r   r  c                       e Zd ZdS )]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IFooNrH   r'   r   r   rK   r4    rL   r   rK   c                       e Zd ZdS )]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.BaseNrH   r'   r   r   r  r6    rL   r   r  c                       e Zd ZdS )_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child1NrH   r'   r   r   Child1r8    rL   r   r9  c                       e Zd ZdS )_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child2NrH   r'   r   r   Child2r;    rQ   r   r<  c                       e Zd ZdS )`ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.DerivedNrH   r'   r   r   r  r>    rQ   r   r  c                       e Zd Zd ZdS )dComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterBasec                     || _         d S r   rk  r  s     r   r  zmComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterBase.__init__  r  r   Nr  r'   r   r   r#  r@    r  r   r#  c                       e Zd Zd ZdS )gComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterDerivedc                     || _         d S r   rk  r  s     r   r  zpComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.AdapterDerived.__init__  r  r   Nr  r'   r   r   r'  rC    r  r   r'  r(  )r   r   r|  r  r  rK   r  r9  r<  r  r#  r'  r3   r+  r  r,  r   s                   r   ?test_getAdapter_hit_super_w_parent_implements_interface_diamondzOComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond  s   ,,,,,,;;;;;;	 	 	 	 	I 	 	 		 	 	 	 	u 	 	 		 	 	 	 	9 	 	 		 	 	 	 	 	 	 		 	 	 	 	T 	 	 	 
U			 	 	 	 	T 	 	 
		 
X			 	 	 	 	ff 	 	 
			' 	' 	' 	' 	' 	' 	' 	'	' 	' 	' 	' 	' 	' 	' 	' }}^h[$???[5(D999%%%'))//'400g~666gow///Wg&&//$--g{333gow/////r   c                    ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
|                                 }|                     |                    |	|
f|          d            d S )Nr   rB   r{  c                       e Zd ZdS )9ComponentsTests.test_queryMultiAdapter_miss.<locals>.IFooNrH   r'   r   r   rK   rH    rL   r   rK   r   IBazc                       e Zd ZdS )>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context1NrH   r'   r   r   	_Context1rK    rQ   r   rL  c                       e Zd ZdS )>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context2NrH   r'   r   r   	_Context2rN  "  rQ   r   rO  )rT   rC   r|  r   r)   queryMultiAdapterr   rC   r|  rK   rV   rc  ibazrL  rO  	_context1	_context2r3   s               r   test_queryMultiAdapter_missz+ComponentsTests.test_queryMultiAdapter_miss  sT   >>>>>>;;;;;;	 	 	 	 	> 	 	 	tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK	}}//I0FMM	 	 	 	 	r   c                    ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
t                      }|                                 }|                     |                    |	|
f||          |           d S )Nr   rB   r{  c                       e Zd ZdS )CComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>.IFooNrH   r'   r   r   rK   rX  0  rL   r   rK   r   rI  c                       e Zd ZdS )HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context1NrH   r'   r   r   rL  rZ  7  rQ   r   rL  c                       e Zd ZdS )HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context2NrH   r'   r   r   rO  r\  ;  rQ   r   rO  r6  )rT   rC   r|  rb   r   rs   rP  )r   rC   r|  rK   rV   rc  rR  rL  rO  rS  rT  r8  r3   s                r   %test_queryMultiAdapter_miss_w_defaultz5ComponentsTests.test_queryMultiAdapter_miss_w_default,  sj   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK	88}}""Iy#94+3 # 5 5	
 	
 	
 	
 	
r   c                 &   ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
 G d d          }|                                 }|                    |||f|           |                    |	|
f|          }|                     ||           |                     |j        |	|
f           d S )Nr   rB   r{  c                       e Zd ZdS )8ComponentsTests.test_queryMultiAdapter_hit.<locals>.IFooNrH   r'   r   r   rK   r`  M  rL   r   rK   r   rI  c                       e Zd ZdS )=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context1NrH   r'   r   r   rL  rb  T  rQ   r   rL  c                       e Zd ZdS )=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context2NrH   r'   r   r   rO  rd  X  rQ   r   rO  c                       e Zd Zd ZdS )<ComponentsTests.test_queryMultiAdapter_hit.<locals>._Factoryc                     ||f| _         d S r   rk  r   context1context2s      r   r  zEComponentsTests.test_queryMultiAdapter_hit.<locals>._Factory.__init__`      '1r   Nr  r'   r   r   rv  rf  _  #        2 2 2 2 2r   rv  )	rT   rC   r|  r   rb  rP  r,   r)   rl  r   rC   r|  rK   rV   rc  rR  rL  rO  rS  rT  rv  r3   r  s                 r   test_queryMultiAdapter_hitz*ComponentsTests.test_queryMultiAdapter_hitI  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK		2 	2 	2 	2 	2 	2 	2 	2 }}Xd|T:::(()Y)?FFgx0009i*@AAAAAr   c                    ddl m} ddl m} ddlm}  G d d|          } |d          } |d          } |d          } ||           G d	 d
                      } ||           G d d                      }	 |            }
 |	            }|                                 }|                     ||j        |
|f|           d S )Nr   rB   r{  r@  c                       e Zd ZdS )7ComponentsTests.test_getMultiAdapter_miss.<locals>.IFooNrH   r'   r   r   rK   rq  n  rL   r   rK   r   rI  c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context1NrH   r'   r   r   rL  rs  u  rQ   r   rL  c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context2NrH   r'   r   r   rO  ru  y  rQ   r   rO  )rT   rC   r|  rq   rA  r   rc   getMultiAdapter)r   rC   r|  rA  rK   rV   rc  rR  rL  rO  rS  rT  r3   s                r   test_getMultiAdapter_missz)ComponentsTests.test_getMultiAdapter_missi  se   >>>>>>;;;;;;BBBBBB	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK	}}..I0F	N 	N 	N 	N 	Nr   c                 &   ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
 G d d          }|                                 }|                    |||f|           |                    |	|
f|          }|                     ||           |                     |j        |	|
f           d S )Nr   rB   r{  c                       e Zd ZdS )6ComponentsTests.test_getMultiAdapter_hit.<locals>.IFooNrH   r'   r   r   rK   rz    rL   r   rK   r   rI  c                       e Zd ZdS );ComponentsTests.test_getMultiAdapter_hit.<locals>._Context1NrH   r'   r   r   rL  r|    rQ   r   rL  c                       e Zd ZdS );ComponentsTests.test_getMultiAdapter_hit.<locals>._Context2NrH   r'   r   r   rO  r~    rQ   r   rO  c                       e Zd Zd ZdS ):ComponentsTests.test_getMultiAdapter_hit.<locals>._Factoryc                     ||f| _         d S r   rk  rh  s      r   r  zCComponentsTests.test_getMultiAdapter_hit.<locals>._Factory.__init__  rk  r   Nr  r'   r   r   rv  r    rl  r   rv  )	rT   rC   r|  r   rb  rv  r,   r)   rl  rm  s                 r   test_getMultiAdapter_hitz(ComponentsTests.test_getMultiAdapter_hit  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK		2 	2 	2 	2 	2 	2 	2 	2 }}Xd|T:::&&	9'=tDDgx0009i*@AAAAAr   c                 Z      fd}||_         ||j        _         ||j        j        _         d S )Nc                  2                         d           d S )NzNothing should get changed)fail)r   r   s    r   
no_changesz6ComponentsTests._should_not_change.<locals>.no_changes  s    II233333r   )changedr-   	_v_lookup)r   r3   r  s   `  r   r)  z"ComponentsTests._should_not_change  s@    	4 	4 	4 	4 	4! **4'''r   c                    ddl m} ddlm}  G d d|          } G d d|          } G d d	|          } ||           G d
 d                      } ||           G d d|                      } G d d          } G d d|          }	|                                 }
|
                    |	||f|           |
                    |||f|           |                     |
            |            }|
                    ||f|          }|                     ||	           | 	                    |j
        |           | 	                    |j        |           t          ||          }|
                    ||f|          }|                     ||           |                     ||	           | 	                    |j
        |           | 	                    |j        |           d S )Nr   r   r{  c                       e Zd ZdS )=ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IBaseNrH   r'   r   r   r  r    rL   r   r  c                       e Zd ZdS )@ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IDerivedNrH   r'   r   r   r  r    rL   r   r  c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.BaseNrH   r'   r   r   r  r    rQ   r   r  c                       e Zd ZdS )?ComponentsTests.test_getMultiAdapter_hit_super.<locals>.DerivedNrH   r'   r   r   r  r    rQ   r   r  c                       e Zd Zd ZdS )CComponentsTests.test_getMultiAdapter_hit_super.<locals>.AdapterBasec                 "    || _         || _        d S r   )ri  rj  rh  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dS )FComponentsTests.test_getMultiAdapter_hit_super.<locals>.AdapterDerivedNrH   r'   r   r   r'  r    rL   r   r'  )r    r   rT   r|  r   rb  r)  rv  r,   rs   ri  rj  r   assertNotIsInstancer*  s                 r   test_getMultiAdapter_hit_superz.ComponentsTests.test_getMultiAdapter_hit_super  s   ,,,,,,;;;;;;	 	 	 	 	I 	 	 		 	 	 	 	u 	 	 		 	 	 	 	9 	 	 	 
U			 	 	 	 	 	 	 
		 
X			 	 	 	 	d 	 	 
			) 	) 	) 	) 	) 	) 	) 	)
	 	 	 	 	[ 	 	 	 }}^h-A4HHH[5(*;TBBB%%%'))&&'94@@g~666g&000g&000Wg&&&&g==g{333  .999g&000g&00000r   c                    ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
|                                 }|                     t          |                    |	|
f|                    g            d S )Nr   rB   r{  c                       e Zd ZdS )4ComponentsTests.test_getAdapters_empty.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rI  c                       e Zd ZdS )9ComponentsTests.test_getAdapters_empty.<locals>._Context1NrH   r'   r   r   rL  r    rQ   r   rL  c                       e Zd ZdS )9ComponentsTests.test_getAdapters_empty.<locals>._Context2NrH   r'   r   r   rO  r    rQ   r   rO  )rT   rC   r|  r   r)   r   getAdaptersrQ  s               r   test_getAdapters_emptyz&ComponentsTests.test_getAdapters_empty  sc   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK	}}!!9i"8$??@@"	F 	F 	F 	F 	Fr   c                 *   ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
|                                 }g fd}|                    |||f|           |                     t          |                    |	|
f|                    g            |                     |	|
fg           d S )Nr   rB   r{  c                       e Zd ZdS )CComponentsTests.test_getAdapters_factory_returns_None.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rI  c                       e Zd ZdS )HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context1NrH   r'   r   r   rL  r     rQ   r   rL  c                       e Zd ZdS )HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context2NrH   r'   r   r   rO  r    rQ   r   rO  c                 6                         | |f           d S r   r   )ri  rj  _called_withs     r   _side_effect_onlyzPComponentsTests.test_getAdapters_factory_returns_None.<locals>._side_effect_only  s!    8 45554r   )rT   rC   r|  r   rb  r)   r   r  )r   rC   r|  rK   rV   rc  rR  rL  rO  rS  rT  r3   r  r  s                @r   %test_getAdapters_factory_returns_Nonez5ComponentsTests.test_getAdapters_factory_returns_None  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK	}}	 	 	 	 	 	.tdCCC!!9i"8$??@@"	F 	F 	FI(>'?@@@@@r   c                    ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
 G d d          } G d d          }d}d}|                                 }|                    |||f||           |                    |||f||           t          |                    |	|
f|                    }|                     t          |          d           |                     |d         d         |           | 	                    |d         d         |           |                     |d         d         |           | 	                    |d         d         |           d S )Nr   rB   r{  c                       e Zd ZdS )8ComponentsTests.test_getAdapters_non_empty.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rI  c                       e Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Context1NrH   r'   r   r   rL  r  !  rQ   r   rL  c                       e Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Context2NrH   r'   r   r   rO  r  %  rQ   r   rO  c                       e Zd Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory1c                     ||f| _         d S r   rk  rh  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory1.__init__-  rk  r   Nr  r'   r   r   	_Factory1r  ,  rl  r   r  c                       e Zd Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory2c                     ||f| _         d S r   rk  rh  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory2.__init__1  rk  r   Nr  r'   r   r   	_Factory2r  0  rl  r   r  r   r   r$  r   rp   )
rT   rC   r|  r   rb  r*  r  r)   rv   r,   )r   rC   r|  rK   rV   rc  rR  rL  rO  rS  rT  r  r  r   r   r3   founds                    r   test_getAdapters_non_emptyz*ComponentsTests.test_getAdapters_non_empty  st   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK		2 	2 	2 	2 	2 	2 	2 	2	2 	2 	2 	2 	2 	2 	2 	2 }}YtdHHHYtdHHHt''I(>EEFFUQ'''q!f---eAhqk9555q!f---eAhqk955555r   c           	          ddl m}  G d d|          } |d          } |d          }d}d}d }|                                 }|                     t          |j        ||f|||           d S )	Nr   rB   c                       e Zd ZdS )NComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrH   r'   r   r   rK   r  C  rL   r   rK   r   r   rR   c                     t                      r   r[   rk  s    r   r]   zRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>._factoryK  r^   r   )rT   rC   r   rc   rd   registerSubscriptionAdapter)	r   rC   rK   rV   rc  ry   rW   r]   r3   s	            r   0test_registerSubscriptionAdapter_w_nonblank_namez@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name@  s    >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	( 	( 	( }})T%E"TGT5%	A 	A 	A 	A 	Ar   c                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d          }d}d	}d
 }	|                                 }
|                                 \  }}|5  |
                    |	|f||           d d d            n# 1 swxY w Y   |
j	        j
        d         |         |         |         }|                     t          |          d           |                     |d         |	           |                     |
j        |f|||	|fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |
           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |	           d S )Nr   rB   ri   SubscriptionRegistrationc                       e Zd ZdS )]ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>.IFooNrH   r'   r   r   rK   r  W  rL   r   rK   r   ro   rR   c                     t                      r   r[   rk  s    r   r]   zaComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>._factory_  r^   r   rS   rp   rT   rC   rq   rj   rr   r  r   r#   r  r-   ru   r)   rv   rs   r1   r,   rb   r   rw   rn  r   rR   ra   )r   rC   rj   r  rK   rV   rc  _blankrW   r]   r3   r"   r   r+  r   r   rz   s                    r   ?test_registerSubscriptionAdapter_w_explicit_provided_n_requiredzOComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_requiredR  s   >>>>>>888888DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	( 	( 	( }}++-- 	9 	9,,Xw27 - 9 9 9	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 m(+D1$7?S1%%%c!fh'''9 7D&(EBC	E 	E 	EWq)))1:bR   eZ000el,DEEEel+T222el+T222.888*F333el'///el*H55555rp  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                      }
|                                 }|                                 \  }}|5  |	                    |
|f|           d d d            n# 1 swxY w Y   |j
        j        d         |         |         |	         }|                     t          |          d           |                     |d         |
           |                     |j        |f||	|
|fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        |	           |                     |j        j        |           |                     |j        j        |
           d S )Nr   rB   r{  ri   r  c                       e Zd ZdS )SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rR   ro   c                       e Zd ZdS )WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrH   r'   r   r   rv  r    rQ   r   rv  rS   rp   )rT   rC   r|  rq   rj   rr   r  r   r#   r  r-   ru   r)   rv   rs   r1   r,   rb   r   rw   rn  r   rR   ra   )r   rC   r|  rj   r  rK   rV   rc  rW   r  rv  r3   r"   r   r+  r   r   rz   s                     r   5test_registerSubscriptionAdapter_wo_explicit_providedzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_providedy  s!   >>>>>>;;;;;;888888DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	T			 	 	 	 	 	 	 
		 }}++-- 	L 	L,,XwU,KKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	Lm(+D1$7?S1%%%c!fh'''9 7D&(EBC	E 	E 	EWq)))1:bR   eZ000el,DEEEel+T222el+T222.888*F333el'///el*H55555s   B22B69B6c                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d          d}d	} G fd
d          }|                                 }	|                                 \  }
}|
5  |	                    |||           d d d            n# 1 swxY w Y   |	j	        j
        d                  |         |         }|                     t          |          d           |                     |d         |           |                     |	j        f||||fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |	           |                     |j        j        |           |                     |j        j        f           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |           d S )Nr   rB   ri   r  c                       e Zd ZdS )SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rR   ro   c                       e Zd Z fZdS )WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rv  r    r  r   rv  )rw   rR   rp   r  )r   rC   rj   r  rK   rV   rW   r  rv  r3   r"   r   r+  r   r   rz   rc  s                   @r   5test_registerSubscriptionAdapter_wo_explicit_requiredzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required  s   >>>>>>888888DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ }}++-- 	 	,,4e -   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 m(+D1$7?S1%%%c!fh'''9 7D&(EBC	E 	E 	EWq)))1:bR   eZ000el,DEEEel+T222el+T222.888*F333el'///el*H55555s   8BB!$B!c                 j   ddl m}  G d d|          } |d          } |d          }d}d }|                                 }|                                 \  }}	|5  |                    ||f||d	           d d d            n# 1 swxY w Y   |                     t          |	          d           d S )
Nr   rB   c                       e Zd ZdS )GComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   rR   c                     t                      r   r[   rk  s    r   r]   zKComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>._factory  r^   r   FrR   rz   )rT   rC   r   r#   r  r)   rv   )
r   rC   rK   rV   rc  rW   r]   r3   r"   r   s
             r   )test_registerSubscriptionAdapter_wo_eventz9ComponentsTests.test_registerSubscriptionAdapter_wo_event  sP   >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	( 	( 	( }}++-- 	F 	F,,Xw27u - F F F	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	Wq)))))s   BB	B	c                     |                                  }|                     t          |                                          g            d S r   )r   r)   r   registeredSubscriptionAdaptersr;   s     r   )test_registeredSubscriptionAdapters_emptyz9ComponentsTests.test_registeredSubscriptionAdapters_empty  s?    }}dAACCDDbIIIIIr   c                 ,   ddl m} ddlm}  G d d|          } |d          } |d          }d}d} G d d	          }|                                 }	|	                    ||f||
           |	                    ||f||
           t          |	                                          }
|                     t          |
          d           | 
                    |
d         |           |                     |
d         j        |	           |                     |
d         j        |           |                     |
d         j        |f           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j        |           | 
                    |
d         |           |                     |
d         j        |	           |                     |
d         j        |           |                     |
d         j        |f           |                     |
d         j        |           |                     |
d         j        |           |                     |
d         j        |           d S )Nr   rB   r  c                       e Zd ZdS )JComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   rR   ro   c                       e Zd ZdS )NComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>._FactoryNrH   r'   r   r   rv  r    rL   r   rv  rS   r   rp   )rT   rC   rr   r  r   r  r   r  r)   rv   r,   rs   r   rw   rn  r   rR   ra   )r   rC   r  rK   rV   rc  rW   r  rv  r3   r+  s              r   ,test_registeredSubscriptionAdapters_notemptyz<ComponentsTests.test_registeredSubscriptionAdapters_notempty  s   >>>>>>DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}((D7Du(MMM((D7Du(MMM4668899S1%%%c!f&>???c!fot,,,c!fot,,,Q4'222Qf---c!fk5)))c!fnh///c!f&>???c!fot,,,c!fot,,,Q4'222Qf---c!fk5)))c!fnh/////r   c                     ddl m}  G d d|          } |d          } |d          }d}|                                 }|                     t          |j        |||           d S )Nr   rB   c                       e Zd ZdS )PComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   nonblank)rn  rw   r   rT   rC   r   rc   rd   unregisterSubscriptionAdapter)r   rC   rK   rV   rc  	_nonblankr3   s          r   2test_unregisterSubscriptionAdapter_w_nonblank_namezBComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name  s    >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	}})T%G#'$Y 	 	H 	H 	H 	H 	Hr   c                 t    |                                  }|                     t          |j        d d            d S r  )r   rc   rd   r  r;   s     r   ?test_unregisterSubscriptionAdapter_neither_factory_nor_providedzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_provided  sB    }})T%G"& 	 	7 	7 	7 	7 	7r   c                     ddl m}  G d d|          } |d          }|                                 }|                     t          |j        d |d            d S )Nr   rB   c                       e Zd ZdS )]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r  r  r1  s        r   ?test_unregisterSubscriptionAdapter_neither_factory_nor_requiredzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}})T%G"& 	 	F 	F 	F 	F 	Fr   c                    ddl m}  G d d|          } |d          } |d          } G d d          }|                                 }|                                 \  }}|5  |                    ||f|          }	d d d            n# 1 swxY w Y   |                     |	           |                     |           d S )Nr   rB   c                       e Zd ZdS )EComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>.IFooNrH   r'   r   r   rK   r  $  rL   r   rK   r   c                       e Zd ZdS )IComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>._FactoryNrH   r'   r   r   rv  r  *  rL   r   rv  )rT   rC   r   r#   r  r   r  s
             r   'test_unregisterSubscriptionAdapter_missz7ComponentsTests.test_unregisterSubscriptionAdapter_miss!  sZ   >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}++-- 	P 	P66x$$OOE	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P!!!!!r  c                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d          } G d d	          }|                                 }|                    ||f|           |                                 \  }	}
|	5  |	                    d |f|          }d d d            n# 1 swxY w Y   | 
                    |           |                     |j        j                   |                     |j                   |                     t!          |
          d
           |
d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j                   d S )Nr   rB   r   r  c                       e Zd ZdS )OComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>.IFooNrH   r'   r   r   rK   r   9  rL   r   rK   r   c                       e Zd ZdS )SComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>._FactoryNrH   r'   r   r   rv  r  ?  rL   r   rv  rp   ro   )rT   rC   rq   r   rr   r  r   r  r#   r  r   r   r-   ru   r1   r)   rv   r,   rb   rs   r   rw   rn  r   rR   rx   ra   r   rC   r   r  rK   rV   rc  rv  r3   r"   r   r   r   r   rz   s                  r   1test_unregisterSubscriptionAdapter_hit_wo_factoryzAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory4  s   >>>>>>::::::DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}((D7DAAA++-- 	L 	L66tdWdKKE	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L34449:::Wq)))1:bR   e\222el,DEEEel+T222el+T222.888*B///*B///%,./////r  c                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d          } G d d	          }|                                 }|                    ||f|           |                                 \  }	}
|	5  |	                    ||f|          }d d d            n# 1 swxY w Y   | 
                    |           |                     |j        j                   |                     |j                   |                     t!          |
          d
           |
d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |           d S )Nr   rB   r   r  c                       e Zd ZdS )NComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>.IFooNrH   r'   r   r   rK   r  \  rL   r   rK   r   c                       e Zd ZdS )RComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>._FactoryNrH   r'   r   r   rv  r	  b  rL   r   rv  rp   ro   )rT   rC   rq   r   rr   r  r   r  r#   r  r   r   r-   ru   r1   r)   rv   r,   rb   rs   r   rw   rn  r   rR   ra   r  s                  r   0test_unregisterSubscriptionAdapter_hit_w_factoryz@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factoryW  s   >>>>>>::::::DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}((D7DAAA++-- 	P 	P66x$$OOE	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P34449:::Wq)))1:bR   e\222el,DEEEel+T222el+T222.888*B///*B///el*H55555r  c                 @   ddl m} ddl m} ddlm} ddlm}  G d d|          } |d          } |d          } ||           G d	 d
                      }|                                 }	|	                    ||f|           | 	                                \  }
}|
5  |	
                    ||f          }d d d            n# 1 swxY w Y   |                     |           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |	           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |           d S )Nr   rB   r{  r   r  c                       e Zd ZdS )UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd ZdS )YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrH   r'   r   r   rv  r    rQ   r   rv  rp   ro   )rT   rC   r|  rq   r   rr   r  r   r  r#   r  r   r)   rv   r,   rb   rs   r   rw   rn  r   rR   ra   )r   rC   r|  r   r  rK   rV   rc  rv  r3   r"   r   r   r   r   rz   s                   r   7test_unregisterSubscriptionAdapter_wo_explicit_providedzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_providedz  s   >>>>>>;;;;;;::::::DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	T			 	 	 	 	 	 	 
		 }}((D7DAAA++-- 	J 	J66x$IIE	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	JWq)))1:bR   e\222el,DEEEel+T222el+T222.888*B///*B///el*H55555r  c                    ddl m} ddlm} ddlm}  G d d|          } |d          } |d           G fdd	          }|                                 }|                    |f|           |                                 \  }}	|5  |	                    ||
          }
d d d            n# 1 swxY w Y   | 
                    |
           |                     t          |	          d           |	d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |           |                     |j        j        f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |           d S )Nr   rB   r   r  c                       e Zd ZdS )UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd Z fZdS )YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rv  r    r  r   rv  r  rp   ro   )rT   rC   rq   r   rr   r  r   r  r#   r  r   r)   rv   r,   rb   rs   r   rw   rn  r   rR   ra   )r   rC   r   r  rK   rV   rv  r3   r"   r   r   r   r   rz   rc  s                 @r   7test_unregisterSubscriptionAdapter_wo_explicit_requiredzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required  s   >>>>>>::::::DDDDDD	 	 	 	 	> 	 	 	 tF||tF||	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ }}((D7DAAA++-- 	P 	P66x$6OOE	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	PWq)))1:bR   e\222el,DEEEel+T222el+T222.888*B///*B///el*H55555r  c                 N   ddl m} ddl m}  G d d|          } |d          } |d          }|                                 } ||           G d d                      } |            }|                     t          |                    |f|                    g            d S )	Nr   rB   r{  c                       e Zd ZdS )4ComponentsTests.test_subscribers_empty.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   r   c                       e Zd ZdS )3ComponentsTests.test_subscribers_empty.<locals>.BarNrH   r'   r   r   Barr    rQ   r   r  )rT   rC   r|  r   r)   r   subscribers)	r   rC   r|  rK   rV   rc  r3   r  bars	            r   test_subscribers_emptyz&ComponentsTests.test_subscribers_empty  s    >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||}}	T			 	 	 	 	 	 	 
		 ceed..vt<<==rBBBBBr   c                    ddl m} ddl m}  G d d|          } |d          } |d           G fdd          } G d	 d
|          }|                                 }|                    |f|           |                    |f|            |           G d d                      } |            }	|                    |	f|          }
d }t          |
|          }
|                     t          |
          d           | 	                    |
d         |           | 	                    |
d         |           d S )Nr   rB   r{  c                       e Zd ZdS )8ComponentsTests.test_subscribers_non_empty.<locals>.IFooNrH   r'   r   r   rK   r"    rL   r   rK   r   c                       e Zd Z fZd ZdS )<ComponentsTests.test_subscribers_non_empty.<locals>._Factoryc                     || _         d S r   )r  r  s     r   r  zEComponentsTests.test_subscribers_non_empty.<locals>._Factory.__init__  s     'r   N)r*   rI   rJ   r  r  r  s   r   rv  r$    s,        $(7 ( ( ( ( (r   rv  c                       e Zd ZdS )<ComponentsTests.test_subscribers_non_empty.<locals>._DerivedNrH   r'   r   r   _Derivedr'    rL   r   r(  c                       e Zd ZdS )7ComponentsTests.test_subscribers_non_empty.<locals>.BarNrH   r'   r   r   r  r*    rQ   r   r  c                     | j         j        S r   )r   r*   xs    r   
_klassnamez>ComponentsTests.test_subscribers_non_empty.<locals>._klassname  s    ;''r   r(  r   rp   )
rT   rC   r|  r   r  r  r*  r)   rv   r,   )r   rC   r|  rK   rV   rv  r(  r3   r  r  r  r.  rc  s               @r   test_subscribers_non_emptyz*ComponentsTests.test_subscribers_non_empty  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||	( 	( 	( 	( 	( 	( 	( 	( 	( 	(	 	 	 	 	x 	 	 	 }}((D7DAAA((D7DAAA	T			 	 	 	 	 	 	 
		 cee&&vt44	( 	( 	( [j999[))1---k!nh777k!nh77777r   c                     ddl m}  G d d|          } |d          }d}|                                 }d }|                     t          |j        |||           d S )Nr   rB   c                       e Zd ZdS )BComponentsTests.test_registerHandler_w_nonblank_name.<locals>.IFooNrH   r'   r   r   rK   r2    rL   r   rK   r  c                     t                      r   r[   rk  s    r   r]   zFComponentsTests.test_registerHandler_w_nonblank_name.<locals>._factory 	  r^   r   rn  r   )rT   rC   r   rc   rd   registerHandler)r   rC   rK   rV   r  r3   r]   s          r   $test_registerHandler_w_nonblank_namez4ComponentsTests.test_registerHandler_w_nonblank_name  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	}}	( 	( 	( 	)T%98#'i 	 	9 	9 	9 	9 	9r   c                 b   ddl m} ddlm} ddlm}  G d d|          } |d          }d}d}d	 }|                                 }	|                                 \  }
}|
5  |	                    ||f|
           d d d            n# 1 swxY w Y   |	j	        j
        d         |         d          |         }|                     t          |          d           |                     |d         |           |                     |	j        |f|||fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |	           |                     |j        j        |f           |                     |j        j        |           |                     |j        j        |           |                     |j        j        |           d S )Nr   rB   ri   HandlerRegistrationc                       e Zd ZdS )FComponentsTests.test_registerHandler_w_explicit_required.<locals>.IFooNrH   r'   r   r   rK   r;  	  rL   r   rK   ro   rR   c                     t                      r   r[   rk  s    r   r]   zJComponentsTests.test_registerHandler_w_explicit_required.<locals>._factory	  r^   r   rS   rp   )rT   rC   rq   rj   rr   r9  r   r#   r5  r-   ru   r)   rv   rs   r2   r,   rb   r   rn  r   rR   ra   )r   rC   rj   r9  rK   rV   r  rW   r]   r3   r"   r   r+  r   r   rz   s                   r   (test_registerHandler_w_explicit_requiredz8ComponentsTests.test_registerHandler_w_explicit_required	  s   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||	( 	( 	( }}++-- 	@ 	@  D7 ???	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@m(+D1$7?S1%%%c!fh'''4 7FHe<=	? 	? 	?Wq)))1:bR   eZ000el,?@@@el+T222.888*F333el'///el*H55555s    BB
B
c                 t  
 ddl m}  G d d|          } |d          
d}d} G 
fdd          }|                                 }|                                 \  }}|5  |                    ||d	
           d d d            n# 1 swxY w Y   |j        j        d         
         d          |         }	|                     t          |	          d           | 	                    |	d         |           |                     |j
        
f|||fg           |                     t          |          d           d S )Nr   rB   c                       e Zd ZdS )PComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>.IFooNrH   r'   r   r   rK   r@  -	  rL   r   rK   rR   ro   c                       e Zd Z fZdS )TComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>._FactoryNr  rV   s   r   rv  rB  4	  s        $(7 Dr   rv  Fr  rp   )rT   rC   r   r#   r5  r-   ru   r)   rv   rs   r2   )r   rC   rK   rW   r  rv  r3   r"   r   r+  rV   s             @r   2test_registerHandler_wo_explicit_required_no_eventzBComponentsTests.test_registerHandler_wo_explicit_required_no_event*	  s   >>>>>>	 	 	 	 	> 	 	 	 tF||	 	 	 	 	 	 	 	 	 	 }}++-- 	D 	D  U CCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	Dm(+D1$7?S1%%%c!fh'''4 7FHe<=	? 	? 	?Wq)))))s   !BB
B
c                     |                                  }|                     t          |                                                     d S r   )r   r   r   registeredHandlersr;   s     r   test_registeredHandlers_emptyz-ComponentsTests.test_registeredHandlers_emptyC	  s=    }}d55778899999r   c                    ddl m} ddlm}  G d d|          } |d          }d }d }|                                 }|                    ||f           |                    ||f           d }t          |                                |	          }	|                     t          |	          d
           | 
                    |	d         |           |                     |	d         j        |f           |                     |	d         j        d           |                     |	d         j        |           |                     |	d         j        d           | 
                    |	d         |           |                     |	d         j        |f           |                     |	d         j        d           |                     |	d         j        |           |                     |	d         j        d           d S )Nr   rB   r8  c                       e Zd ZdS )?ComponentsTests.test_registeredHandlers_non_empty.<locals>.IFooNrH   r'   r   r   rK   rJ  K	  rL   r   rK   c                     t                      r   r[   rk  s    r   	_factory1zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory1P	  r^   r   c                     t                      r   r[   rk  s    r   	_factory2zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory2S	  r^   r   c                 $    | j         j        j        S r   )ra   __code__co_namer,  s    r   _factory_namezHComponentsTests.test_registeredHandlers_non_empty.<locals>._factory_nameZ	  s    9%--r   r(  r   ro   rp   )rT   rC   rr   r9  r   r5  r*  rF  r)   rv   r,   rn  r   ra   rR   )
r   rC   r9  rK   rV   rL  rN  r3   rR  r  s
             r   !test_registeredHandlers_non_emptyz1ComponentsTests.test_registeredHandlers_non_emptyG	  s1   >>>>>>??????	 	 	 	 	> 	 	 	 tF||	( 	( 	(	( 	( 	( }}Y000Y000	. 	. 	. T4466MJJJ[))1---k!n.ABBBQ04':::Q,b111Q/;;;Q,b111k!n.ABBBQ04':::Q,b111Q/;;;Q,b11111r   c                     ddl m}  G d d|          } |d          }d}|                                 }|                     t          |j        |f|           d S )Nr   rB   c                       e Zd ZdS )DComponentsTests.test_unregisterHandler_w_nonblank_name.<locals>.IFooNrH   r'   r   r   rK   rV  m	  rL   r   rK   r  r4  )rT   rC   r   rc   rd   unregisterHandler)r   rC   rK   rV   r  r3   s         r   &test_unregisterHandler_w_nonblank_namez6ComponentsTests.test_unregisterHandler_w_nonblank_namej	  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	}})T%;$(7 	 	< 	< 	< 	< 	<r   c                 n    |                                  }|                     t          |j                   d S r   )r   rc   rd   rW  r;   s     r   3test_unregisterHandler_neither_factory_nor_requiredzCComponentsTests.test_unregisterHandler_neither_factory_nor_requiredv	  s.    }})T%;<<<<<r   c                     ddl m}  G d d|          } |d          }|                                 }|                    |f          }|                     |           d S )Nr   rB   c                       e Zd ZdS )9ComponentsTests.test_unregisterHandler_miss.<locals>.IFooNrH   r'   r   r   rK   r]  }	  rL   r   rK   rn  )rT   rC   r   rW  r   )r   rC   rK   rV   r3   r   s         r   test_unregisterHandler_missz+ComponentsTests.test_unregisterHandler_missz	  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}&&&88r   c                    ddl m} ddlm} ddlm}  G d d|          } |d          }|                                 }d }|                                 }|                    ||f           |                                 \  }}	|5  |	                    ||f          }
d d d            n# 1 swxY w Y   | 
                    |
           |                     t          |	          d           |	d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d	           |                     |j        j        |           d S )
Nr   rB   r   r8  c                       e Zd ZdS )XComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   rb  	  rL   r   rK   c                     t                      r   r[   rk  s    r   r]   z\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>._factory	  r^   r   rp   ro   )rT   rC   rq   r   rr   r9  r   r5  r#   rW  r   r)   rv   r,   rb   rs   r   rn  r   ra   r   rC   r   r9  rK   rV   r3   r]   r"   r   r   r   r   rz   s                 r   :test_unregisterHandler_hit_w_factory_and_explicit_providedzJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided	  s3   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||}}	( 	( 	( }}Xw///++-- 	> 	>**8dW==E	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>Wq)))1:bR   e\222el,?@@@el+T222.888*B///el*H55555   B++B/2B/c                    ddl m} ddlm} ddlm}  G d d|          } |d          }|                                 }d }|                                 }|                    ||f           |                                 \  }}	|5  |	                    |f          }
d d d            n# 1 swxY w Y   | 
                    |
           |                     t          |	          d	           |	d         \  }}|\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        |f           |                     |j        j        d
           |                     |j        j                   d S )Nr   rB   r   r8  c                       e Zd ZdS )QComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>.IFooNrH   r'   r   r   rK   ri  	  rL   r   rK   c                     t                      r   r[   rk  s    r   r]   zUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>._factory	  r^   r   r^  rp   ro   )rT   rC   rq   r   rr   r9  r   r5  r#   rW  r   r)   rv   r,   rb   rs   r   rn  r   rx   ra   rd  s                 r   3test_unregisterHandler_hit_w_only_explicit_providedzCComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided	  s4   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||}}	( 	( 	( }}Xw///++-- 	= 	=**TG*<<E	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=Wq)))1:bR   e\222el,?@@@el+T222.888*B///%,./////rf  c                    ddl m} ddlm} ddlm}  G d d|          } |d           G fdd          }|                                 }|                    |           |                                 \  }}|5  |	                    |          }	d d d            n# 1 swxY w Y   | 
                    |	           |                     t          |          d	           |d         \  }
}|
\  }|                     |i            |                     ||           |                     |j        |           |                     |j        j        |           |                     |j        j        f           |                     |j        j        d
           |                     |j        j        d
           |                     |j        j        |           d S )Nr   rB   r   r8  c                       e Zd ZdS )IComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>.IFooNrH   r'   r   r   rK   rn  	  rL   r   rK   c                       e Zd Z fZdS )MComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>._FactoryNr  rC  s   r   rv  rp  	  r  r   rv  rp   ro   )rT   rC   rq   r   rr   r9  r   r5  r#   rW  r   r)   rv   r,   rb   rs   r   rn  r   rR   ra   )r   rC   r   r9  rK   rv  r3   r"   r   r   r   r   rz   rV   s                @r   +test_unregisterHandler_wo_explicit_requiredz;ComponentsTests.test_unregisterHandler_wo_explicit_required	  s]   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ }}X&&&++-- 	5 	5**844E	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5Wq)))1:bR   e\222el,?@@@el+T222.888*B///*B///el*H55555s   >B  B$'B$c                     ddl m} ddl m}  G d d|          } |d          }|                                 } ||           G d d                      } |            }|                    |f           d S )Nr   rB   r{  c                       e Zd ZdS )/ComponentsTests.test_handle_empty.<locals>.IFooNrH   r'   r   r   rK   rt  	  rL   r   rK   c                       e Zd ZdS ).ComponentsTests.test_handle_empty.<locals>.BarNrH   r'   r   r   r  rv  	  rQ   r   r  )rT   rC   r|  r   handle)r   rC   r|  rK   rV   r3   r  r  s           r   test_handle_emptyz!ComponentsTests.test_handle_empty	  s    >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||}}	T			 	 	 	 	 	 	 
		 ceeSFr   c                   
 ddl m} ddl m}  G d d|          } |d          }g 

fd}g fd}|                                 }|                    ||f           |                    ||f            ||           G d d	                      } |            }	|                    |	           |                     
|	g           |                     |	g           d S )
Nr   rB   r{  c                       e Zd ZdS )3ComponentsTests.test_handle_non_empty.<locals>.IFooNrH   r'   r   r   rK   r{  	  rL   r   rK   c                 2                         |            d S r   r   )rl  	_called_1s    r   
_factory_1z9ComponentsTests.test_handle_non_empty.<locals>._factory_1	      W%%%%%r   c                 2                         |            d S r   r   )rl  	_called_2s    r   
_factory_2z9ComponentsTests.test_handle_non_empty.<locals>._factory_2
  r  r   c                       e Zd ZdS )2ComponentsTests.test_handle_non_empty.<locals>.BarNrH   r'   r   r   r  r  	
  rQ   r   r  )rT   rC   r|  r   r5  rw  r)   )r   rC   r|  rK   rV   r~  r  r3   r  r  r}  r  s             @@r   test_handle_non_emptyz%ComponentsTests.test_handle_non_empty	  sp   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||		& 	& 	& 	& 	& 		& 	& 	& 	& 	& }}Z$111Z$111	T			 	 	 	 	 	 	 
		 ceeCSE***SE*****r   Tc                 <    G d dt                     }|                                 }t                      }|r|nt                      }|                    ||           |                    ||d           |                     t          |j        j                  d           |                     |j        j        |d|r|fn||fiig           |                     |j        j        ||rdnd	i           |	                    ||          }| 
                    |           |	                    ||d          }| 
                    |           |                     |j        j        i            |                     t          |j        j                  d
           d S )Nc                       e Zd ZdS )QComponentsTests.test_register_unregister_identical_objects_provided.<locals>.IFooNrH   r'   r   r   rK   r  
  rL   r   rK   r  r  r   rp   ro   r      r   )r   r   rb   rU   r)   rv   r.   ru   	_providedr   r   )r   	identicalrK   r3   firstsecondress          r   3test_register_unregister_identical_objects_providedzCComponentsTests.test_register_unregister_identical_objects_provided
  s   	 	 	 	 	9 	 	 	 }}#1UT222Vd???T^8991===42IByyE6?C8
 7 	 	 	 	1y'!!a4
 	 	 	 $$UT$::$$Vd$GG12666T^8991=====r   c                 2    |                      d           d S )NF)r  )r  r   s    r   2test_register_unregister_nonequal_objects_providedzBComponentsTests.test_register_unregister_nonequal_objects_provided0
  s-    @@ 	A 	
 	
 	
 	
 	
r   c                 x	    G d dt                     } G d d          }|                                 }t          d          D ]#}|                     |            ||            $|j        j        }|j        j        }|                     t          |          d           |                     t          |d                   d           |                     t          |d         |                   d           |j        j	        }|                     t          |          d           |                     t          |d                   d           |                     t          |d         |                   d           |                     t          |d         |         d	                   d            t          |                      x}|j        _        |                    i            i x}	|d         |<   t          d
          D ]5}
t          t          |
                    }
|d         |         |
         |	|
<   6|                     ||            t          |                      x}|j        _	        |                    i            i x}	|d         |<   d|	d	<   t          dd          D ]C}
t          t          |
                    }
|d         |         |
         }|	d	xx         |fz  cc<   D|                                }|                     |j        j        |           |                     |d
dddd           |                    d          }|                     |j        j        |dz              |                     ||           |                     ||           |                     t          |d         |         d	                   t          |d         |         d	                              |d         |         d	         D ]*}|                     ||d         |         d	                    +|                                }|                     |ddddd           |                    d          }|                     ||           |                     |j        j        |dz              d S )Nc                       e Zd ZdZdS )GComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.IFooDoes nothingNr*   rI   rJ   __doc__r'   r   r   rK   r  7
          NNNr   rK   c                       e Zd ZdZdS )YComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.UtilityImplementingFoor  Nr  r'   r   r   UtilityImplementingFoor  :
  r  r   r     r$  rp   r   ro   
   r'                  )did_not_registerneeded_registereddid_not_subscribeneeded_subscribedT)rebuild)r   r   rangerU   r.   _generationrt   r)   rv   ru   typer   strassertNotEqual$rebuildUtilityRegistryFromLocalCacheassertIn)r   rK   r  compsiorig_generationorig_adaptersorig_subscribersnew_adaptersdr   new_subsr3   rebuild_preflightrebuild_resultsorig_subscriberpreflight_afterrebuild_afters                     r   )test_rebuildUtilityRegistryFromLocalCachez9ComponentsTests.test_rebuildUtilityRegistryFromLocalCache5
  s   	 	 	 	 	9 	 	 		 	 	 	 	 	 	 	 r 	 	A!!&&(($V "      /51]++Q///]1-..222]1-d344b999 ?7-..222-a0111555-a0677;;;-a06r:;;R@@@ 4G43F3F3H3HHu0B$&&LOD!"II 	3 	3Ds4yy>>D#A&t,T2AdGGM<8882H$7G2H2H2J2JJ5?/ ""HQK"!RLL 	 	Ds4yy>>D #D)$/DbEEEdWEEEE "FFHH4oFFF* "!#!"!#-
 -
 	 	 	  DD E 
 

 	4o6IJJJ*O<<<}555D!"%&& #D)"-..	0 	0 	0  0248< 	B 	BOMM/8A;t+<R+@AAAA  DDFF "!"!#!"+
 +
 	 	 	 BB C 
 
 	8884o6IJJJJJr   )r   )T)vr*   rI   rJ   r   r   r#   r4   r7   r<   r@   rX   rg   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  r9  r>  rE  rI  rN  rS  rX  r\  rd  ro  ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r-  rE  rU  r]  rn  rw  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=  rD  rG  rS  rX  rZ  r_  re  rk  rq  rx  r  r  r  r  r   r   s   @r   r	   r	      s|         9 9 9 9     : : :F F F= = =	= 	= 	=     ,? ? ?0 0 0B6 6 6B
M 
M 
M 0  0  0D* * *"% % %,1 1 12(0 (0 (0TO O O$* * * C C C2C C C@G G G
? ? ?" " " 0 0 0@ 6  6  6D"0 "0 "0H#0 #0 #0JO O O&O O O&O O O.> > >8( ( (*( ( (.? ? ?* * *@3 3 3	K 	K 	K
8 
8 
8	G 	G 	G
6 
6 
6? ? ?A A A L L L$ $ $   ,$6 $6 $6L2 2 2"'6 '6 '6RA A A$G G G$(6 (6 (6T/6 /6 /6b  (&6 &6 &6P* * *(7 7 7
	F 	F 	F     $!6 !6 !6F!6 !6 !6F6 6 6B> > >"0 "0 "0H	= 	= 	=
 
 
1 1 12; ; ;(1 1 12*0 *0 *0 *0 *0X00 00 00 00 00d  0
 
 
:B B B@N N N4B B B@5 5 5-1 -1 -1 -1 -1^F F F2A A AB(6 (6 (6TA A A$%6 %6 %6N&6 &6 &6P&6 &6 &6P* * *(J J J!0 !0 !0FH H H7 7 7
	F 	F 	F" " "&!0 !0 !0F!6 !6 !6F!6 !6 !6F6 6 6BC C C$$8 $8 $8L9 9 9 "6 "6 "6H* * *2: : :!2 !2 !2F
< 
< 
<= = =	  	  	 6 6 6>0 0 0>6 6 6>  "+ + +@ > > > ><
 
 

[K [K [K [K [K [K [Kr   r	   c                        e Zd Z fdZ xZS )UnhashableComponentsTestsc                 z     G d dt          t          |                                           t                    }|S )Nc                       e Zd ZdS )=UnhashableComponentsTests._getTargetClass.<locals>.ComponentsNrH   r'   r   r   r   r  
  s         Dr   r   )r   r  r   r   )r   r   r   s     r   r   z)UnhashableComponentsTests._getTargetClass
  sO    	 	 	 	 	+T22BBDDd	 	 	
 r   )r*   rI   rJ   r   r   r   s   @r   r  r  
  s8        	 	 	 	 	 	 	 	 	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S )UtilityRegistrationTestsc                     ddl m} |S )Nr   rk   )rr   rl   )r   rl   s     r   r   z(UtilityRegistrationTests._getTargetClass
      ??????""r   Nc                     ddl m}  G d d|          } |d          } G d d          } |            }d}d	}	|                                 }
 |
|||||	|          ||fS )
Nr   rB   c                       e Zd ZdS )AUtilityRegistrationTests._makeOne.<locals>.InterfaceClassSubclassNrH   r'   r   r   InterfaceClassSubclassr  
  rL   r   r  rK   c                       e Zd Zd ZdS )4UtilityRegistrationTests._makeOne.<locals>._Registryc                     dS N	_REGISTRYr'   r   s    r   __repr__z=UtilityRegistrationTests._makeOne.<locals>._Registry.__repr__
      "{r   Nr*   rI   rJ   r  r'   r   r   	_Registryr  
  #        # # # # #r   r  r   	DOCSTRINGrT   rC   r   )r   r`   ra   rC   r  rV   r  r   r   docklasss              r   r   z!UtilityRegistrationTests._makeOne
  s    >>>>>>	 	 	 	 	^ 	 	 	 &%f--	# 	# 	# 	# 	# 	# 	# 	# 9;;$$&&E(D$	3@@
 	
r   c                 Z    ddl m} ddlm}  |||                                            d S )Nr   IUtilityRegistrationverifyClass)rq   r  zope.interface.verifyr  r   )r   r  r  s      r   +test_class_conforms_to_IUtilityRegistrationzDUtilityRegistrationTests.test_class_conforms_to_IUtilityRegistration
  K    BBBBBB555555($*>*>*@*@AAAAAr   c                 f    ddl m} ddlm} |                                 \  }}} |||           d S )Nr   r  verifyObject)rq   r  r  r  r   )r   r  r  ur_s        r   .test_instance_conforms_to_IUtilityRegistrationzGUtilityRegistrationTests.test_instance_conforms_to_IUtilityRegistration
  R    BBBBBB666666==??Aq)2.....r   c                      G d d          } |            }|                      |          \  }}}|                     t          |          d|z             d S )Nc                       e Zd ZdZ dS ):UtilityRegistrationTests.test___repr__.<locals>._ComponentTESTNrH   r'   r   r   
_Componentr  
          HHHr   r  zAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')r9   r   r  
_componentr  	_registryry   s         r   r<   z&UtilityRegistrationTests.test___repr__
  s    	 	 	 	 	 	 	 	  Z\\
#}}Z88IuHH@	
 	
 	
 	
 	
r   c                      G d d          } |            }|                      |          \  }}}t                      |_        |                     t	          |          d|z             d S )Nc                       e Zd Zd ZdS )KUtilityRegistrationTests.test___repr___provided_wo_name.<locals>._Componentc                     dS Nr  r'   r   s    r   r  zTUtilityRegistrationTests.test___repr___provided_wo_name.<locals>._Component.__repr__
      vr   Nr  r'   r   r   r  r  
  #            r   r  AUtilityRegistration(_REGISTRY, None, %r, TEST, None, 'DOCSTRING')r   rb   rw   r)   r:   r  s         r   test___repr___provided_wo_namez7UtilityRegistrationTests.test___repr___provided_wo_name
      	 	 	 	 	 	 	 	  Z\\
#}}Z88IuhhHH@	
 	
 	
 	
 	
r   c                      G d d          } |            }|                      |          \  }}}t                      |_        |                     t	          |          d|z             d S )Nc                       e Zd Zd ZdS )LUtilityRegistrationTests.test___repr___component_wo_name.<locals>._Componentc                     dS 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                      }|                     |          \  }}}|                     |                                t	          |                     d S r   rb   r   r)   __hash__idr   r  r  r  ry   s        r   test___hash__z&UtilityRegistrationTests.test___hash__
  M    XX
#}}Z88Iu2/////r   c                     t                      }|                     |          \  }}}|                     ||           d S r   rb   r   r)   r  s        r   test___eq___identityz-UtilityRegistrationTests.test___eq___identity
  ?    XX
#}}Z88IuR     r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  r   r  r  r  ry   ur2r  s          r   test___eq___hitz(UtilityRegistrationTests.test___eq___hit  V    XX
#}}Z88IuMM*--	QS!!!!!r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   rb   r   r  r   r  _component2r  r  ry   r  r  s           r   test___eq___missz)UtilityRegistrationTests.test___eq___miss	  _    XX
hh#}}Z88IuMM+..	QB$$$$$r   c                     t                      }|                     |          \  }}}|                     ||           d S r   r  r  s        r   test___ne___identityz-UtilityRegistrationTests.test___ne___identity  r
  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  r  s          r   test___ne___hitz(UtilityRegistrationTests.test___ne___hit  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  r  s           r   test___ne___missz)UtilityRegistrationTests.test___ne___miss  r  r   c                     t                      }|                     |          \  }}}|                     ||k                d S r   rb   r   r   r  s        r   test___lt___identityz-UtilityRegistrationTests.test___lt___identity"  A    XX
#}}Z88Iub!!!!!r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k                d S r   r  r  s          r   test___lt___hitz(UtilityRegistrationTests.test___lt___hit'  X    XX
#}}Z88IuMM*--	Qc"""""r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S N2rb   r   r   
assertLessr  s           r   test___lt___missz)UtilityRegistrationTests.test___lt___miss-  h    XX
hh#}}Z88IuMM+..	Q3;C     r   c                     t                      }|                     |          \  }}}|                     ||           d S r   rb   r   assertLessEqualr  s        r   test___le___identityz-UtilityRegistrationTests.test___le___identity5  ?    XX
#}}Z88IuR$$$$$r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r+  r  s          r   test___le___hitz(UtilityRegistrationTests.test___le___hit:  V    XX
#}}Z88IuMM*--	QR%%%%%r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  rb   r   r   r,  r  s           r   test___le___missz)UtilityRegistrationTests.test___le___miss@  j    XX
hh#}}Z88IuMM+..	Q3;R%%%%%r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r  r  s        r   test___gt___identityz-UtilityRegistrationTests.test___gt___identityH  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  rb   r   r   assertGreaterr  s           r   test___gt___hitz(UtilityRegistrationTests.test___gt___hitM  j    XX
hh#}}Z88IuMM+..	Q3;3#####r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  r  s          r   test___gt___missz)UtilityRegistrationTests.test___gt___missU  X    XX
#}}Z88IuMM*--	Qr"""""r   c                     t                      }|                     |          \  }}}|                     ||           d S r   rb   r   assertGreaterEqualr  s        r   test___ge___identityz-UtilityRegistrationTests.test___ge___identity[  ?    XX
#}}Z88IuB'''''r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r$  rb   r   r   r   r  s           r   test___ge___missz)UtilityRegistrationTests.test___ge___miss`  l    XX
hh#}}Z88IuMM+..	Q3;s#####r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  rb   r   r   rB  r  s          r   test___ge___hitz(UtilityRegistrationTests.test___ge___hith  a    XX
#}}Z88IuMM*--	Q3;R(((((r   )NN)r*   rI   rJ   r   r   r  r  r<   r  r  r  r	  r  r  r  r  r  r  r!  r(  r-  r0  r4  r7  r;  r>  rC  rG  rK  r'   r   r   r  r  
  s       # # #
 
 
 
,B B B
/ / /
 
 

 
 
 
 
 
 0 0 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dS )AdapterRegistrationTestsc                     ddl m} |S )Nr   rf  )rr   rg  )r   rg  s     r   r   z(AdapterRegistrationTests._getTargetClassr  r  r   Nc                     ddl m}  G d d|          } |d          } |d          } G d d          } |            }d}d	}	|                                 }
 |
||f||||	          ||fS )
Nr   rB   c                       e Zd ZdS )/AdapterRegistrationTests._makeOne.<locals>.IFooNrH   r'   r   r   rK   rR  y  rL   r   rK   r   c                       e Zd Zd ZdS )4AdapterRegistrationTests._makeOne.<locals>._Registryc                     dS r  r'   r   s    r   r  z=AdapterRegistrationTests._makeOne.<locals>._Registry.__repr__  r  r   Nr  r'   r   r   r  rT    r  r   r  r   r  r  r   r`   rC   rK   rV   rc  r  r   r   r  r  s              r   r   z!AdapterRegistrationTests._makeOnev      >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	# 	# 	# 	# 	# 	# 	# 	# 9;;$$&&E(TGT4C@@
 	
r   c                 Z    ddl m} ddlm}  |||                                            d S )Nr   IAdapterRegistrationr  )rq   rZ  r  r  r   )r   rZ  r  s      r   +test_class_conforms_to_IAdapterRegistrationzDAdapterRegistrationTests.test_class_conforms_to_IAdapterRegistration  r  r   c                 f    ddl m} ddlm} |                                 \  }}} |||           d S )Nr   rY  r  )rq   rZ  r  r  r   )r   rZ  r  arr  s        r   .test_instance_conforms_to_IAdapterRegistrationzGAdapterRegistrationTests.test_instance_conforms_to_IAdapterRegistration  r  r   c                      G d d          } |            }|                      |          \  }}}|                     t          |          d|z             d S )Nc                       e Zd ZdZ dS ):AdapterRegistrationTests.test___repr__.<locals>._Componentr  NrH   r'   r   r   r  ra    r  r   r  zCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')r9   r   r  r  r]  r  ry   s         r   r<   z&AdapterRegistrationTests.test___repr__  s    	 	 	 	 	 	 	 	  Z\\
#}}Z88IuHH	
 	
 	
 	
 	
r   c                      G d d          } |            }|                      |          \  }}}t                      |_        |                     t	          |          d|z             d S )Nc                       e Zd Zd ZdS )KAdapterRegistrationTests.test___repr___provided_wo_name.<locals>._Componentc                     dS r  r'   r   s    r   r  zTAdapterRegistrationTests.test___repr___provided_wo_name.<locals>._Component.__repr__  r  r   Nr  r'   r   r   r  re    r  r   r  CAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')r  rb  s         r   r  z7AdapterRegistrationTests.test___repr___provided_wo_name      	 	 	 	 	 	 	 	  Z\\
#}}Z88IuhhHH	
 	
 	
 	
 	
r   c                      G d d          } |            }|                      |          \  }}}t                      |_        |                     t	          |          d|z             d S )Nc                       e Zd Zd ZdS )LAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Componentc                     dS r  r'   r   s    r   r  zUAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Component.__repr__  r  r   Nr  r'   r   r   r  rk    r  r   r  rg  r  rb  s         r   r  z8AdapterRegistrationTests.test___repr___component_wo_name  rh  r   c                     t                      }|                     |          \  }}}|                     |                                t	          |                     d S r   r  r   r  r]  r  ry   s        r   r  z&AdapterRegistrationTests.test___hash__  r  r   c                     t                      }|                     |          \  }}}|                     ||           d S r   r  rn  s        r   r	  z-AdapterRegistrationTests.test___eq___identity  r
  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  r   r  r]  r  ry   ar2r  s          r   r  z(AdapterRegistrationTests.test___eq___hit  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  r   r  r  r]  r  ry   rr  r  s           r   r  z)AdapterRegistrationTests.test___eq___miss  r  r   c                     t                      }|                     |          \  }}}|                     ||           d S r   r  rn  s        r   r  z-AdapterRegistrationTests.test___ne___identity  r
  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  rq  s          r   r  z)AdapterRegistrationTests.test___ne___miss  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r  rt  s           r   test___ne___hit_componentz2AdapterRegistrationTests.test___ne___hit_component  r  r   c                     ddl m}  G d d|          } |d          }t                      }|                     |          \  }}}|                     |          \  }}	}	||_        |                     ||           d S )Nr   rB   c                       e Zd ZdS )?AdapterRegistrationTests.test___ne___hit_provided.<locals>.IFooNrH   r'   r   r   rK   r{    rL   r   rK   rI  )rT   rC   rb   r   rw   r  )
r   rC   rK   rR  r  r]  r  ry   rr  r  s
             r   test___ne___hit_providedz1AdapterRegistrationTests.test___ne___hit_provided  s    >>>>>>	 	 	 	 	> 	 	 	 tF||XX
#}}Z88IuMM*--	QB$$$$$r   c                    ddl m}  G d d|          } |d          }t                      }t                      }|                     |          \  }}}|                     |          \  }	}
}
|f|	_        |                     ||	           d S )Nr   rB   c                       e Zd ZdS )?AdapterRegistrationTests.test___ne___hit_required.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   rI  )rT   rC   rb   r   rn  r  )r   rC   rK   rR  r  r  r]  r  ry   rr  r  s              r   test___ne___hit_requiredz1AdapterRegistrationTests.test___ne___hit_required  s    >>>>>>	 	 	 	 	> 	 	 	 tF||XX
hh#}}Z88IuMM+..	QwB$$$$$r   c                     t                      }|                     |          \  }}}|                     ||k                d S r   r  rn  s        r   r  z-AdapterRegistrationTests.test___lt___identity
  r  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k                d S r   r  rq  s          r   r!  z(AdapterRegistrationTests.test___lt___hit  r"  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  r&  rt  s           r   r(  z)AdapterRegistrationTests.test___lt___miss  r)  r   c                     t                      }|                     |          \  }}}|                     ||           d S r   r+  rn  s        r   r-  z-AdapterRegistrationTests.test___le___identity  r.  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||           d S r   r+  rq  s          r   r0  z(AdapterRegistrationTests.test___le___hit"  r1  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  r3  rt  s           r   r4  z)AdapterRegistrationTests.test___le___miss(  r5  r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r  rn  s        r   r7  z-AdapterRegistrationTests.test___gt___identity0  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  r9  rt  s           r   r;  z(AdapterRegistrationTests.test___gt___hit5  r<  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  rq  s          r   r>  z)AdapterRegistrationTests.test___gt___miss=  r?  r   c                     t                      }|                     |          \  }}}|                     ||           d S r   rA  rn  s        r   rC  z-AdapterRegistrationTests.test___ge___identityC  rD  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r$  rF  rt  s           r   rG  z)AdapterRegistrationTests.test___ge___missH  rH  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||           d S r$  rJ  rq  s          r   rK  z(AdapterRegistrationTests.test___ge___hitP  rL  r   r   )r*   rI   rJ   r   r   r[  r^  r<   r  r  r  r	  r  r  r  r  rx  r|  r  r  r!  r(  r-  r0  r4  r7  r;  r>  rC  rG  rK  r'   r   r   rN  rN  p  s       # # #
 
 
 
.B B B
/ / /
 
 

 
 
 
 
 
 0 0 0
! ! !
" " "% % %! ! !
" " "% % %% % %% % %" " "
# # #! ! !% % %
& & && & &" " "
$ $ $# # #( ( (
$ $ $) ) ) ) )r   rN  c                   (    e Zd Zd ZddZd Zd ZdS )SubscriptionRegistrationTestsc                     ddl m} |S )Nr   r  )rr   r  )r   r  s     r   r   z-SubscriptionRegistrationTests._getTargetClassZ  s    DDDDDD''r   Nc                     ddl m}  G d d|          } |d          } |d          } G d d          } |            }d}d	}	|                                 }
 |
||f||||	          ||fS )
Nr   rB   c                       e Zd ZdS )4SubscriptionRegistrationTests._makeOne.<locals>.IFooNrH   r'   r   r   rK   r  a  rL   r   rK   r   c                       e Zd Zd ZdS )9SubscriptionRegistrationTests._makeOne.<locals>._Registryc                     dS r  r'   r   s    r   r  zBSubscriptionRegistrationTests._makeOne.<locals>._Registry.__repr__h  r  r   Nr  r'   r   r   r  r  g  r  r   r  r   r  r  rV  s              r   r   z&SubscriptionRegistrationTests._makeOne^  rW  r   c                 Z    ddl m} ddlm}  |||                                            d S )Nr    ISubscriptionAdapterRegistrationr  )rq   r  r  r  r   )r   r  r  s      r   7test_class_conforms_to_ISubscriptionAdapterRegistrationzUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistrationu  sK    NNNNNN5555554d6J6J6L6LMMMMMr   c                 f    ddl m} ddlm} |                                 \  }}} |||           d S )Nr   r  r  )rq   r  r  r  r   )r   r  r  sarr  s        r   :test_instance_conforms_to_ISubscriptionAdapterRegistrationzXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistrationz  sR    NNNNNN666666MMOO	Q5s;;;;;r   r   )r*   rI   rJ   r   r   r  r  r'   r   r   r  r  X  sX        ( ( (
 
 
 
.N N N
< < < < <r   r  c                   :    e Zd Zd Zd	dZd Zd Zd Zd Zd Z	dS )
HandlerRegistrationTestsc                     ddl m} |S )Nr   r8  )rr   r9  )r   r9  s     r   r   z(HandlerRegistrationTests._getTargetClass  r  r   Nc                     ddl m}  G d d|          } |d          } G d d          } |            }d}d}|                                 }	 |	||f|||          ||fS )	Nr   rB   c                       e Zd ZdS )/HandlerRegistrationTests._makeOne.<locals>.IFooNrH   r'   r   r   rK   r    rL   r   rK   c                       e Zd Zd ZdS )4HandlerRegistrationTests._makeOne.<locals>._Registryc                     dS r  r'   r   s    r   r  z=HandlerRegistrationTests._makeOne.<locals>._Registry.__repr__  r  r   Nr  r'   r   r   r  r    r  r   r  r   r  r  )
r   r`   rC   rK   rV   r  r   r   r  r  s
             r   r   z!HandlerRegistrationTests._makeOne  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	# 	# 	# 	# 	# 	# 	# 	# 9;;$$&&E(TGT9c::
 	
r   c                 Z    ddl m} ddlm}  |||                                            d S )Nr   IHandlerRegistrationr  )rq   r  r  r  r   )r   r  r  s      r   +test_class_conforms_to_IHandlerRegistrationzDHandlerRegistrationTests.test_class_conforms_to_IHandlerRegistration  r  r   c                 f    ddl m} ddlm} |                                 \  }}} |||           d S )Nr   r  r  )rq   r  r  r  r   )r   r  r  hrr  s        r   .test_instance_conforms_to_IHandlerRegistrationzGHandlerRegistrationTests.test_instance_conforms_to_IHandlerRegistration  r  r   c                     d }|                      |          \  }}}|                     |j        |           |                     |j        |j                   |                     |j                   d S )Nc                     t                      r   r[   rk  s    r   r]   z:HandlerRegistrationTests.test_properties.<locals>._factory  r^   r   )r   rs   handlerra   rx   rw   )r   r]   r  r  s       r   test_propertiesz(HandlerRegistrationTests.test_properties  sr    	( 	( 	(==**Aqbj(+++bj"*---"+&&&&&r   c                      G d d          }|                       |                      \  }}}|                     t          |          d|z             d S )Nc                       e Zd ZdZ dS )GHandlerRegistrationTests.test___repr___factory_w_name.<locals>._Factoryr  NrH   r'   r   r   rv  r    r  r   rv  =HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')r9   r   rv  r  r  ry   s        r   test___repr___factory_w_namez5HandlerRegistrationTests.test___repr___factory_w_name  s    	 	 	 	 	 	 	 	  $}}XXZZ88IuHH	 	 	 	 	r   c                      G d d          }|                       |                      \  }}}|                     t          |          d|z             d S )Nc                       e Zd Zd ZdS )HHandlerRegistrationTests.test___repr___factory_wo_name.<locals>._Factoryc                     dS r  r'   r   s    r   r  zQHandlerRegistrationTests.test___repr___factory_wo_name.<locals>._Factory.__repr__  r  r   Nr  r'   r   r   rv  r    r  r   rv  r  r9   r  s        r   test___repr___factory_wo_namez6HandlerRegistrationTests.test___repr___factory_wo_name  s    	 	 	 	 	 	 	 	  $}}XXZZ88IuHH	
 	
 	
 	
 	
r   r   )
r*   rI   rJ   r   r   r  r  r  r  r  r'   r   r   r  r    s        # # #
 
 
 
,B B B
/ / /' ' '
 
 

 
 
 
 
r   r  c                       e Zd Zd Zd ZdS )PersistentAdapterRegistryc                     | j                                         }t          |          D ]5}|| j        v s|                    d          r|                    |           6|                    dd            |S )N_vro)__dict__copyr   
_delegated
startswithpop)r   stateks      r   __getstate__z&PersistentAdapterRegistry.__getstate__  sq    ""$$e 	 	ADO##q||D'9'9#		!		$r   c                     |                     dd          }| j                            |           |                                  || _        | j                            |            d S )Nr+   r'   )r  r  update_createLookupr+   r  r  )r   r  basess      r   __setstate__z&PersistentAdapterRegistry.__setstate__  s`    		+r**U###t$$$$$r   N)r*   rI   rJ   r  r  r'   r   r   r  r    s2          % % % % %r   r  c                       e Zd Zd ZdS )PersistentComponentsc                 R    t                      | _        t                      | _        d S r   )r  r-   r.   r   s    r   _init_registriesz%PersistentComponents._init_registries  s     133244r   N)r*   rI   rJ   r  r'   r   r   r  r    s#        5 5 5 5 5r   r  c                       e Zd ZdS )PersistentDictComponentsNrH   r'   r   r   r  r    s        Dr   r  c                       e Zd Zd ZdS )PersistentComponentsDictc                 p    t                               |            t                              | |           d S r   )r   r  r  )r   r   s     r   r  z!PersistentComponentsDict.__init__  s0    d%%dD11111r   Nr  r'   r   r   r  r    s#        2 2 2 2 2r   r  c                   &    e Zd Zd Zd Zd Zd ZdS )TestPersistentComponentsc                      t          d          S )Nr   )r  r   s    r   r   z!TestPersistentComponents._makeOne  s    #F+++r   c                     d S r   r'   r   mades     r   _check_equality_after_picklez5TestPersistentComponents._check_equality_after_pickle  s    r   c                     dd l }|                                 }|                    |           |                    |                    |                    }|                     |j        d           d S Nr   r   )pickler   dumpsloadsr)   r*   )r   r  r3   comp2s       r   test_pickles_emptyz+TestPersistentComponents.test_pickles_empty  se    }}TV\\$//0000000r   c                    dd l }|                                 }t                      }|                    |t                     |                     ||                    t                               |                    |                    |                    }| 	                    |j
        d           |                     |                    t                               |                    |t                     |                     ||                    t                               |                     |           d S r  )r  r   rb   rU   r   rs   rD  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0	2 	2 	2 V\\$//00000 	U--i88999 		 	 	 	g&&y11	3 	3 	3 	))%00000r   N)r*   rI   rJ   r   r  r  r  r'   r   r   r  r    sP        , , ,  1 1 11 1 1 1 1r   r  c                        e Zd Zd Zd Zd ZdS )TestPersistentDictComponentsc                     t           S r   )r  r   s    r   r   z,TestPersistentDictComponents._getTargetClass      ''r   c                 L     |                                  d          }d|d<   |S )Nr   r$  *   r)  r   r;   s     r   r   z%TestPersistentDictComponents._makeOne"  s.    %t##%%6222Ur   c                 j    |                      d|           |                     |d         d           d S )Nr)  r  )r  r)   r  s     r   r  z9TestPersistentDictComponents._check_equality_after_pickle'  s6    eT"""eb)))))r   N)r*   rI   rJ   r   r   r  r'   r   r   r  r    sA        ( ( (  
* * * * *r   r  c                       e Zd Zd ZdS )TestPersistentComponentsDictc                     t           S r   )r  r   s    r   r   z,TestPersistentComponentsDict._getTargetClass.  r  r   N)r*   rI   rJ   r   r'   r   r   r  r  ,  s#        ( ( ( ( (r   r  c                        e Zd Zd Zd Zd ZdS )r!   c                     | _         fd|D             | _        |                                D ]\  }}t          ||           d S )Nc                 2    i | ]}|t          |          S r'   )getattr).0r)  modules     r   
<dictcomp>z$_Monkey.__init__.<locals>.<dictcomp>6  s%    CCC3 4 4CCCr   )r  
to_restoreitemssetattr)r   r  r   r)  values    `   r   r  z_Monkey.__init__4  s_    CCCCCCC((** 	( 	(JCFC''''	( 	(r   c                     | S r   r'   r   s    r   	__enter__z_Monkey.__enter__:  s    r   c                 p    | j                                         D ]\  }}t          | j        ||           d S r   )r  r  r  r  )r   exc_typeexc_valexc_tbr)  r  s         r   __exit__z_Monkey.__exit__=  sD    ///11 	- 	-JCDKe,,,,	- 	-r   N)r*   rI   rJ   r  r  r  r'   r   r   r!   r!   2  sA        ( ( (  - - - - -r   r!   )r  unittestr    r   r(   r   rr   r   TestCaser	   r  r  rN  r  r  r  r  r   r  r  r  r  r  r!   r'   r   r   <module>r     s      $ $ $ $ $ $ ; ; ; ; ; ; . . . . . .y)K y)K y)K y)K y)Kh' y)K y)K y)KxS       "I) I) I) I) I)x0 I) I) I)Xe) e) e) e) e)x0 e) e) e)P&< &< &< &< &<H$5 &< &< &<RG
 G
 G
 G
 G
x0 G
 G
 G
T% % % % % 8 % % %$5 5 5 5 5: 5 5 5	 	 	 	 	3T 	 	 	
2 2 2 2 2t%9 2 2 2(1 (1 (1 (1 (1x0 (1 (1 (1V* * * * *#; * * *( ( ( ( (#? ( ( (- - - - - - - - - -r   