
    Ofͻ                       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    T/var/www/html/env/lib/python3.11/site-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                    ddl m} |                     d          }|                     |j        d           |                     |j        d           |                     t          |j        |                     |                     t          |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__
assertTrue
isinstanceadapters	utilities_utility_registrations_adapter_registrations_subscription_registrations_handler_registrations)r   r%   comps      r   test_ctor_no_basesz"ComponentsTests.test_ctor_no_bases)   s1   ::::::}}Y''	222,,,
4=/BBCCC
4>?CCDDD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   r7   r4   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   r4   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@   r4   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   IFoorH   T           Dr   rL   fooc                       e Zd ZdS )EComponentsTests.test_registerUtility_with_component_name.<locals>.FooNrI   r'   r   r   FoorP   Y           Dr   rQ   inforS   )zope.interface.declarationsrD   rF   r   registerUtilityr)   r0   )	r   rD   rF   rL   ifoorQ   rN   _infor4   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	TypeErrorrV   r   r^   _to_regr4   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         |         |         |u            |                     |	j        ||f         ||d f           |                     |	j        j        d         |         d	         |f           |                     t!          |          d
           |d         \  }}|\  }|                     |i            | 
                    t#          ||                     | 
                    t#          |j        |                     | 
                    |j        j        |	u            | 
                    |j        j        |u            | 
                    |j        j        |u            | 
                    |j        j        |u            | 
                    |j        j        |u            | 
                    |j        j        d u            d S )Nr   rC   
RegisteredUtilityRegistrationc                       e Zd ZdS )>ComponentsTests.test_registerUtility_w_component.<locals>.IFooNrI   r'   r   r   rL   ro   s   rM   r   rL   rS   r       )rU   rD   zope.interface.interfacesrk   zope.interface.registryrm   rc   r   r#   rV   r,   r/   	_adaptersr)   r0   _subscriberslenr-   r   providedr   ra   rS   rb   )r   rD   rk   rm   rL   rW   rX   _namerg   r4   r"   r   r   r   events                  r    test_registerUtility_w_componentz0ComponentsTests.test_registerUtility_w_componentn   s   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||((}}++-- 	> 	>  $u===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>03D9%@GKLLL4T5[A!5$/	1 	1 	14Q7=bAG:NNNWq)))1:bR   
5*55666
5<1DEEFFF-5666-5666)U2333.'9:::)U2333,455555s   +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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |	u            |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        u            |                     |j        j        |u            |                     |j        j        |u            d S )Nr   rC   rj   rl   c                       e Zd ZdS )<ComponentsTests.test_registerUtility_w_factory.<locals>.IFooNrI   r'   r   r   rL   r}      rM   r   rL   rS   r   c                       S r   r'   rg   s   r   r^   z@ComponentsTests.test_registerUtility_w_factory.<locals>._factory       Nr   rb   rq   )rU   rD   rr   rk   rs   rm   rc   r   r#   rV   r)   rv   r,   r-   r   rw   r   ra   rS   rb   )r   rD   rk   rm   rL   rW   rX   rx   r^   r4   r"   r   r   r   ry   rg   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   
5*55666
5<1DEEFFF-5666-5666)U2333.'9:::)U2333,899999s   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>.FooNrI   r'   r   r   rQ   r      rM   r   rQ   rS   r   )r   rd   re   rV   )r   rQ   rX   rx   rg   r4   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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |	u            |                     |j        j        |
u            |                     |j        j        |u            |                     |j        j        d u            d S )Nr   rC   directlyProvidesrj   rl   c                       e Zd ZdS )>ComponentsTests.test_registerUtility_wo_provided.<locals>.IFooNrI   r'   r   r   rL   r      rM   r   rL   c                       e Zd ZdS )=ComponentsTests.test_registerUtility_wo_provided.<locals>.FooNrI   r'   r   r   rQ   r      rM   r   rQ   rS   r   rq   )rU   rD   r   rr   rk   rs   rm   r   r#   rV   r)   rv   r,   r-   rc   r   rw   r   ra   rS   rb   )r   rD   r   rk   rm   rL   rQ   rW   rX   rx   rg   r4   r"   r   r   r   ry   s                    r    test_registerUtility_wo_providedz0ComponentsTests.test_registerUtility_wo_provided   s   >>>>>>@@@@@@888888??????	 	 	 	 	> 	 	 		 	 	 	 	 	 	 	 tF||#%%$'''}}++-- 	> 	>  $u===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>Wq)))1:bR   
5*55666
5<1DEEFFF-5666-5666)U2333.'9:::)U2333,455555s   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   rC   c                       e Zd ZdS )JComponentsTests.test_registerUtility_duplicates_existing_reg.<locals>.IFooNrI   r'   r   r   rL   r      rM   r   rL   rS   r   )rU   rD   rc   r   rV   r#   r)   rv   
r   rD   rL   rW   rX   rx   rg   r4   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   rC   c                       e Zd ZdS )CComponentsTests.test_registerUtility_w_different_info.<locals>.IFooNrI   r'   r   r   rL   r      rM   r   rL   info1info2r      rp   rU   rD   rc   r   rV   r#   r)   rv   r0   r/   ru   )r   rD   rL   rW   _info1_info2rx   rg   r4   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   rC   c                       e Zd ZdS )SComponentsTests.test_registerUtility_w_different_names_same_component.<locals>.IFooNrI   r'   r   r   rL   r     rM   r   rL   rS   name1name2rq   rp   r   r   rD   rL   rW   rX   _name1_name2
_other_regrg   r4   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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |	u            |                     |j        j        |u            |                     |j        j        d u            |d         \  }}|\  }|                     |i            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |
u            |                     |j        j        |u            |                     |j        j        d u            d S )Nr   rC   rj   Unregisteredrl   c                       e Zd ZdS )HComponentsTests.test_registerUtility_replaces_existing_reg.<locals>.IFooNrI   r'   r   r   rL   r   $  rM   r   rL   rS   r   r   rq   )rU   rD   rr   rk   r   rs   rm   rc   r   rV   r#   r)   rv   r,   r-   r   rw   r   ra   rS   rb   )r   rD   rk   r   rm   rL   rW   rX   rx   _before_afterr4   r"   r   r   r   ry   s                    r   *test_registerUtility_replaces_existing_regz:ComponentsTests.test_registerUtility_replaces_existing_reg  s   >>>>>>888888::::::??????	 	 	 	 	> 	 	 	 tF|| ((FHH}}WdE5999++-- 	= 	=  ue<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=Wq)))1:bR   
5,77888
5<1DEEFFF-5666-5666)U2333.'9:::)U2333,45551:bR   
5*55666
5<1DEEFFF-5666-5666)U2333.&8999)U2333,455555s   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   rC   c                       e Zd ZdS )DComponentsTests.test_registerUtility_w_existing_subscr.<locals>.IFooNrI   r'   r   r   rL   r   K  rM   r   rL   rS   r   r   rp   )	rU   rD   rc   r   rV   r#   r)   r/   ru   r   rD   rL   rW   rX   r   r   rg   r4   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   rC   c                       e Zd ZdS );ComponentsTests.test_registerUtility_wo_event.<locals>.IFooNrI   r'   r   r   rL   r   ]  rM   r   rL   rS   r   F)rU   rD   rc   r   r#   rV   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 )Nrq   )	reg_countsuperrV   dictr0   r   r   	__class__s     r   rV   ztComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Reg.registerUtilityp  sZ    !#''..>Q&&2633 3D/// '&r   r*   rJ   rK   r   rV   __classcell__r   s   @r   CompThatChangesAfter1Regr   m  s=        I        r   r   rq   c                       e Zd ZdS )PComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.IFooNrI   r'   r   r   rL   r   }  rM   r   rL   r   r   rV   rc   r   r)   rv   listregisteredUtilities)r   r   r4   rL   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 )Nrq   r   )r   r   r0   r   rV   r   s     r   rV   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   rq   c                       e Zd ZdS )QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IFooNrI   r'   r   r   rL   r     rM   r   rL   r   c                       e Zd ZdS )QComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IBarNrI   r'   r   r   IBarr     rM   r   r      r   )r   r   r4   rL   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)ra   rw   rb   )r   rd   re   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`   )rc   r   rd   re   r   rf   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   rC   c                       e Zd ZdS )EComponentsTests.test_unregisterUtility_w_component_miss.<locals>.IFooNrI   r'   r   r   rL   r     rM   r   rL   r   )rU   rD   rc   r   r#   r   assertFalse)
r   rD   rL   rW   rx   rg   r4   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                    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        v            |                     |j        j                   |                     t%          |
          d           |
d         \  }}|\  }|                     |i            |                     t'          ||                     |                     t'          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        d u            d S )	Nr   rC   r   rl   c                       e Zd ZdS )@ComponentsTests.test_unregisterUtility_w_component.<locals>.IFooNrI   r'   r   r   rL   r     rM   r   rL   r   rq   )rU   rD   rr   r   rs   rm   rc   r   rV   r#   r   r,   r   r/   rt   r0   ru   r)   rv   r-   r   rw   r   ra   rb   )r   rD   r   rm   rL   rW   rx   rg   r4   r"   r   r   r   r   ry   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$$*EEFFF4555Wq)))1:bR   
5,77888
5<1DEEFFF-5666-5666)U2333.'9:::,455555s    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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |	u            |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        u            |                     |j        j        |u            d S )Nr   rC   r   rl   c                       e Zd ZdS )>ComponentsTests.test_unregisterUtility_w_factory.<locals>.IFooNrI   r'   r   r   rL   r     rM   r   rL   rS   r   c                       S r   r'   r   s   r   r^   zBComponentsTests.test_unregisterUtility_w_factory.<locals>._factory  r   r   r   rq   )rU   rD   rr   r   rs   rm   rc   r   rV   r#   r   r,   r)   rv   r-   r   rw   r   ra   rb   )r   rD   r   rm   rL   rW   rX   rx   r^   r4   r"   r   r   r   r   ry   rg   s                   @r    test_unregisterUtility_w_factoryz0ComponentsTests.test_unregisterUtility_w_factory  s   >>>>>>::::::??????	 	 	 	 	> 	 	 	 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   
5,77888
5<1DEEFFF-5666-5666)U2333.'9:::,899999s   B11B58B5c                 z   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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |	u            |                     |j        j        |
u            |                     |j        j        |u            |                     |j        j        d u            d S )Nr   rC   r   r   rl   c                       e Zd ZdS )IComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   r     rM   r   rL   c                       e Zd ZdS )HComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.FooNrI   r'   r   r   rQ   r     rM   r   rQ   rS   r   rq   rU   rD   r   rr   r   rs   rm   r   rV   r#   r   r,   r)   rv   r-   rc   r   rw   r   ra   rS   rb   r   rD   r   r   rm   rL   rQ   rW   rX   rx   rg   r4   r"   r   r   r   r   ry   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   
5,77888
5<1DEEFFF-5666-5666)U2333.'9:::)U2333,455555   CC	Cc                 z   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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |	u            |                     |j        j        |
u            |                     |j        j        |u            |                     |j        j        d u            d S )Nr   rC   r   r   rl   c                       e Zd ZdS )LComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.IFooNrI   r'   r   r   rL   r   ,  rM   r   rL   c                       e Zd ZdS )KComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.FooNrI   r'   r   r   rQ   r   /  rM   r   rQ   rS   r   rw   r   rq   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   
5,77888
5<1DEEFFF-5666-5666)U2333.'9:::)U2333,455555r   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   rC   c                       e Zd ZdS )FComponentsTests.test_unregisterUtility_w_existing_subscr.<locals>.IFooNrI   r'   r   r   rL   r   N  rM   r   rL   rS   r   r   rp   
rU   rD   rc   r   rV   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   rC   c                       e Zd ZdS )SComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable.<locals>.IFooNrI   r'   r   r   rL   r  a  rM   r   rL   rS   r   r   rp   )
rU   rD   r   r   rV   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   rC   )_UtilityRegistrationsc                       e Zd ZdS )]ComponentsTests.test_unregisterUtility_w_existing_subs_non_hashable_fresh_cache.<locals>.IFooNrI   r'   r   r   rL   r  w  rM   r   rL   rS   r   r   rp   )rU   rD   rs   r	  r   r   rV   r#   r   r)   r/   ru   )r   rD   r	  rL   rW   rX   r   r   rg   r4   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   rC   c                       e Zd ZdS )]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   r   r   r7   )rU   rD   r   r   rV   __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   rC   c                       e Zd ZdS )VComponentsTests.test_unregisterUtility_w_existing_subscr_other_component.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   r   r   rp   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   rC   c                       e Zd ZdS )[ComponentsTests.test_unregisterUtility_w_existing_subscr_oter_comp_mixed_hash.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   r   r   rp   )rU   rD   rc   r   r   rV   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                 b   ddl m} ddlm}  G d d|          } |d          }d}d}d}t	                      }|                                 }	|	                    ||||           |	                    ||||           t          |	                                d	 
          }
| 	                    t          |
          d           |                     t          |
d         |                     |                     |
d         j        |	u            |                     |
d         j        |u            |                     |
d         j        |u            |                     |
d         j        |u            |                     |
d         j        |u            |                     |
d         j        d u            |                     t          |
d         |                     |                     |
d         j        |	u            |                     |
d         j        |u            |                     |
d         j        |u            |                     |
d         j        |u            |                     |
d         j        |u            |                     |
d         j        d u            d S )Nr   rC   rl   c                       e Zd ZdS )?ComponentsTests.test_registeredUtilities_notempty.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   r   r   c                     | j         S r   r   rs    r   <lambda>zCComponentsTests.test_registeredUtilities_notempty.<locals>.<lambda>  s    qv r   keyr   rq   )rU   rD   rs   rm   rc   r   rV   sortedr   r)   rv   r,   r-   r   rw   r   ra   rS   rb   )r   rD   rm   rL   rW   rX   r   r   rg   r4   regs              r   !test_registeredUtilities_notemptyz1ComponentsTests.test_registeredUtilities_notempty  s   >>>>>>??????	 	 	 	 	> 	 	 	 tF||((}}WdFE:::WdFE:::T--//5E5EFFFS1%%%
3q6+>??@@@A4/000A4/000Av-...A(G3444Au,---A$.///
3q6+>??@@@A4/000A4/000Av-...A(G3444Au,---A$./////r   c                     ddl m}  G d d|          } |d          }|                                 }|                     |                    |          d u            d S )Nr   rC   c                       e Zd ZdS )?ComponentsTests.test_queryUtility_miss_no_default.<locals>.IFooNrI   r'   r   r   rL   r,    rM   r   rL   )rU   rD   r   r,   queryUtilityr   rD   rL   rW   r4   s        r   !test_queryUtility_miss_no_defaultz1ComponentsTests.test_queryUtility_miss_no_default  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}))$//4788888r   c                     ddl m}  G d d|          } |d          }|                                 }t                      }|                     |                    ||          |u            d S )Nr   rC   c                       e Zd ZdS )>ComponentsTests.test_queryUtility_miss_w_default.<locals>.IFooNrI   r'   r   r   rL   r2    rM   r   rL   default)rU   rD   r   rc   r,   r-  )r   rD   rL   rW   r4   _defaults         r    test_queryUtility_miss_w_defaultz0ComponentsTests.test_queryUtility_miss_w_default  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}88))$)AAXMNNNNNr   c                    ddl m}  G d d|          } |d          }t                      }|                                 }|                    ||           |                     |                    |          |u            d S )Nr   rC   c                       e Zd ZdS )3ComponentsTests.test_queryUtility_hit.<locals>.IFooNrI   r'   r   r   rL   r9    rM   r   rL   )rU   rD   rc   r   rV   r,   r-  r   rD   rL   rW   rg   r4   s         r   test_queryUtility_hitz%ComponentsTests.test_queryUtility_hit	  s    >>>>>>	 	 	 	 	> 	 	 	 tF||((}}Wd+++))$//7:;;;;;r   c                     ddl m} ddlm}  G d d|          } |d          }|                                 }|                     ||j        |           d S )Nr   rC   ComponentLookupErrorc                       e Zd ZdS )2ComponentsTests.test_getUtility_miss.<locals>.IFooNrI   r'   r   r   rL   r@    rM   r   rL   )rU   rD   rr   r>  r   rd   
getUtility)r   rD   r>  rL   rW   r4   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                      }|                                 }|                    ||           |                     |                    |          |u            d S )Nr   rC   c                       e Zd ZdS )1ComponentsTests.test_getUtility_hit.<locals>.IFooNrI   r'   r   r   rL   rE  #  rM   r   rL   )rU   rD   rc   r   rV   r,   rA  r:  s         r   test_getUtility_hitz#ComponentsTests.test_getUtility_hit   s    >>>>>>	 	 	 	 	> 	 	 	 tF||((}}Wd+++--899999r   c                     ddl m}  G d d|          } |d          }|                                 }|                     t	          |                    |                    g            d S )Nr   rC   c                       e Zd ZdS )7ComponentsTests.test_getUtilitiesFor_miss.<locals>.IFooNrI   r'   r   r   rL   rI  /  rM   r   rL   )rU   rD   r   r)   r   getUtilitiesForr.  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   rC   c                       e Zd ZdS )6ComponentsTests.test_getUtilitiesFor_hit.<locals>.IFooNrI   r'   r   r   rL   rN  9  rM   r   rL   r   r   r!  )rU   rD   rc   r   rV   r)   r'  rJ  r   rD   rL   rW   r   r   rg   r4   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   rC   c                       e Zd ZdS )DComponentsTests.test_getAllUtilitiesRegisteredFor_miss.<locals>.IFooNrI   r'   r   r   rL   rS  I  rM   r   rL   )rU   rD   r   r)   r   getAllUtilitiesRegisteredForr.  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   rC   c                       e Zd ZdS )CComponentsTests.test_getAllUtilitiesRegisteredFor_hit.<locals>.IFooNrI   r'   r   r   rL   rX  S  rM   r   rL   r   r   r!  )rU   rD   rc   r   rV   r)   r   rT  rO  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   rC   rE   c                       e Zd ZdS )FComponentsTests.test_registerAdapter_with_component_name.<locals>.IFooNrI   r'   r   r   rL   r\  d  rM   r   rL   r   rN   c                       e Zd ZdS )EComponentsTests.test_registerAdapter_with_component_name.<locals>.FooNrI   r'   r   r   rQ   r^  j  rR   r   rQ   rS   rT   )rU   rD   rF   r   registerAdapterr)   r1   )	r   rD   rF   rL   rW   ibarrQ   rX   r4   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                    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         |         |         |         |	u            |                     |
j        |f||f         |	|f           |                     t          |          d           |d         \  }}|\  }|                     |i            | 	                    t          ||                     | 	                    t          |j        |                     | 	                    |j        j        |
u            | 	                    |j        j        |u            |                     |j        j        |f           | 	                    |j        j        |u            | 	                    |j        j        |u            | 	                    |j        j        |	u            d S )Nr   rC   rj   AdapterRegistrationc                       e Zd ZdS )SComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>.IFooNrI   r'   r   r   rL   rf  {  rM   r   rL   r   rS   r   c                     t                      r   r\   contexts    r   r^   zWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>._factory  r_   r   rq   rU   rD   rr   rk   rs   rd  r   r#   r_  r,   r.   rt   r)   r1   rv   r-   rc   r   rw   requiredr   rS   rb   )r   rD   rk   rd  rL   rW   r`  rX   rx   r^   r4   r"   r   r   r   ry   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/248>uE#$ 	% 	% 	%4dWdE5IJ"E*	, 	, 	,Wq)))1:bR   
5*55666
5<1DEEFFF-5666-5666.888)U2333)U2333,899999   +BBBc                     ddl m}  G d d|          } |d          }d}d} G d d	          }|                                 }|                     t          |j        ||f||
           d S )Nr   rC   c                       e Zd ZdS )HComponentsTests.test_registerAdapter_no_provided_available.<locals>.IFooNrI   r'   r   r   rL   rp    rM   r   rL   r   rS   r   c                       e Zd ZdS )LComponentsTests.test_registerAdapter_no_provided_available.<locals>._FactoryNrI   r'   r   r   _Factoryrr    rM   r   rs  r   rS   rU   rD   r   rd   re   r_  )r   rD   rL   r`  rX   rx   rs  r4   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         |         |         |	         |
u            |                     |j        |f||	f         |
|f           |                     t          |          d           |d         \  }}|\  }|                     |i            | 
                    t!          ||                     | 
                    t!          |j        |                     | 
                    |j        j        |u            | 
                    |j        j        |u            |                     |j        j        |f           | 
                    |j        j        |	u            | 
                    |j        j        |u            | 
                    |j        j        |
u            d S )Nr   rC   implementerrj   rc  c                       e Zd ZdS )GComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   r{    rM   r   rL   r   rS   r   c                       e Zd ZdS )KComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>._FactoryNrI   r'   r   r   rs  r}    rR   r   rs  rt  rq   )rU   rD   ry  rr   rk   rs   rd  r   r#   r_  r,   r.   rt   r)   r1   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   ry  rk   rd  rL   rW   r`  rX   rx   rs  r4   r"   r   r   r   ry   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/248>uE#$ 	% 	% 	%4dWdE5IJ"E*	, 	, 	,Wq)))1:bR   
5*55666
5<1DEEFFF-5666-5666.888)U2333)U2333,899999s   B33B7:B7c                     ddl m}  G d d|          } |d          }d}d} G d d          }|                                 }|                     t          |j        ||||	           d S )
Nr   rC   c                       e Zd ZdS )HComponentsTests.test_registerAdapter_no_required_available.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   r   c                       e Zd ZdS )LComponentsTests.test_registerAdapter_no_required_available.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  rw   r   rS   ru  r   rD   rL   rW   rX   rx   rs  r4   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   rC   c                       e Zd ZdS )EComponentsTests.test_registerAdapter_w_invalid_required.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rS   r   c                       e Zd ZdS )IComponentsTests.test_registerAdapter_w_invalid_required.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  r  ru  )	r   rD   rL   rW   r`  rX   rx   rs  r4   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         |         |         |         |	u            |                     |
j        |f||f         |	|f           |                     t!          |          d           |d         \  }}|\  }|                     |i            |                     t#          ||                     |                     t#          |j        |                     |                     |j        j        |
u            |                     |j        j        |u            |                     |j        j        |f           |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |	u            d S )Nr   rC   r   rj   rc  c                       e Zd ZdS )MComponentsTests.test_registerAdapter_w_required_containing_None.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   r   c                       e Zd ZdS )QComponentsTests.test_registerAdapter_w_required_containing_None.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  r  rq   )rU   rD   zope.interface.interfacer   rr   rk   rs   rd  r   r#   r_  r,   r.   rt   r)   r1   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   r   rk   rd  rL   rW   rX   rx   rs  r4   r"   r   r   r   ry   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>(J	
 	
 	
 	'dE(ABu	
 	
 	
 	Wq)))1:bR   
5*55666
5<1DEEFFF-5666-5666.===)U2333)U2333,899999s   0BBBc                 0   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         |         |         |
         |u            |                     |j        |f||
f         ||	f           |                     t!          |          d           |d         \  }}|\  }|                     |i            |                     t#          ||                     |                     t#          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |f           |                     |j        j        |
u            |                     |j        j        |	u            |                     |j        j        |u            d S )Nr   rC   )implementedByrx  rj   rc  c                       e Zd ZdS )NComponentsTests.test_registerAdapter_w_required_containing_class.<locals>.IFooNrI   r'   r   r   rL   r  &  rM   r   rL   r   rS   r   c                       e Zd ZdS )RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._FactoryNrI   r'   r   r   rs  r  .  rM   r   rs  c                       e Zd ZdS )RComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._ContextNrI   r'   r   r   _Contextr  1  rR   r   r  r  rq   )rU   rD   r  ry  rr   rk   rs   rd  r   r#   r_  r,   r.   rt   r)   r1   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   r  ry  rk   rd  rL   rW   r`  rX   rx   rs  r  	_ctx_implr4   r"   r   r   r   ry   s                       r   0test_registerAdapter_w_required_containing_classz@ComponentsTests.test_registerAdapter_w_required_containing_class  sm   >>>>>>======;;;;;;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>(J	
 	
 	
 	'dE(ABu	
 	
 	
 	Wq)))1:bR   
5*55666
5<1DEEFFF-5666-5666.===)U2333)U2333,899999s   *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   rC   c                       e Zd ZdS )MComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>.IFooNrI   r'   r   r   rL   r  R  rM   r   rL   rS   r   c                       e Zd ZdS )QComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>._FactoryNrI   r'   r   r   rs  r  Z  rM   r   rs  r  )rU   rD   r   rd   re   r_  rc   r  s           r   /test_registerAdapter_w_required_containing_junkz?ComponentsTests.test_registerAdapter_w_required_containing_junkO  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                  |         |         |u            |                     |	j        f||f         ||f           |                     t          |          d           |d         \  }}|\  }|                     |i            | 	                    t          ||                     | 	                    t          |j        |                     | 	                    |j        j        |	u            | 	                    |j        j        |u            |                     |j        j        f           | 	                    |j        j        |u            | 	                    |j        j        |u            | 	                    |j        j        |u            d S )Nr   rC   rj   rc  c                       e Zd ZdS )GComponentsTests.test_registerAdapter_wo_explicit_required.<locals>.IFooNrI   r'   r   r   rL   r  h  rM   r   rL   r   rS   r   c                       e Zd Z fZdS )KComponentsTests.test_registerAdapter_wo_explicit_required.<locals>._FactoryNr*   rJ   rK   __component_adapts__r`  s   r   rs  r  p          $(7   r   rs  r  rq   rj  )r   rD   rk   rd  rL   rW   rX   rx   rs  r4   r"   r   r   r   ry   r`  s                  @r   )test_registerAdapter_wo_explicit_requiredz9ComponentsTests.test_registerAdapter_wo_explicit_requiredc  s   >>>>>>888888??????	 	 	 	 	> 	 	 	 tF||tF||	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ }}++-- 	- 	-  Du&+ ! - - -	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	/248>uE#$ 	% 	% 	%4dWdE5IJ"E*	, 	, 	,Wq)))1:bR   
5*55666
5<1DEEFFF-5666-5666.888)U2333)U2333,899999s   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   rC   c                       e Zd ZdS );ComponentsTests.test_registerAdapter_wo_event.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rS   r   c                     t                      r   r\   rh  s    r   r^   z?ComponentsTests.test_registerAdapter_wo_event.<locals>._factory  r_   r   F)ry   )rU   rD   r   r#   r_  r)   rv   )r   rD   rL   rW   r`  rX   rx   r^   r4   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)rb   rw   )r   rd   re   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   rC   c                       e Zd ZdS )QComponentsTests.test_unregisterAdapter_neither_factory_nor_required.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rb   rw   rk  )rU   rD   r   rd   re   r  r.  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   rC   c                       e Zd ZdS )9ComponentsTests.test_unregisterAdapter_miss.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd ZdS )=ComponentsTests.test_unregisterAdapter_miss.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  )rU   rD   r   r#   r  r   
r   rD   rL   rW   r`  rs  r4   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            | 
                    t#          ||                     | 
                    t#          |j        |                     | 
                    |j        j        |u            | 
                    |j        j        |u            |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           | 
                    |j        j        |u            d S )Nr   rC   r   rc  c                       e Zd ZdS )YComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd ZdS )]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  rq   rp   )rU   rD   rr   r   rs   rd  r   r_  r#   r  r,   r   r.   rt   r1   r)   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   r   rd  rL   rW   r`  rs  r4   r"   r   r   r   r   ry   s                  r   ;test_unregisterAdapter_hit_w_explicit_provided_and_requiredzKComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required  s   >>>>>>::::::??????	 	 	 	 	> 	 	 	 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   
5,77888
5<1DEEFFF-5666-5666.888*B///*B///,899999   	B..B25B2c                 z   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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |	u            |                     |j        j        |u            |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |u            d S )Nr   rC   rx  r   rc  c                       e Zd ZdS )IComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd ZdS )MComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>._FactoryNrI   r'   r   r   rs  r    rR   r   rs  rq   rp   )rU   rD   ry  rr   r   rs   rd  r   r_  r#   r  r,   r)   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   ry  r   rd  rL   rW   r`  rs  r4   r"   r   r   r   r   ry   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   
5,77888
5<1DEEFFF-5666-5666.888*B///*B///,899999    CCCc                 R   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            | 
                    t          ||                     | 
                    t          |j        |                     | 
                    |j        j        |u            | 
                    |j        j        |u            |                     |j        j        f           |                     |j        j        d           |                     |j        j        d           | 
                    |j        j        |u            d S )Nr   rC   r   rc  c                       e Zd ZdS )IComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>.IFooNrI   r'   r   r   rL   r  
  rM   r   rL   r   c                       e Zd Z fZdS )MComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rs  r    r  r   rs  rw   rq   rp   )rU   rD   rr   r   rs   rd  r   r_  r#   r  r,   r)   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   r   rd  rL   rW   rs  r4   r"   r   r   r   r   ry   r`  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   
5,77888
5<1DEEFFF-5666-5666.888*B///*B///,899999   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                 ~   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           | 
                    t          |d         |                     | 
                    |d         j        |
u            | 
                    |d         j        |u            |                     |d         j        |f           | 
                    |d         j        |u            | 
                    |d         j        |u            | 
                    |d         j        |	u            | 
                    t          |d         |                     | 
                    |d         j        |
u            | 
                    |d         j        |u            |                     |d         j        |f           | 
                    |d         j        |u            | 
                    |d         j        |u            | 
                    |d         j        |	u            d S )Nr   rC   rc  c                       e Zd ZdS )>ComponentsTests.test_registeredAdapters_notempty.<locals>.IFooNrI   r'   r   r   rL   r  .  rM   r   rL   rS   r   r   c                       e Zd ZdS )BComponentsTests.test_registeredAdapters_notempty.<locals>._FactoryNrI   r'   r   r   rs  r  7  rM   r   rs  c                     | j         S r   r!  r"  s    r   r$  zBComponentsTests.test_registeredAdapters_notempty.<locals>.<lambda>=  s    af r   r%  r   rq   )rU   rD   rs   rd  r   r_  r'  r  r)   rv   r,   r-   r   rw   rk  r   rS   rb   )r   rD   rd  rL   rW   r`  rX   r   r   rs  r4   r(  s               r    test_registeredAdapters_notemptyz0ComponentsTests.test_registeredAdapters_notempty*  s   >>>>>>??????	 	 	 	 	> 	 	 	 tF||tF||	 	 	 	 	 	 	 	 }}XwfeDDDXwfeDDDT,,..4D4DEEES1%%%
3q6+>??@@@A4/000A4/000Q4'222Av-...Au,---A(2333
3q6+>??@@@A4/000A4/000Q4'222Av-...Au,---A(233333r   c                     ddl m}  G d d|          } |d          }|                                 }t                      }|                     |                    ||          d u            d S )Nr   rC   c                       e Zd ZdS )?ComponentsTests.test_queryAdapter_miss_no_default.<locals>.IFooNrI   r'   r   r   rL   r  Q  rM   r   rL   rU   rD   r   rc   r,   queryAdapter)r   rD   rL   rW   r4   _contexts         r   !test_queryAdapter_miss_no_defaultz1ComponentsTests.test_queryAdapter_miss_no_defaultN  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}88))(D99TABBBBBr   c                     ddl m}  G d d|          } |d          }|                                 }t                      }t                      }|                     |                    |||          |u            d S )Nr   rC   c                       e Zd ZdS )>ComponentsTests.test_queryAdapter_miss_w_default.<locals>.IFooNrI   r'   r   r   rL   r  \  rM   r   rL   r3  r  )r   rD   rL   rW   r4   r  r5  s          r    test_queryAdapter_miss_w_defaultz0ComponentsTests.test_queryAdapter_miss_w_defaultY  s    >>>>>>	 	 	 	 	> 	 	 	 tF||}}8888hh??8K	M 	M 	M 	M 	Mr   c                    ddl m} ddl m}  G d d|          } |d          } |d          } G d d          } ||           G d	 d
                      } |            }|                                 }	|	                    ||f|           |	                    ||          }
|                     t          |
|                     |                     |
j        |u            d S )Nr   rC   rx  c                       e Zd ZdS )3ComponentsTests.test_queryAdapter_hit.<locals>.IFooNrI   r'   r   r   rL   r  j  rM   r   rL   r   c                       e Zd Zd ZdS )7ComponentsTests.test_queryAdapter_hit.<locals>._Factoryc                     || _         d S r   rh  r   ri  s     r   r  z@ComponentsTests.test_queryAdapter_hit.<locals>._Factory.__init__q      &r   Nr*   rJ   rK   r  r'   r   r   rs  r  p  #        ' ' ' ' 'r   rs  c                       e Zd ZdS )7ComponentsTests.test_queryAdapter_hit.<locals>._ContextNrI   r'   r   r   r  r  t  rR   r   r  )	rU   rD   ry  r   r_  r  r,   r-   ri  r   rD   ry  rL   rW   r`  rs  r  r  r4   adapters              r   test_queryAdapter_hitz%ComponentsTests.test_queryAdapter_hitf  sW   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||	' 	' 	' 	' 	' 	' 	' 	' 
T			 	 	 	 	 	 	 
		 8::}}Xw555##Hd33
7H556668344444r   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   rC   rx  r=  c                       e Zd ZdS )2ComponentsTests.test_getAdapter_miss.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd ZdS )6ComponentsTests.test_getAdapter_miss.<locals>._ContextNrI   r'   r   r   r  r    rR   r   r  )rU   rD   ry  rr   r>  r   rd   
getAdapter)
r   rD   ry  r>  rL   rW   r`  r  r  r4   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   rC   rx  c                       e Zd ZdS )1ComponentsTests.test_getAdapter_hit.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd Zd ZdS )5ComponentsTests.test_getAdapter_hit.<locals>._Factoryc                     || _         d S r   rh  r  s     r   r  z>ComponentsTests.test_getAdapter_hit.<locals>._Factory.__init__  r  r   Nr  r'   r   r   rs  r
    r  r   rs  c                       e Zd ZdS )5ComponentsTests.test_getAdapter_hit.<locals>._ContextNrI   r'   r   r   r  r    rR   r   r  )	rU   rD   ry  r   r_  r  assertIsInstanceassertIsri  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   rx  c                       e Zd ZdS )8ComponentsTests.test_getAdapter_hit_super.<locals>.IBaseNrI   r'   r   r   IBaser    rM   r   r  c                       e Zd ZdS );ComponentsTests.test_getAdapter_hit_super.<locals>.IDerivedNrI   r'   r   r   IDerivedr    rM   r   r  c                       e Zd ZdS )7ComponentsTests.test_getAdapter_hit_super.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   c                       e Zd ZdS )7ComponentsTests.test_getAdapter_hit_super.<locals>.BaseNrI   r'   r   r   Baser    rR   r   r  c                       e Zd ZdS ):ComponentsTests.test_getAdapter_hit_super.<locals>.DerivedNrI   r'   r   r   Derivedr    rR   r   r  c                       e Zd Zd ZdS )>ComponentsTests.test_getAdapter_hit_super.<locals>.AdapterBasec                     || _         d S r   rh  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   rh  r  s     r   r  zJComponentsTests.test_getAdapter_hit_super.<locals>.AdapterDerived.__init__  r  r   Nr  r'   r   r   AdapterDerivedr%    r  r   r'  r    r   rU   ry  r   r_  _should_not_changer  r  r  ri  r   r   r   ry  r  r  rL   r  r  r#  r'  r4   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   rx  c                       e Zd ZdS )^ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IBaseNrI   r'   r   r   r  r0    rM   r   r  c                       e Zd ZdS )aComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IDerivedNrI   r'   r   r   r  r2    rM   r   r  c                       e Zd ZdS )]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.IFooNrI   r'   r   r   rL   r4    rM   r   rL   c                       e Zd ZdS )]ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.BaseNrI   r'   r   r   r  r6    rM   r   r  c                       e Zd ZdS )_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child1NrI   r'   r   r   Child1r8    rM   r   r9  c                       e Zd ZdS )_ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.Child2NrI   r'   r   r   Child2r;    rR   r   r<  c                       e Zd ZdS )`ComponentsTests.test_getAdapter_hit_super_w_parent_implements_interface_diamond.<locals>.DerivedNrI   r'   r   r   r  r>    rR   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   rh  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   rh  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   ry  r  r  rL   r  r9  r<  r  r#  r'  r4   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   rC   rx  c                       e Zd ZdS )9ComponentsTests.test_queryMultiAdapter_miss.<locals>.IFooNrI   r'   r   r   rL   rH    rM   r   rL   r   IBazc                       e Zd ZdS )>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context1NrI   r'   r   r   	_Context1rK    rR   r   rL  c                       e Zd ZdS )>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context2NrI   r'   r   r   	_Context2rN    rR   r   rO  )rU   rD   ry  r   r)   queryMultiAdapterr   rD   ry  rL   rW   r`  ibazrL  rO  	_context1	_context2r4   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||          |u            d S )Nr   rC   rx  c                       e Zd ZdS )CComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>.IFooNrI   r'   r   r   rL   rX  &  rM   r   rL   r   rI  c                       e Zd ZdS )HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context1NrI   r'   r   r   rL  rZ  -  rR   r   rL  c                       e Zd ZdS )HComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context2NrI   r'   r   r   rO  r\  1  rR   r   rO  r3  )rU   rD   ry  rc   r   r,   rP  )r   rD   ry  rL   rW   r`  rR  rL  rO  rS  rT  r5  r4   s                r   %test_queryMultiAdapter_miss_w_defaultz5ComponentsTests.test_queryMultiAdapter_miss_w_default"  su   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK	88}}""Iy#94+3 # 5 58@A	B 	B 	B 	B 	Br   c                 @   ddl m} ddl m}  G d d|          } |d          } |d          } |d          } ||           G d d	                      } ||           G d
 d                      } |            }	 |            }
 G d d          }|                                 }|                    |||f|           |                    |	|
f|          }|                     t          ||                     |                     |j	        |	|
f           d S )Nr   rC   rx  c                       e Zd ZdS )8ComponentsTests.test_queryMultiAdapter_hit.<locals>.IFooNrI   r'   r   r   rL   r`  A  rM   r   rL   r   rI  c                       e Zd ZdS )=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context1NrI   r'   r   r   rL  rb  H  rR   r   rL  c                       e Zd ZdS )=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context2NrI   r'   r   r   rO  rd  L  rR   r   rO  c                       e Zd Zd ZdS )<ComponentsTests.test_queryMultiAdapter_hit.<locals>._Factoryc                     ||f| _         d S r   rh  r   context1context2s      r   r  zEComponentsTests.test_queryMultiAdapter_hit.<locals>._Factory.__init__T      '1r   Nr  r'   r   r   rs  rf  S  #        2 2 2 2 2r   rs  )
rU   rD   ry  r   r_  rP  r,   r-   r)   ri  r   rD   ry  rL   rW   r`  rR  rL  rO  rS  rT  rs  r4   r  s                 r   test_queryMultiAdapter_hitz*ComponentsTests.test_queryMultiAdapter_hit=  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK		2 	2 	2 	2 	2 	2 	2 	2 }}Xd|T:::(()Y)?FF
7H55666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   rC   rx  r=  c                       e Zd ZdS )7ComponentsTests.test_getMultiAdapter_miss.<locals>.IFooNrI   r'   r   r   rL   rq  b  rM   r   rL   r   rI  c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context1NrI   r'   r   r   rL  rs  i  rR   r   rL  c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context2NrI   r'   r   r   rO  ru  m  rR   r   rO  )rU   rD   ry  rr   r>  r   rd   getMultiAdapter)r   rD   ry  r>  rL   rW   r`  rR  rL  rO  rS  rT  r4   s                r   test_getMultiAdapter_missz)ComponentsTests.test_getMultiAdapter_miss]  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|          }|                     t          ||                     |                     |j	        |	|
f           d S )Nr   rC   rx  c                       e Zd ZdS )6ComponentsTests.test_getMultiAdapter_hit.<locals>.IFooNrI   r'   r   r   rL   rz  {  rM   r   rL   r   rI  c                       e Zd ZdS );ComponentsTests.test_getMultiAdapter_hit.<locals>._Context1NrI   r'   r   r   rL  r|    rR   r   rL  c                       e Zd ZdS );ComponentsTests.test_getMultiAdapter_hit.<locals>._Context2NrI   r'   r   r   rO  r~    rR   r   rO  c                       e Zd Zd ZdS ):ComponentsTests.test_getMultiAdapter_hit.<locals>._Factoryc                     ||f| _         d S r   rh  rh  s      r   r  zCComponentsTests.test_getMultiAdapter_hit.<locals>._Factory.__init__  rk  r   Nr  r'   r   r   rs  r    rl  r   rs  )
rU   rD   ry  r   r_  rv  r,   r-   r)   ri  rm  s                 r   test_getMultiAdapter_hitz(ComponentsTests.test_getMultiAdapter_hitw  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 tF||tF||tF||	T			 	 	 	 	 	 	 
		 
T			 	 	 	 	 	 	 
		 IKK	IKK		2 	2 	2 	2 	2 	2 	2 	2 }}Xd|T:::&&	9'=tDD
7H55666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   r4   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   rx  c                       e Zd ZdS )=ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IBaseNrI   r'   r   r   r  r    rM   r   r  c                       e Zd ZdS )@ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IDerivedNrI   r'   r   r   r  r    rM   r   r  c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   c                       e Zd ZdS )<ComponentsTests.test_getMultiAdapter_hit_super.<locals>.BaseNrI   r'   r   r   r  r    rR   r   r  c                       e Zd ZdS )?ComponentsTests.test_getMultiAdapter_hit_super.<locals>.DerivedNrI   r'   r   r   r  r    rR   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>.AdapterDerivedNrI   r'   r   r   r'  r    rM   r   r'  )r    r   rU   ry  r   r_  r)  rv  r  r  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   rC   rx  c                       e Zd ZdS )4ComponentsTests.test_getAdapters_empty.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rI  c                       e Zd ZdS )9ComponentsTests.test_getAdapters_empty.<locals>._Context1NrI   r'   r   r   rL  r    rR   r   rL  c                       e Zd ZdS )9ComponentsTests.test_getAdapters_empty.<locals>._Context2NrI   r'   r   r   rO  r    rR   r   rO  )rU   rD   ry  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   rC   rx  c                       e Zd ZdS )CComponentsTests.test_getAdapters_factory_returns_None.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rI  c                       e Zd ZdS )HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context1NrI   r'   r   r   rL  r    rR   r   rL  c                       e Zd ZdS )HComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context2NrI   r'   r   r   rO  r    rR   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   )rU   rD   ry  r   r_  r)   r   r  )r   rD   ry  rL   rW   r`  rR  rL  rO  rS  rT  r4   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         |           | 	                    t          |d         d         |                     |                     |d         d         |           | 	                    t          |d         d         |                     d S )Nr   rC   rx  c                       e Zd ZdS )8ComponentsTests.test_getAdapters_non_empty.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rI  c                       e Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Context1NrI   r'   r   r   rL  r    rR   r   rL  c                       e Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Context2NrI   r'   r   r   rO  r    rR   r   rO  c                       e Zd Zd ZdS )=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory1c                     ||f| _         d S r   rh  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   rh  rh  s      r   r  zFComponentsTests.test_getAdapters_non_empty.<locals>._Factory2.__init__%  rk  r   Nr  r'   r   r   	_Factory2r  $  rl  r   r  r   r   r!  r   rq   )rU   rD   ry  r   r_  r'  r  r)   rv   r,   r-   )r   rD   ry  rL   rW   r`  rR  rL  rO  rS  rT  r  r  r   r   r4   founds                    r   test_getAdapters_non_emptyz*ComponentsTests.test_getAdapters_non_empty
  s   >>>>>>;;;;;;	 	 	 	 	> 	 	 	 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---
58A;	::;;;q!f---
58A;	::;;;;;r   c           	          ddl m}  G d d|          } |d          } |d          }d}d}d }|                                 }|                     t          |j        ||f|||           d S )	Nr   rC   c                       e Zd ZdS )NComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrI   r'   r   r   rL   r  7  rM   r   rL   r   r   rS   c                     t                      r   r\   rh  s    r   r^   zRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>._factory?  r_   r   )rU   rD   r   rd   re   registerSubscriptionAdapter)	r   rD   rL   rW   r`  rx   rX   r^   r4   s	            r   0test_registerSubscriptionAdapter_w_nonblank_namez@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name4  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         |	u            |                     |
j        |f|||	|fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |
u            |                     |j        j        |u            |                     |j        j        |f           |                     |j        j        |           |                     |j        j        |u            |                     |j        j        |	u            d S )Nr   rC   rj   SubscriptionRegistrationc                       e Zd ZdS )]ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>.IFooNrI   r'   r   r   rL   r  K  rM   r   rL   r   rp   rS   c                     t                      r   r\   rh  s    r   r^   zaComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_required.<locals>._factoryS  r_   r   rT   rq   rU   rD   rr   rk   rs   r  r   r#   r  r.   ru   r)   rv   r,   r2   r-   rc   r   rw   rk  r   rS   rb   )r   rD   rk   r  rL   rW   r`  _blankrX   r^   r4   r"   r   r(  r   r   ry   s                    r   ?test_registerSubscriptionAdapter_w_explicit_provided_n_requiredzOComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_n_requiredF  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%%%A(*+++9 7D&(EBC	E 	E 	EWq)))1:bR   
5*55666
5<1IJJKKK-5666-5666.888*F333)U2333,899999rm  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         |
u            |                     |j        |f||	|
|fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     t!          ||                     |                     t!          |j        |                     |                     |j        j        |u            |                     |j        j        |u            |                     |j        j        |f           |                     |j        j        |	           |                     |j        j        |u            |                     |j        j        |
u            d S )Nr   rC   rx  rj   r  c                       e Zd ZdS )SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   r  s  rM   r   rL   r   rS   rp   c                       e Zd ZdS )WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrI   r'   r   r   rs  r  {  rR   r   rs  rT   rq   )rU   rD   ry  rr   rk   rs   r  r   r#   r  r.   ru   r)   rv   r,   r2   r-   rc   r   rw   rk  r   rS   rb   )r   rD   ry  rk   r  rL   rW   r`  rX   r  rs  r4   r"   r   r(  r   r   ry   s                     r   5test_registerSubscriptionAdapter_wo_explicit_providedzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_providedm  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%%%A(*+++9 7D&(EBC	E 	E 	EWq)))1:bR   
5*55666
5<1IJJKKK-5666-5666.888*F333)U2333,899999s   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         |u            |                     |	j        f||||fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |	u            |                     |j        j        |u            |                     |j        j        f           |                     |j        j        |           |                     |j        j        |u            |                     |j        j        |u            d S )Nr   rC   rj   r  c                       e Zd ZdS )SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rS   rp   c                       e Zd Z fZdS )WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rs  r    r  r   rs  )rw   rS   rq   r  )r   rD   rk   r  rL   rW   rX   r  rs  r4   r"   r   r(  r   r   ry   r`  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%%%A(*+++9 7D&(EBC	E 	E 	EWq)))1:bR   
5*55666
5<1IJJKKK-5666-5666.888*F333)U2333,899999s   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   rC   c                       e Zd ZdS )GComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   rS   c                     t                      r   r\   rh  s    r   r^   zKComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>._factory  r_   r   FrS   ry   )rU   rD   r   r#   r  r)   rv   )
r   rD   rL   rW   r`  rX   r^   r4   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                 p   ddl m} ddlm}  G d d|          } |d          } |d          }d}d} G d d	          }|                                 }	|	                    ||f||
           |	                    ||f||
           t          |	                                          }
|                     t          |
          d           | 
                    t          |
d         |                     | 
                    |
d         j        |	u            | 
                    |
d         j        |u            |                     |
d         j        |f           |                     |
d         j        |           | 
                    |
d         j        |u            | 
                    |
d         j        |u            | 
                    t          |
d         |                     | 
                    |
d         j        |	u            | 
                    |
d         j        |u            |                     |
d         j        |f           |                     |
d         j        |           | 
                    |
d         j        |u            | 
                    |
d         j        |u            d S )Nr   rC   r  c                       e Zd ZdS )JComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   rS   rp   c                       e Zd ZdS )NComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  rT   r   rq   )rU   rD   rs   r  r   r  r   r  r)   rv   r,   r-   r   rw   rk  r   rS   rb   )r   rD   r  rL   rW   r`  rX   r  rs  r4   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%%%
3q6+CDDEEEA4/000A4/000Q4'222Qf---Au,---A(2333
3q6+CDDEEEA4/000A4/000Q4'222Qf---Au,---A(233333r   c                     ddl m}  G d d|          } |d          } |d          }d}|                                 }|                     t          |j        |||           d S )Nr   rC   c                       e Zd ZdS )PComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   nonblank)rk  rw   r   rU   rD   r   rd   re   unregisterSubscriptionAdapter)r   rD   rL   rW   r`  	_nonblankr4   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   rd   re   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   rC   c                       e Zd ZdS )]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r  r  r.  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   rC   c                       e Zd ZdS )EComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd ZdS )IComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>._FactoryNrI   r'   r   r   rs  r    rM   r   rs  )rU   rD   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            | 
                    t#          ||                     | 
                    t#          |j        |                     | 
                    |j        j        |u            | 
                    |j        j        |u            |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           | 
                    |j        j        d u            d S )Nr   rC   r   r  c                       e Zd ZdS )OComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>.IFooNrI   r'   r   r   rL   r   -  rM   r   rL   r   c                       e Zd ZdS )SComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>._FactoryNrI   r'   r   r   rs  r  3  rM   r   rs  rq   rp   rU   rD   rr   r   rs   r  r   r  r#   r  r,   r   r.   ru   r2   r)   rv   r-   rc   r   rw   rk  r   rS   rb   r   rD   r   r  rL   rW   r`  rs  r4   r"   r   r   r   r   ry   s                  r   1test_unregisterSubscriptionAdapter_hit_wo_factoryzAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory(  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   
5,77888
5<1IJJKKK-5666-5666.888*B///*B///,455555r  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            | 
                    t#          ||                     | 
                    t#          |j        |                     | 
                    |j        j        |u            | 
                    |j        j        |u            |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           | 
                    |j        j        |u            d S )Nr   rC   r   r  c                       e Zd ZdS )NComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>.IFooNrI   r'   r   r   rL   r  P  rM   r   rL   r   c                       e Zd ZdS )RComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>._FactoryNrI   r'   r   r   rs  r
  V  rM   r   rs  rq   rp   r  r  s                  r   0test_unregisterSubscriptionAdapter_hit_w_factoryz@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factoryK  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   
5,77888
5<1IJJKKK-5666-5666.888*B///*B///,899999r  c                 z   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            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |	u            |                     |j        j        |u            |                     |j        j        |f           |                     |j        j        d           |                     |j        j        d           |                     |j        j        |u            d S )Nr   rC   rx  r   r  c                       e Zd ZdS )UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   r  t  rM   r   rL   r   c                       e Zd ZdS )YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNrI   r'   r   r   rs  r  z  rR   r   rs  rq   rp   )rU   rD   ry  rr   r   rs   r  r   r  r#   r  r,   r)   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   ry  r   r  rL   rW   r`  rs  r4   r"   r   r   r   r   ry   s                   r   7test_unregisterSubscriptionAdapter_wo_explicit_providedzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_providedn  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   
5,77888
5<1IJJKKK-5666-5666.888*B///*B///,899999r  c                 R   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            | 
                    t          ||                     | 
                    t          |j        |                     | 
                    |j        j        |u            | 
                    |j        j        |u            |                     |j        j        f           |                     |j        j        d           |                     |j        j        d           | 
                    |j        j        |u            d S )Nr   rC   r   r  c                       e Zd ZdS )UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd Z fZdS )YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr  r  s   r   rs  r    r  r   rs  r  rq   rp   )rU   rD   rr   r   rs   r  r   r  r#   r  r,   r)   rv   r-   rc   r   rw   rk  r   rS   rb   )r   rD   r   r  rL   rW   rs  r4   r"   r   r   r   r   ry   r`  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   
5,77888
5<1IJJKKK-5666-5666.888*B///*B///,899999r  c                 N   ddl m} ddl m}  G d d|          } |d          } |d          }|                                 } ||           G d d                      } |            }|                     t          |                    |f|                    g            d S )	Nr   rC   rx  c                       e Zd ZdS )4ComponentsTests.test_subscribers_empty.<locals>.IFooNrI   r'   r   r   rL   r    rM   r   rL   r   c                       e Zd ZdS )3ComponentsTests.test_subscribers_empty.<locals>.BarNrI   r'   r   r   Barr    rR   r   r  )rU   rD   ry  r   r)   r   subscribers)	r   rD   ry  rL   rW   r`  r4   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           | 	                    t          |
d         |                     | 	                    t          |
d         |                     d S )Nr   rC   rx  c                       e Zd ZdS )8ComponentsTests.test_subscribers_non_empty.<locals>.IFooNrI   r'   r   r   rL   r#    rM   r   rL   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*   rJ   rK   r  r  r  s   r   rs  r%    s,        $(7 ( ( ( ( (r   rs  c                       e Zd ZdS )<ComponentsTests.test_subscribers_non_empty.<locals>._DerivedNrI   r'   r   r   _Derivedr(    rM   r   r)  c                       e Zd ZdS )7ComponentsTests.test_subscribers_non_empty.<locals>.BarNrI   r'   r   r   r  r+    rR   r   r  c                     | j         j        S r   )r   r*   xs    r   
_klassnamez>ComponentsTests.test_subscribers_non_empty.<locals>._klassname  s    ;''r   r%  r   rq   )rU   rD   ry  r   r  r  r'  r)   rv   r,   r-   )r   rD   ry  rL   rW   rs  r)  r4   r  r  r  r/  r`  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---
;q>8<<===
;q>8<<=====r   c                     ddl m}  G d d|          } |d          }d}|                                 }d }|                     t          |j        |||           d S )Nr   rC   c                       e Zd ZdS )BComponentsTests.test_registerHandler_w_nonblank_name.<locals>.IFooNrI   r'   r   r   rL   r3    rM   r   rL   r  c                     t                      r   r\   rh  s    r   r^   zFComponentsTests.test_registerHandler_w_nonblank_name.<locals>._factory  r_   r   rk  r   )rU   rD   r   rd   re   registerHandler)r   rD   rL   rW   r  r4   r^   s          r   $test_registerHandler_w_nonblank_namez4ComponentsTests.test_registerHandler_w_nonblank_name  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	}}	( 	( 	( 	)T%98#'i 	 	9 	9 	9 	9 	9r   c                    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         |u            |                     |	j        |f|||fg           |                     t          |          d           |d         \  }}|\  }|                     |i            |                     t          ||                     |                     t          |j        |                     |                     |j        j        |	u            |                     |j        j        |f           |                     |j        j        |           |                     |j        j        |u            |                     |j        j        |u            d S )Nr   rC   rj   HandlerRegistrationc                       e Zd ZdS )FComponentsTests.test_registerHandler_w_explicit_required.<locals>.IFooNrI   r'   r   r   rL   r<    rM   r   rL   rp   rS   c                     t                      r   r\   rh  s    r   r^   zJComponentsTests.test_registerHandler_w_explicit_required.<locals>._factory	  r_   r   rT   rq   )rU   rD   rr   rk   rs   r:  r   r#   r6  r.   ru   r)   rv   r,   r3   r-   rc   r   rk  r   rS   rb   )r   rD   rk   r:  rL   rW   r  rX   r^   r4   r"   r   r(  r   r   ry   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%%%A(*+++4 7FHe<=	? 	? 	?Wq)))1:bR   
5*55666
5<1DEEFFF-5666.888*F333)U2333,899999s    BB
B
c                 v  
 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         |u            |                     |j
        
f|||fg           |                     t          |          d           d S )Nr   rC   c                       e Zd ZdS )PComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>.IFooNrI   r'   r   r   rL   rA  !	  rM   r   rL   rS   rp   c                       e Zd Z fZdS )TComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>._FactoryNr  rW   s   r   rs  rC  (	  s        $(7 Dr   rs  Fr  rq   )rU   rD   r   r#   r6  r.   ru   r)   rv   r,   r3   )r   rD   rL   rX   r  rs  r4   r"   r   r(  rW   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%%%A(*+++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_empty7	  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
           | 
                    t          |	d         |                     |                     |	d         j        |f           |                     |	d         j        d           |                     |	d         j        |           |                     |	d         j        d           | 
                    t          |	d         |                     |                     |	d         j        |f           |                     |	d         j        d           |                     |	d         j        |           |                     |	d         j        d           d S )Nr   rC   r9  c                       e Zd ZdS )?ComponentsTests.test_registeredHandlers_non_empty.<locals>.IFooNrI   r'   r   r   rL   rK  ?	  rM   r   rL   c                     t                      r   r\   rh  s    r   	_factory1zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory1D	  r_   r   c                     t                      r   r\   rh  s    r   	_factory2zDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory2G	  r_   r   c                 $    | j         j        j        S r   )rb   __code__co_namer-  s    r   _factory_namezHComponentsTests.test_registeredHandlers_non_empty.<locals>._factory_nameN	  s    9%--r   r%  r   rp   rq   )rU   rD   rs   r:  r   r6  r'  rG  r)   rv   r,   r-   rk  r   rb   rS   )
r   rD   r:  rL   rW   rM  rO  r4   rS  r  s
             r   !test_registeredHandlers_non_emptyz1ComponentsTests.test_registeredHandlers_non_empty;	  s=   >>>>>>??????	 	 	 	 	> 	 	 	 tF||	( 	( 	(	( 	( 	( }}Y000Y000	. 	. 	. T4466MJJJ[))1---
;q>3FGGHHHQ04':::Q,b111Q/;;;Q,b111
;q>3FGGHHH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   rC   c                       e Zd ZdS )DComponentsTests.test_unregisterHandler_w_nonblank_name.<locals>.IFooNrI   r'   r   r   rL   rW  a	  rM   r   rL   r  r5  )rU   rD   r   rd   re   unregisterHandler)r   rD   rL   rW   r  r4   s         r   &test_unregisterHandler_w_nonblank_namez6ComponentsTests.test_unregisterHandler_w_nonblank_name^	  s    >>>>>>	 	 	 	 	> 	 	 	 tF||	}})T%;$(7 	 	< 	< 	< 	< 	<r   c                 n    |                                  }|                     t          |j                   d S r   )r   rd   re   rX  r<   s     r   3test_unregisterHandler_neither_factory_nor_requiredzCComponentsTests.test_unregisterHandler_neither_factory_nor_requiredj	  s.    }})T%;<<<<<r   c                     ddl m}  G d d|          } |d          }|                                 }|                    |f          }|                     |           d S )Nr   rC   c                       e Zd ZdS )9ComponentsTests.test_unregisterHandler_miss.<locals>.IFooNrI   r'   r   r   rL   r^  q	  rM   r   rL   rk  )rU   rD   r   rX  r   )r   rD   rL   rW   r4   r   s         r   test_unregisterHandler_missz+ComponentsTests.test_unregisterHandler_missn	  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            | 
                    t          ||                     | 
                    t          |j        |                     | 
                    |j        j        |u            |                     |j        j        |f           |                     |j        j        d	           | 
                    |j        j        |u            d S )
Nr   rC   r   r9  c                       e Zd ZdS )XComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   rc  ~	  rM   r   rL   c                     t                      r   r\   rh  s    r   r^   z\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>._factory	  r_   r   rq   rp   rU   rD   rr   r   rs   r:  r   r6  r#   rX  r,   r)   rv   r-   rc   r   rk  r   rb   r   rD   r   r:  rL   rW   r4   r^   r"   r   r   r   r   ry   s                 r   :test_unregisterHandler_hit_w_factory_and_explicit_providedzJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_providedy	  sE   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||}}	( 	( 	( }}Xw///++-- 	> 	>**8dW==E	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>Wq)))1:bR   
5,77888
5<1DEEFFF-5666.888*B///,899999   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            | 
                    t          ||                     | 
                    t          |j        |                     | 
                    |j        j        |u            |                     |j        j        |f           |                     |j        j        d
           | 
                    |j        j        d u            d S )Nr   rC   r   r9  c                       e Zd ZdS )QComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>.IFooNrI   r'   r   r   rL   rk  	  rM   r   rL   c                     t                      r   r\   rh  s    r   r^   zUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>._factory	  r_   r   r_  rq   rp   re  rf  s                 r   3test_unregisterHandler_hit_w_only_explicit_providedzCComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided	  sF   >>>>>>::::::??????	 	 	 	 	> 	 	 	 tF||}}	( 	( 	( }}Xw///++-- 	= 	=**TG*<<E	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=Wq)))1:bR   
5,77888
5<1DEEFFF-5666.888*B///,455555rh  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            | 
                    t          ||                     | 
                    t          |j        |                     | 
                    |j        j        |u            |                     |j        j        f           |                     |j        j        d
           |                     |j        j        d
           | 
                    |j        j        |u            d S )Nr   rC   r   r9  c                       e Zd ZdS )IComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>.IFooNrI   r'   r   r   rL   rp  	  rM   r   rL   c                       e Zd Z fZdS )MComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>._FactoryNr  rD  s   r   rs  rr  	  r  r   rs  rq   rp   )rU   rD   rr   r   rs   r:  r   r6  r#   rX  r,   r)   rv   r-   rc   r   rk  r   rS   rb   )r   rD   r   r:  rL   rs  r4   r"   r   r   r   r   ry   rW   s                @r   +test_unregisterHandler_wo_explicit_requiredz;ComponentsTests.test_unregisterHandler_wo_explicit_required	  so   >>>>>>::::::??????	 	 	 	 	> 	 	 	 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   
5,77888
5<1DEEFFF-5666.888*B///*B///,899999s   >B  B$'B$c                     ddl m} ddl m}  G d d|          } |d          }|                                 } ||           G d d                      } |            }|                    |f           d S )Nr   rC   rx  c                       e Zd ZdS )/ComponentsTests.test_handle_empty.<locals>.IFooNrI   r'   r   r   rL   rv  	  rM   r   rL   c                       e Zd ZdS ).ComponentsTests.test_handle_empty.<locals>.BarNrI   r'   r   r   r  rx  	  rR   r   r  )rU   rD   ry  r   handle)r   rD   ry  rL   rW   r4   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   rC   rx  c                       e Zd ZdS )3ComponentsTests.test_handle_non_empty.<locals>.IFooNrI   r'   r   r   rL   r}  	  rM   r   rL   c                 2                         |            d S r   r   )ri  	_called_1s    r   
_factory_1z9ComponentsTests.test_handle_non_empty.<locals>._factory_1	      W%%%%%r   c                 2                         |            d S r   r   )ri  	_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>.BarNrI   r'   r   r   r  r  	  rR   r   r  )rU   rD   ry  r   r6  ry  r)   )r   rD   ry  rL   rW   r  r  r4   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>.IFooNrI   r'   r   r   rL   r  

  rM   r   rL   r  r  r   rq   rp   r      r   )r   r   rc   rV   r)   rv   r/   ru   	_providedr   r,   )r   	identicalrL   r4   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_provided$
  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*   rJ   rK   __doc__r'   r   r   rL   r  +
          NNNr   rL   c                       e Zd ZdZdS )YComponentsTests.test_rebuildUtilityRegistryFromLocalCache.<locals>.UtilityImplementingFoor  Nr  r'   r   r   UtilityImplementingFoor  .
  r  r   r     r!  rq   r   rp   
   r'                  )did_not_registerneeded_registereddid_not_subscribeneeded_subscribedT)rebuild)r   r   rangerV   r/   _generationrt   r)   rv   ru   typer   strassertNotEqual$rebuildUtilityRegistryFromLocalCacheassertIn)r   rL   r  compsiorig_generationorig_adaptersorig_subscribersnew_adaptersdr   new_subsr4   rebuild_preflightrebuild_resultsorig_subscriberpreflight_afterrebuild_afters                     r   )test_rebuildUtilityRegistryFromLocalCachez9ComponentsTests.test_rebuildUtilityRegistryFromLocalCache)
  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*   rJ   rK   r   r   r#   r5   r8   r=   rA   rY   rh   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r)  r/  r6  r;  rB  rF  rK  rP  rU  rY  ra  rl  rv  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   r0  r7  r>  rE  rH  rT  rY  r[  r`  rg  rm  rs  rz  r  r  r  r  r   r   s   @r   r	   r	      s         9 9 9 9     : : :F F F= = =	= 	= 	=     ,? ? ?6 6 6B: : :B
M 
M 
M 6  6  6D* * *"% % %,1 1 12(6 (6 (6TO O O$* * * C C C2C C C@G G G
? ? ?" " " 6 6 6@ :  :  :D"6 "6 "6H#6 #6 #6JO O O&O O O&O O O.> > >8( ( (*( ( (.? ? ?0 0 0@9 9 9	O 	O 	O
< 
< 
<	G 	G 	G
: 
: 
:? ? ?A A A L L L$ $ $   ,": ": ":H2 2 2"%: %: %:NA A A$G G G$': ': ':R.: .: .:`  ($: $: $:L* * *(7 7 7
	F 	F 	F     $!: !: !:F!: !: !:F: : :B> > >"4 "4 "4H	C 	C 	CM M M5 5 52; ; ;(1 1 12*0 *0 *0 *0 *0X00 00 00 00 00d  0B B B6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(< (< (<TA A A$%: %: %:N&: &: &:P&: &: &:P* * *(J J J!4 !4 !4FH H H7 7 7
	F 	F 	F" " "&!6 !6 !6F!: !: !:F!: !: !:F: : :BC C C$$> $> $>L9 9 9 ": ": ":H* * *2: : :!2 !2 !2F
< 
< 
<= = =	  	  	 : : :>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>.ComponentsNrI   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*   rJ   rK   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   rl   )rs   rm   )r   rm   s     r   r   z(UtilityRegistrationTests._getTargetClass
      ??????""r   Nc                     ddl m}  G d d|          } |d          } G d d          } |            }d}d	}	|                                 }
 |
|||||	|          ||fS )
Nr   rC   c                       e Zd ZdS )AUtilityRegistrationTests._makeOne.<locals>.InterfaceClassSubclassNrI   r'   r   r   InterfaceClassSubclassr  
  rM   r   r  rL   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*   rJ   rK   r  r'   r   r   	_Registryr  
  #        # # # # #r   r  r   	DOCSTRINGrU   rD   r   )r   ra   rb   rD   r  rW   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)rr   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)rr   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TESTNrI   r'   r   r   
_Componentr  
          HHHr   r  zAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')r:   r   r  
_componentr  	_registryrx   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   rc   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   rc   r   r)   __hash__idr   r  r  r  rx   s        r   test___hash__z&UtilityRegistrationTests.test___hash__
  M    XX
#}}Z88Iu2/////r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   rc   r   r,   r  s        r   test___eq___identityz-UtilityRegistrationTests.test___eq___identity
  ?    XX
#}}Z88Iub!!!!!r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r
  r   r  r  r  rx   ur2r  s          r   test___eq___hitz(UtilityRegistrationTests.test___eq___hit
  V    XX
#}}Z88IuMM*--	Qc	"""""r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   rc   r   r   r   r  _component2r  r  rx   r  r  s           r   test___eq___missz)UtilityRegistrationTests.test___eq___miss
  a    XX
hh#}}Z88IuMM+..	Qs#####r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r  r  s        r   test___ne___identityz-UtilityRegistrationTests.test___ne___identity  A    XX
#}}Z88Iur"""""r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  r  s          r   test___ne___hitz(UtilityRegistrationTests.test___ne___hit	  X    XX
#}}Z88IuMM*--	Qs#####r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r
  r  s           r   test___ne___missz)UtilityRegistrationTests.test___ne___miss  _    XX
hh#}}Z88IuMM+..	Qc	"""""r   c                     t                      }|                     |          \  }}}|                     ||k                d S 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   |_        |                     ||k                d S N2rc   r   r   r,   r  s           r   test___lt___missz)UtilityRegistrationTests.test___lt___miss!  j    XX
hh#}}Z88IuMM+..	Q3;S!!!!!r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r
  r  s        r   test___le___identityz-UtilityRegistrationTests.test___le___identity)  r  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r
  r  s          r   test___le___hitz(UtilityRegistrationTests.test___le___hit.  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r*  r  s           r   test___le___missz)UtilityRegistrationTests.test___le___miss4  j    XX
hh#}}Z88IuMM+..	Q3;c	"""""r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r  r  s        r   test___gt___identityz-UtilityRegistrationTests.test___gt___identity<  r#  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r*  r  s           r   test___gt___hitz(UtilityRegistrationTests.test___gt___hitA  j    XX
hh#}}Z88IuMM+..	Q3;b!!!!!r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  r  s          r   test___gt___missz)UtilityRegistrationTests.test___gt___missI  X    XX
#}}Z88IuMM*--	Qr"""""r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r
  r  s        r   test___ge___identityz-UtilityRegistrationTests.test___ge___identityO  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  rc   r   r   r   r  s           r   test___ge___missz)UtilityRegistrationTests.test___ge___missT  l    XX
hh#}}Z88IuMM+..	Q3;s#####r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r*  r  s          r   test___ge___hitz(UtilityRegistrationTests.test___ge___hit\  a    XX
#}}Z88IuMM*--	Q3;r	"""""r   )NN)r*   rJ   rK   r   r   r  r  r=   r  r  r  r  r  r  r  r  r  r"  r%  r+  r.  r0  r2  r5  r7  r:  r=  r@  rC  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   rc  )rs   rd  )r   rd  s     r   r   z(AdapterRegistrationTests._getTargetClassf  r  r   Nc                     ddl m}  G d d|          } |d          } |d          } G d d          } |            }d}d	}	|                                 }
 |
||f||||	          ||fS )
Nr   rC   c                       e Zd ZdS )/AdapterRegistrationTests._makeOne.<locals>.IFooNrI   r'   r   r   rL   rJ  m  rM   r   rL   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__t  r  r   Nr  r'   r   r   r  rL  s  r  r   r  r   r  r  r   ra   rD   rL   rW   r`  r  r   r   r  r  s              r   r   z!AdapterRegistrationTests._makeOnej      >>>>>>	 	 	 	 	> 	 	 	 tF||tF||	# 	# 	# 	# 	# 	# 	# 	# 9;;$$&&E(TGT4C@@
 	
r   c                 Z    ddl m} ddlm}  |||                                            d S )Nr   IAdapterRegistrationr  )rr   rR  r  r  r   )r   rR  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   rQ  r  )rr   rR  r  r  r   )r   rR  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  NrI   r'   r   r   r  rY    r  r   r  zCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')r:   r   r  r  rU  r  rx   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  r]    r  r   r  CAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')r  rZ  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  rc    r  r   r  r_  r  rZ  s         r   r  z8AdapterRegistrationTests.test___repr___component_wo_name  r`  r   c                     t                      }|                     |          \  }}}|                     |                                t	          |                     d S r   r  r   r  rU  r  rx   s        r   r  z&AdapterRegistrationTests.test___hash__  r  r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r
  rf  s        r   r  z-AdapterRegistrationTests.test___eq___identity  r  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r
  r   r  rU  r  rx   ar2r  s          r   r  z(AdapterRegistrationTests.test___eq___hit  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  r   r  r  rU  r  rx   rj  r  s           r   r  z)AdapterRegistrationTests.test___eq___miss  r  r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r  rf  s        r   r  z-AdapterRegistrationTests.test___ne___identity  r  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  ri  s          r   r  z)AdapterRegistrationTests.test___ne___miss  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r
  rl  s           r   test___ne___hit_componentz2AdapterRegistrationTests.test___ne___hit_component  r   r   c                    ddl m}  G d d|          } |d          }t                      }|                     |          \  }}}|                     |          \  }}	}	||_        |                     ||k               d S )Nr   rC   c                       e Zd ZdS )?AdapterRegistrationTests.test___ne___hit_provided.<locals>.IFooNrI   r'   r   r   rL   rs    rM   r   rL   rI  )rU   rD   rc   r   rw   r,   )
r   rD   rL   rR  r  rU  r  rx   rj  r  s
             r   test___ne___hit_providedz1AdapterRegistrationTests.test___ne___hit_provided  s    >>>>>>	 	 	 	 	> 	 	 	 tF||XX
#}}Z88IuMM*--	Qc	"""""r   c                 "   ddl m}  G d d|          } |d          }t                      }t                      }|                     |          \  }}}|                     |          \  }	}
}
|f|	_        |                     ||	k               d S )Nr   rC   c                       e Zd ZdS )?AdapterRegistrationTests.test___ne___hit_required.<locals>.IFooNrI   r'   r   r   rL   rw    rM   r   rL   rI  )rU   rD   rc   r   rk  r,   )r   rD   rL   rR  r  r  rU  r  rx   rj  r  s              r   test___ne___hit_requiredz1AdapterRegistrationTests.test___ne___hit_required  s    >>>>>>	 	 	 	 	> 	 	 	 tF||XX
hh#}}Z88IuMM+..	Qwc	"""""r   c                     t                      }|                     |          \  }}}|                     ||k                d S r   r  rf  s        r   r"  z-AdapterRegistrationTests.test___lt___identity  r#  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k                d S r   r  ri  s          r   r%  z(AdapterRegistrationTests.test___lt___hit  r&  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k                d S r(  r*  rl  s           r   r+  z)AdapterRegistrationTests.test___lt___miss	  r,  r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r
  rf  s        r   r.  z-AdapterRegistrationTests.test___le___identity  r  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r
  ri  s          r   r0  z(AdapterRegistrationTests.test___le___hit  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r*  rl  s           r   r2  z)AdapterRegistrationTests.test___le___miss  r3  r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r  rf  s        r   r5  z-AdapterRegistrationTests.test___gt___identity$  r#  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r*  rl  s           r   r7  z(AdapterRegistrationTests.test___gt___hit)  r8  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|                     ||k               d S r   r  ri  s          r   r:  z)AdapterRegistrationTests.test___gt___miss1  r;  r   c                     t                      }|                     |          \  }}}|                     ||k               d S r   r
  rf  s        r   r=  z-AdapterRegistrationTests.test___ge___identity7  r  r   c                     t                      }t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r?  rl  s           r   r@  z)AdapterRegistrationTests.test___ge___miss<  rA  r   c                     t                      }|                     |          \  }}}|                     |          \  }}}|dz   |_        |                     ||k               d S r(  r*  ri  s          r   rC  z(AdapterRegistrationTests.test___ge___hitD  rD  r   r   )r*   rJ   rK   r   r   rS  rV  r=   r  r  r  r  r  r  r  r  rp  rt  rx  r"  r%  r+  r.  r0  r2  r5  r7  r:  r=  r@  rC  r'   r   r   rF  rF  d  s       # # #
 
 
 
.B B B
/ / /
 
 

 
 
 
 
 
 0 0 0
" " "
# # #$ $ $# # #
$ $ $# # ## # ## # #" " "
# # #" " "" " "
# # ## # #" " "
" " "# # #" " "
$ $ $# # # # #r   rF  c                   (    e Zd Zd ZddZd Zd ZdS )SubscriptionRegistrationTestsc                     ddl m} |S )Nr   r  )rs   r  )r   r  s     r   r   z-SubscriptionRegistrationTests._getTargetClassN  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   rC   c                       e Zd ZdS )4SubscriptionRegistrationTests._makeOne.<locals>.IFooNrI   r'   r   r   rL   r  U  rM   r   rL   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__\  r  r   Nr  r'   r   r   r  r  [  r  r   r  r   r  r  rN  s              r   r   z&SubscriptionRegistrationTests._makeOneR  rO  r   c                 Z    ddl m} ddlm}  |||                                            d S )Nr    ISubscriptionAdapterRegistrationr  )rr   r  r  r  r   )r   r  r  s      r   7test_class_conforms_to_ISubscriptionAdapterRegistrationzUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistrationi  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  )rr   r  r  r  r   )r   r  r  sarr  s        r   :test_instance_conforms_to_ISubscriptionAdapterRegistrationzXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistrationn  sR    NNNNNN666666MMOO	Q5s;;;;;r   r   )r*   rJ   rK   r   r   r  r  r'   r   r   r  r  L  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   r9  )rs   r:  )r   r:  s     r   r   z(HandlerRegistrationTests._getTargetClassw  r  r   Nc                     ddl m}  G d d|          } |d          } G d d          } |            }d}d}|                                 }	 |	||f|||          ||fS )	Nr   rC   c                       e Zd ZdS )/HandlerRegistrationTests._makeOne.<locals>.IFooNrI   r'   r   r   rL   r  ~  rM   r   rL   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   ra   rD   rL   rW   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  )rr   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  )rr   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        |u            |                     |j        |j        u            |                     |j        d u            d S )Nc                     t                      r   r\   rh  s    r   r^   z:HandlerRegistrationTests.test_properties.<locals>._factory  r_   r   )r   r,   handlerrb   rw   )r   r^   r  r  s       r   test_propertiesz(HandlerRegistrationTests.test_properties  s{    	( 	( 	(==**Aq
h.///
bj0111t+,,,,,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  NrI   r'   r   r   rs  r    r  r   rs  =HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')r:   r   rs  r  r  rx   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   rs  r    r  r   rs  r  r:   r  s        r   test___repr___factory_wo_namez6HandlerRegistrationTests.test___repr___factory_wo_name  s    	 	 	 	 	 	 	 	  $}}XXZZ88IuHH	
 	
 	
 	
 	
r   r   )
r*   rJ   rK   r   r   r  r  r  r  r  r'   r   r   r  r  u  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*   rJ   rK   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*   rJ   rK   r  r'   r   r   r  r    s#        5 5 5 5 5r   r  c                       e Zd ZdS )PersistentDictComponentsNrI   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  r4   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   rc   rV   r   r  rA  r  r  r)   r*   assertIsNotNoner  )r   r  r4   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*   rJ   rK   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*   rJ   rK   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*   rJ   rK   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>*  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__(  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__1  sD    ///11 	- 	-JCDKe,,,,	- 	-r   N)r*   rJ   rK   r  r  r  r'   r   r   r!   r!   &  sA        ( ( (  - - - - -r   r!   )r  unittestr    r   r(   r   rs   r   TestCaser	   r  r  rF  r  r  r  r  r   r  r  r  r  r  r!   r'   r   r   <module>r     s      $ $ $ $ $ $ ; ; ; ; ; ; . . . . . .m)K m)K m)K m)K m)Kh' m)K m)K m)K`S       "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   