edZddlZddlmZddlmZddlmZGddejZ Gdd e Z Gd d ejZ Gd d ejZ GddejZ GddejZGddeZGddeZGddeeZGddeeZGddejZGddeZGddeZGd d!Zy)"zComponent Registry TestsN Interface)VerifyingAdapterRegistry ComponentsceZdZdZdsdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Zd=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGfdFZHfdGZIdHZJdIZKdJZLdKZMdLZNdMZOfdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^d]Z_d^Z`d_Zad`ZbdaZcdbZddcZeddZfdeZgdfZhdgZidhZjdiZkdjZldkZmdlZndmZodnZpdoZqdtdpZrdqZsdrZtxZuS)uComponentsTestsctSNrselfs D/usr/lib/python3/dist-packages/zope/interface/tests/test_registry.py_getTargetClasszComponentsTests._getTargetClasssc6|j|g|i|Sr r)r nameargskws r_makeOnezComponentsTests._makeOnes"%t##%d8T8R88rc@ddlm}gfd}t||}|fS)Nr)registryc,j||fyr append)rr_eventss r_notifyz,ComponentsTests._wrapEvents.._notify"s NND": &r)notify)zope.interfacer_Monkey)r rr_monkeyrs @r _wrapEventszComponentsTests._wrapEventss'+ '(73rcddlm}|jd}|j|jd|j|j d|j t|j||j t|j||j|jj d|j|jj d|j|ji|j|ji|j|jg|j|jgy)Nr)AdapterRegistrytesting)zope.interface.adapterr$r assertEqual__name__ __bases__ assertTrue isinstanceadapters utilities_utility_registrations_adapter_registrations_subscription_registrations_handler_registrations)r r$comps rtest_ctor_no_basesz"ComponentsTests.test_ctor_no_bases's:}}Y'  2 ,  4==/BC  4>>?CD 00"5 1126 44b9 44b9 992> 44b9rc|jd}|jd|f}|j|jd|j|j|f|j|jj|jf|j|j j|j fy)Nbaser%)rr(r)r*r-r.)r r6r3s rtest_ctor_w_basez ComponentsTests.test_ctor_w_base5s}}V$}}Y0  2 $1 004==2BC 11DNN3DErc\|jd}|jt|dy)Nr%zrr(reprr r3s r test___repr__zComponentsTests.test___repr__=s%}}Y' d%;r?r3s rtest_assign_to___bases__z(ComponentsTests.test_assign_to___bases__Cs g& g&}} %8 00..%..9 ; 11//5??; =rcddlm}m}Gdd|}|d}|dGdd}|}d}|j}|j ||| |j |j |df||dfy) NrnamedInterfaceClassc eZdZy)FComponentsTests.test_registerUtility_with_component_name..IFooNr) __module__ __qualname__r&rrIFoorFR rrJfooc eZdZy)EComponentsTests.test_registerUtility_with_component_name..FooNrGr&rrFoorNV rrOinforQ)zope.interface.declarationsrCrDrregisterUtilityr(r/) r rCrDrJifoorOrL_infor3s r(test_registerUtility_with_component_namez8ComponentsTests.test_registerUtility_with_component_nameNsE > F| u    e}} S$U3   ' 'e 4 %  rcd}t}|j}|jt|j||y)Nctr NotImplementedErrorr&rr_factoryzQComponentsTests.test_registerUtility_both_factory_and_component.._factoryc %' 'r componentfactory)objectr assertRaises TypeErrorrTr r\_to_regr3s r/test_registerUtility_both_factory_and_componentz?ComponentsTests.test_registerUtility_both_factory_and_componentbs; ((}} )T%9%9$+X  ?rcddlm}ddlm}ddlm}Gdd|}|d}d}d}t }|j} |j\} } | 5| j||||ddd|j| jjd|||u|j| j||f||df|j| jjd|d |f|jt!| d | d\} } | \}|j| i|jt#|||jt#|j ||j|j j$| u|j|j j&|u|j|j j(|u|j|j j*|u|j|j j,|u|j|j j.duy#1swYxYw) NrrD RegisteredUtilityRegistrationc eZdZy)>ComponentsTests.test_registerUtility_w_component..IFooNrGr&rrrJrnorKrrJrQr)rSrDzope.interface.interfacesrjzope.interface.registryrlrarr"rTr+r. _adaptersr(r/ _subscriberslenr,rprovidedrr_rQr`)r rDrjrlrJrUrV_namerer3r!rrrevents r test_registerUtility_w_componentz0ComponentsTests.test_registerUtility_w_componentjs>8? > F|(}}++-  >  $u = > 003D9%@GKL 44T5[A!5$/ 1 44Q7=bAG:N Wq)1:b R   5*56  5<<1DEF  --56  --56  ))U23  ..'9:  ))U23  ,,45# > >s II(cddlm}ddlm}ddlm}Gdd|}|d}d}d}t fd }|j} |j\} } | 5| jd|||| ddd|jt| d | d\} } | \}|j| i|jt|||jt|j ||j|j j| u|j|j j|u|j|j j |u|j|j j"u|j|j j$|u|j|j j&|uy#1swYnxYw) Nrrhrirkc eZdZy).IFooNrGr&rrrJr|rKrrJrQrcSr r&resrr\z@ComponentsTests.test_registerUtility_w_factory.._factoryNrr`rp)rSrDrqrjrrrlrarr"rTr(rur+r,rrvrr_rQr`)r rDrjrlrJrUrVrwr\r3r!rrrrxres @rtest_registerUtility_w_factoryz.ComponentsTests.test_registerUtility_w_factorys>8? > F|( }}++-  M  tUE8 L M Wq)1:b R   5*56  5<<1DEF  --56  --56  ))U23  ..'9:  ))U23  ,,89 M Ms G""G,cGdd}d}d}|}|j}|jt|j|d||y)Nc eZdZy)GComponentsTests.test_registerUtility_no_provided_available..FooNrGr&rrrOrrKrrOrQr)rrbrcrT)r rOrVrwrer3s r*test_registerUtility_no_provided_availablez:ComponentsTests.test_registerUtility_no_provided_availablesL  %}} )..ue Mrcddlm}ddlm}ddlm}ddlm}Gdd|}Gdd }|d}d }d } |} || ||j} |j\} } | 5| j| d| |ddd|jt| d | d\}}|\}|j|i|jt|||jt|j||j|jj| u|j|jj |u|j|jj"| u|j|jj$| u|j|jj&|u|j|jj(duy#1swYnxYw) NrdirectlyProvidesrhrirkc eZdZy)>ComponentsTests.test_registerUtility_wo_provided..IFooNrGr&rrrJrrKrrJc eZdZy)=ComponentsTests.test_registerUtility_wo_provided..FooNrGr&rrrOrrKrrOrQrrp)rSrrDrqrjrrrlrr"rTr(rur+r,rarrvrr_rQr`)r rrDrjrlrJrOrUrVrwrer3r!rrrrxs r test_registerUtility_wo_providedz0ComponentsTests.test_registerUtility_wo_provideds@>8? >   F|%$'}}++-  >  $u = > Wq)1:b R   5*56  5<<1DEF  --56  --56  ))U23  ..'9:  ))U23  ,,45 > >s /G00G:cLddlm}Gdd|}|d}d}d}t}|j}|j |||||j \}} |5|j ||||ddd|j t| dy#1swY%xYw)Nrrhc eZdZy)JComponentsTests.test_registerUtility_duplicates_existing_reg..IFooNrGr&rrrJrrKrrJrQr)rSrDrarrTr"r(ru r rDrJrUrVrwrer3r!rs r,test_registerUtility_duplicates_existing_regz > F|(}} WdE59++-  >  $u = > Wq) > >s !BB#cddlm}Gdd|}|d}d}d}d}t}|j}|j |||||j \} } | 5|j ||||ddd|j t| d|j |j||f||df|j |jjd|d |fy#1swYyxYw) Nrrhc eZdZy)CComponentsTests.test_registerUtility_w_different_info..IFooNrGr&rrrJrrKrrJinfo1info2rro rSrDrarrTr"r(rur/r.rt) r rDrJrU_info1_info2rwrer3r!rs r%test_registerUtility_w_different_infoz5ComponentsTests.test_registerUtility_w_different_infos> > F|(}} WdE6:++-  ?  $v > ? Wq) 44dE]C!640 2 44Q7=bA! %  ? ?s #C00C9cVddlm}Gdd|}|d}d}d}d}t}t}|j} | j |||||j \} } | 5| j ||||ddd|j t| d|j | j||f||df|j | j||f||df|j | jjd|d ||fy#1swYxYw) Nrrhc eZdZy)SComponentsTests.test_registerUtility_w_different_names_same_component..IFooNrGr&rrrJrrKrrJrQname1name2rpror r rDrJrUrV_name1_name2 _other_regrer3r!rs r5test_registerUtility_w_different_names_same_componentzEComponentsTests.test_registerUtility_w_different_names_same_components,> > F|X (}} Zvu=++-  ?  $ > ? Wq) 44dF^D$eT2 4 44dF^D!5$/ 1 44Q7=bA$g/ 1 ? ?s -DD(cddlm}ddlm}ddlm}ddlm}Gdd|}|d}d}d }tt} } |j} | j| ||||j\} } | 5| j| |||ddd|jt| d | d\}}|\}|j|i|jt|||jt|j||j|jj| u|j|jj |u|j|jj"|u|j|jj$| u|j|jj&|u|j|jj(du| d \}}|\}|j|i|jt|||jt|j||j|jj| u|j|jj |u|j|jj"|u|j|jj$| u|j|jj&|u|j|jj(duy#1swYxYw) Nrrh Unregisteredrirkc eZdZy)HComponentsTests.test_registerUtility_replaces_existing_reg..IFooNrGr&rrrJrrKrrJrQrrrp)rSrDrqrrjrrrlrarrTr"r(rur+r,rrvrr_rQr`)r rDrrjrlrJrUrVrw_before_afterr3r!rrrrxs r*test_registerUtility_replaces_existing_regz:ComponentsTests.test_registerUtility_replaces_existing_regs>:8? > F| (FH}} WdE59++-  =  ue < = Wq)1:b R   5,78  5<<1DEF  --56  --56  ))U23  ..'9:  ))U23  ,,451:b R   5*56  5<<1DEF  --56  --56  ))U23  ..&89  ))U23  ,,451 = =s =MMczddlm}Gdd|}|d}d}d}d}t}|j}|j |||||j \} } | 5|j ||||ddd|j |jjd|d|fy#1swY:xYw) Nrrhc eZdZy)DComponentsTests.test_registerUtility_w_existing_subscr..IFooNrGr&rrrJr<rKrrJrQrrro) rSrDrarrTr"r(r.rt r rDrJrUrVrrrer3r!rs r&test_registerUtility_w_existing_subscrz6ComponentsTests.test_registerUtility_w_existing_subscr9s> > F|(}} WdFE:++-  ?  $ > ? 44Q7=bAG:N ? ?s #B11B:c&ddlm}Gdd|}|d}d}d}t}|j}|j \}} |5|j ||||dddd|j t| dy#1swY%xYw)Nrrhc eZdZy);ComponentsTests.test_registerUtility_wo_event..IFooNrGr&rrrJrMrKrrJrQrF)rSrDrarr"rTr(rurs rtest_registerUtility_wo_eventz-ComponentsTests.test_registerUtility_wo_eventJs> > F|(}}++-  E  $ue D E Wq) E Es BBcGdd|j}|}|jtt|j t t |jdGddt}|jt||j t t |jdy)Nc"eZdZdZfdZxZS)dComponentsTests.test_registerUtility_changes_object_identity_after..CompThatChangesAfter1Regrc|xjdz c_t|||jdk(rt|j|_yy)Nrp) reg_countsuperrTdictr/r r __class__s rrTztComponentsTests.test_registerUtility_changes_object_identity_after..CompThatChangesAfter1Reg.registerUtility^sB!#'.>>Q&26t7R7R2SD/'rr)rHrIrrT __classcell__rs@rCompThatChangesAfter1Regr\sI T Trrrpc eZdZy)PComponentsTests.test_registerUtility_changes_object_identity_after..IFooNrGr&rrrJrirKrrJrrrTrarr(rulistregisteredUtilities)r rr3rJs r2test_registerUtility_changes_object_identity_afterzBComponentsTests.test_registerUtility_changes_object_identity_afterYs Tt';';'= T() VXy1 T$":":"<=>B 9  VXt, T$":":"<=>BrcPGdd|j}|}|jtt|j t t |jdGddt}|jt||j t t |jdGddt}|jt||j t t |jd y) Nc"eZdZdZfdZxZS)eComponentsTests.test_registerUtility_changes_object_identity_before..CompThatChangesAfter2Regrc|xjdz c_|jdk(rt|j|_t||y)Nrpr)rrr/rrTrs rrTzuComponentsTests.test_registerUtility_changes_object_identity_before..CompThatChangesAfter2Reg.registerUtilityts=!#>>Q&26t7R7R2SD/'.rrrs@rCompThatChangesAfter2RegrrsI / /rrrpc eZdZy)QComponentsTests.test_registerUtility_changes_object_identity_before..IFooNrGr&rrrJrrKrrJrc eZdZy)QComponentsTests.test_registerUtility_changes_object_identity_before..IBarNrGr&rrIBarrrKrrr)r rr3rJrs r3test_registerUtility_changes_object_identity_beforezCComponentsTests.test_registerUtility_changes_object_identity_beforeos /t';';'= /() VXy1 T$":":"<=>B 9  VXt, T$":":"<=>B 9  VXt, T$":":"<=>Brcl|j}|jt|jdddy)N)r_rvr`)rrbrcunregisterUtilityr;s rAtest_unregisterUtility_neither_factory_nor_component_nor_providedzQComponentsTests.test_unregisterUtility_neither_factory_nor_component_nor_provideds2}} )T%;%;$(4  Grcd}t}|j}|jt|j||y)Nctr rZr&rrr\zSComponentsTests.test_unregisterUtility_both_factory_and_component.._factoryr]rr^)rarrbrcrrds r1test_unregisterUtility_both_factory_and_componentzAComponentsTests.test_unregisterUtility_both_factory_and_components; ((}} )T%;%;$+X  ?rc,ddlm}Gdd|}|d}d}t}|j}|j \}}|5|j |||} ddd|j  |j |y#1swY,xYw)Nrrhc eZdZy)EComponentsTests.test_unregisterUtility_w_component_miss..IFooNrGr&rrrJrrKrrJr)rSrDrarr"r assertFalse) r rDrJrUrwrer3r!runregs r'test_unregisterUtility_w_component_missz7ComponentsTests.test_unregisterUtility_w_component_misss> > F|(}}++-  A**7D%@E A  ! A As B  Bcddlm}ddlm}ddlm}Gdd|}|d}d}t }|j}|j||||j\} } | 5|j|||} ddd|j |j|jj|j||f|jv|j|jj |j#t%| d| d\} } | \}|j#| i|jt'|||jt'|j ||j|j j(|u|j|j j*|u|j|j j,|u|j|j j.|u|j|j j0duy#1swYxYw) Nrrhrrkc eZdZy)@ComponentsTests.test_unregisterUtility_w_component..IFooNrGr&rrrJrrKrrJrrp)rSrDrqrrrrlrarrTr"rr+rr.rsr/rtr(rur,rrvrr_r`)r rDrrlrJrUrwrer3r!rrrrrxs r"test_unregisterUtility_w_componentz2ComponentsTests.test_unregisterUtility_w_components>:? > F|(}} WdE2++-  A**7D%@E A  112 $$*E*EEF 445 Wq)1:b R   5,78  5<<1DEF  --56  --56  ))U23  ..'9:  ,,45! A As *H==Icddlm}ddlm}ddlm}Gdd|}|d}d}d}t fd }|j} | jd|||| |j\} } | 5| jd||| } ddd|j |jt| d | d\} }| \}|j|i|jt|||jt|j ||j|j j| u|j|j j |u|j|j j"|u|j|j j$u|j|j j&|uy#1swYXxYw) Nrrhrrkc eZdZy)>ComponentsTests.test_unregisterUtility_w_factory..IFooNrGr&rrrJrrKrrJrQrcSr r&r~srr\zBComponentsTests.test_unregisterUtility_w_factory.._factoryrrrrp)rSrDrqrrrrlrarrTr"rr+r(rur,rrvrr_r`)r rDrrlrJrUrVrwr\r3r!rrrrrxres @r test_unregisterUtility_w_factoryz0ComponentsTests.test_unregisterUtility_w_factorys>:? > F|( }} T4xH++-  P**4uh*OE P  Wq)1:b R   5,78  5<<1DEF  --56  --56  ))U23  ..'9:  ,,89 P Ps 5G!!G+cBddlm}ddlm}ddlm}ddlm}Gdd|}Gdd }|d}d }d } |} || ||j} | j| || ||j\} } | 5| j| d| }ddd|j|jt| d | d\}}|\}|j|i|jt|||jt|j||j|jj | u|j|jj"|u|j|jj$| u|j|jj&| u|j|jj(|u|j|jj*duy#1swYxYw) Nrrrhrrkc eZdZy)IComponentsTests.test_unregisterUtility_wo_explicit_provided..IFooNrGr&rrrJrrKrrJc eZdZy)HComponentsTests.test_unregisterUtility_wo_explicit_provided..FooNrGr&rrrOrrKrrOrQrrprSrrDrqrrrrlrrTr"rr+r(rur,rarrvrr_rQr`r rrDrrlrJrOrUrVrwrer3r!rrrrrxs r+test_unregisterUtility_wo_explicit_providedz;ComponentsTests.test_unregisterUtility_wo_explicit_provideds@>:? >   F|%$'}} WdE59++-  A**7D%@E A  Wq)1:b R   5,78  5<<1DEF  --56  --56  ))U23  ..'9:  ))U23  ,,45 A A HHcBddlm}ddlm}ddlm}ddlm}Gdd|}Gdd }|d}d }d } |} || ||j} | j| || ||j\} } | 5| j|| }ddd|j|jt| d | d\}}|\}|j|i|jt|||jt|j||j|jj | u|j|jj"|u|j|jj$| u|j|jj&| u|j|jj(|u|j|jj*duy#1swYxYw)Nrrrhrrkc eZdZy)LComponentsTests.test_unregisterUtility_wo_component_or_factory..IFooNrGr&rrrJrrKrrJc eZdZy)KComponentsTests.test_unregisterUtility_wo_component_or_factory..FooNrGr&rrrOrrKrrOrQrrvrrprrs r.test_unregisterUtility_wo_component_or_factoryz>ComponentsTests.test_unregisterUtility_wo_component_or_factory s@>:? >   F|%$'}} WdE59++-  F**Du*EE F  Wq)1:b R   5,78  5<<1DEF  --56  --56  ))U23  ..'9:  ))U23  ,,45 F Frcddlm}Gdd|}|d}d}d}d}t}|j}|j |||||j |||||j \} } | 5|j |||ddd|j|jjd|d|fy#1swY:xYw) Nrrhc eZdZy)FComponentsTests.test_unregisterUtility_w_existing_subscr..IFooNrGr&rrrJr0rKrrJrQrrro rSrDrarrTr"rr(r.rtrs r(test_unregisterUtility_w_existing_subscrz8ComponentsTests.test_unregisterUtility_w_existing_subscr-s> > F|(}} WdFE: WdFE:++-  :  " "7D& 9 : 44Q7=bAG:N : : 7CC cddlm}Gdd|}|d}d}d}d}t}|j}|j |||||j |||||j \} } | 5|j |||ddd|j|jjd|d|fy#1swY:xYw) Nrrhc eZdZy)SComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable..IFooNrGr&rrrJrBrKrrJrQrrro) rSrDrrrTr"rr(r.rtrs r5test_unregisterUtility_w_existing_subscr_non_hashablezEComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable?s> > F|&}} WdFE: WdFE:++-  :  " "7D& 9 : 44Q7=bAG:N : :rcddlm}ddlm}Gdd|}|d}d}d}d}t }|j } | j ||||| j |||||j\} } | 5| j|||ddd|j| jjd|d |fy#1swY:xYw) Nrrh)_UtilityRegistrationsc eZdZy)_ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_fresh_cache..IFooNrGr&rrrJr WrKrrJrQrrro) rSrDrrrrrrTr"rr(r.rt) r rDrrJrUrVrrrer3r!rs rAtest_unregisterUtility_w_existing_subscr_non_hashable_fresh_cachezQComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_fresh_cacheQs ?A > F|&}} WdFE: WdFE:++-  :  " "7D& 9 : 44Q7=bAG:N : :s =C  Ccddlm}Gdd|}|d}d}d}d}t}|j}|j |||||j |||||j d|j |||||j \} } | 5|j|||ddd|jdt|jjy#1swY9xYw) Nrrhc eZdZy)]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted..IFooNrGr&rrrJr lrKrrJrQrrr6) rSrDrrrT__init__r"rr(rur.rtrs r?test_unregisterUtility_w_existing_subscr_non_hashable_reinittedzOComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinittedgs ? > F|&}} WdFE: WdFE: f WdFE:++-  :  " "7D& 9 : C ; ;<= : :s C((C1cddlm}Gdd|}|d}d}d}d}t}t}|j} | j ||||| j |||||j \} } | 5| j |||ddd|j| jjd|d|fy#1swY:xYw) Nrrhc eZdZy)VComponentsTests.test_unregisterUtility_w_existing_subscr_other_component..IFooNrGr&rrrJrrKrrJrQrrrorrs r8test_unregisterUtility_w_existing_subscr_other_componentzHComponentsTests.test_unregisterUtility_w_existing_subscr_other_components> > F|X (}} Zvu= WdFE:++-  :  " "7D& 9 : 44Q7=bA$ ( : : CCcddlm}Gdd|}|d}d}d}d}t}t}|j } | j ||||| j |||||j \} } | 5| j|||ddd|j| jjd|d|fy#1swY:xYw) Nrrhc eZdZy)aComponentsTests.test_unregisterUtility_w_existing_subscr_other_component_mixed_hash..IFooNrGr&rrrJrrKrrJrQrrro) rSrDrarrrTr"rr(r.rtrs rCtest_unregisterUtility_w_existing_subscr_other_component_mixed_hashzSComponentsTests.test_unregisterUtility_w_existing_subscr_other_component_mixed_hashs> > F|X &}} Zvu= WdFE:++-  :  " "7D& 9 : 44Q7=bA$ ( : :rcv|j}|jt|jgyr )rr(rrr;s rtest_registeredUtilities_emptyz.ComponentsTests.test_registeredUtilities_emptys+}} d66892>rcddlm}ddlm}Gdd|}|d}d}d}d}t }|j } | j ||||| j ||||t| jd } |jt| d |jt| d||j| dj| u|j| dj|u|j| dj|u|j| dj |u|j| dj"|u|j| dj$du|jt| d ||j| d j| u|j| d j|u|j| d j|u|j| d j |u|j| d j"|u|j| d j$duy) Nrrhrkc eZdZy)?ComponentsTests.test_registeredUtilities_notempty..IFooNrGr&rrrJrrKrrJrQrrc|jSr rrs rzCComponentsTests.test_registeredUtilities_notempty..s qvvrkeyrrp)rSrDrrrlrarrTsortedrr(rur+r,rrvrr_rQr`) r rDrlrJrUrVrrrer3regs r!test_registeredUtilities_notemptyz1ComponentsTests.test_registeredUtilities_notemptys>? > F|(}} WdFE: WdFE:T--/5EF S1%  3q6+>?@ A4/0 A4/0 A v-. A((G34 A u,- A$./  3q6+>?@ A4/0 A4/0 A v-. A((G34 A u,- A$./rcddlm}Gdd|}|d}|j}|j|j |duy)Nrrhc eZdZy)?ComponentsTests.test_queryUtility_miss_no_default..IFooNrGr&rrrJr*rKrrJ)rSrDrr+ queryUtilityr rDrJrUr3s r!test_queryUtility_miss_no_defaultz1ComponentsTests.test_queryUtility_miss_no_defaultsA> > F|}} ))$/478rcddlm}Gdd|}|d}|j}t}|j |j |||uy)Nrrhc eZdZy)>ComponentsTests.test_queryUtility_miss_w_default..IFooNrGr&rrrJr0rKrrJdefault)rSrDrrar+r+)r rDrJrUr3_defaults r test_queryUtility_miss_w_defaultz0ComponentsTests.test_queryUtility_miss_w_defaultsM> > F|}}8 ))$)AXMNrcddlm}Gdd|}|d}t}|j}|j |||j |j ||uy)Nrrhc eZdZy)3ComponentsTests.test_queryUtility_hit..IFooNrGr&rrrJr7rKrrJ)rSrDrarrTr+r+r rDrJrUrer3s rtest_queryUtility_hitz%ComponentsTests.test_queryUtility_hitsX> > F|(}} Wd+ ))$/7:;rcddlm}ddlm}Gdd|}|d}|j }|j ||j |y)NrrhComponentLookupErrorc eZdZy)2ComponentsTests.test_getUtility_miss..IFooNrGr&rrrJr>rKrrJ)rSrDrqr<rrb getUtility)r rDr<rJrUr3s rtest_getUtility_missz$ComponentsTests.test_getUtility_misss?>B > F|}} .Frcddlm}Gdd|}|d}t}|j}|j |||j |j ||uy)Nrrhc eZdZy)1ComponentsTests.test_getUtility_hit..IFooNrGr&rrrJrCrKrrJ)rSrDrarrTr+r?r8s rtest_getUtility_hitz#ComponentsTests.test_getUtility_hitsV> > F|(}} Wd+ -89rcddlm}Gdd|}|d}|j}|jt |j |gy)Nrrhc eZdZy)7ComponentsTests.test_getUtilitiesFor_miss..IFooNrGr&rrrJrGrKrrJ)rSrDrr(rgetUtilitiesForr,s rtest_getUtilitiesFor_missz)ComponentsTests.test_getUtilitiesFor_misssE> > F|}} d224892>rc"ddlm}Gdd|}|d}d}d}t}|j}|j ||||j ||||j t |j|||f||fgy)Nrrhc eZdZy)6ComponentsTests.test_getUtilitiesFor_hit..IFooNrGr&rrrJrLrKrrJrrr)rSrDrarrTr(r%rHr rDrJrUrrrer3s rtest_getUtilitiesFor_hitz(ComponentsTests.test_getUtilitiesFor_hits> > F|(}} Wd8 Wd8  4 4T :;!7+fg->? Arcddlm}Gdd|}|d}|j}|jt |j |gy)Nrrhc eZdZy)DComponentsTests.test_getAllUtilitiesRegisteredFor_miss..IFooNrGr&rrrJrQrKrrJ)rSrDrr(rgetAllUtilitiesRegisteredForr,s r&test_getAllUtilitiesRegisteredFor_missz6ComponentsTests.test_getAllUtilitiesRegisteredFor_misssE> > F|}} d??EFKrcddlm}Gdd|}|d}d}d}t}|j}|j ||||j ||||j t |j||gy)Nrrhc eZdZy)CComponentsTests.test_getAllUtilitiesRegisteredFor_hit..IFooNrGr&rrrJrVrKrrJrrr)rSrDrarrTr(rrRrMs r%test_getAllUtilitiesRegisteredFor_hitz5ComponentsTests.test_getAllUtilitiesRegisteredFor_hits> > F|(}} Wd8 Wd8 d??EF! $rcddlm}m}Gdd|}|d}|d}|dGdd}d }|j}|j ||f|| |j |j |f|df||fy) NrrBc eZdZy)FComponentsTests.test_registerAdapter_with_component_name..IFooNrGr&rrrJrZ/rKrrJrrLc eZdZy)EComponentsTests.test_registerAdapter_with_component_name..FooNrGr&rrrOr\4rPrrOrQrR)rSrCrDrregisterAdapterr(r0) r rCrDrJrUibarrOrVr3s r(test_registerAdapter_with_component_namez8ComponentsTests.test_registerAdapter_with_component_name+sE > F|F| u    }} S4'4e<   ' 'u(< = %L rcddlm}ddlm}ddlm}Gdd|}|d}|d}d}d }d } |j } |j\} } | 5| j| |f|||ddd|j| jjd |||| u|j| j|f||f| |f|jt| d | d\} }| \}|j|i|jt|||jt|j ||j|j j"| u|j|j j$|u|j|j j&|f|j|j j(|u|j|j j*|u|j|j j,| uy#1swYxYw) NrrhriAdapterRegistrationc eZdZy)SComponentsTests.test_registerAdapter_w_explicit_provided_and_required..IFooNrGr&rrrJrdErKrrJrrQrctr rZcontexts rr\zWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.._factoryLr]rrprSrDrqrjrrrbrr"r]r+r-rsr(r0rur,rarrvrequiredrrQr`)r rDrjrbrJrUr^rVrwr\r3r!rrrrxs r5test_registerAdapter_w_explicit_provided_and_requiredzEComponentsTests.test_registerAdapter_w_explicit_provided_and_required@s>8? > F|F| (}}++-  H  D7D% G H  //248>uE#$ % 44dWdE5IJ"E* , Wq)1:b R   5*56  5<<1DEF  --56  --56 ..8  ))U23  ))U23  ,,89# H Hs H55H?cddlm}Gdd|}|d}d}d}Gdd }|j}|jt|j ||f|| y) Nrrhc eZdZy)HComponentsTests.test_registerAdapter_no_provided_available..IFooNrGr&rrrJrmfrKrrJrrQrc eZdZy)LComponentsTests.test_registerAdapter_no_provided_available.._FactoryNrGr&rr_FactoryromrKrrprrQrSrDrrbrcr])r rDrJr^rVrwrpr3s r*test_registerAdapter_no_provided_availablez:ComponentsTests.test_registerAdapter_no_provided_availablecse> > F|  }} )T%9%98dW$5  2rcddlm}ddlm}ddlm}ddlm}Gdd|}|d}|d}d }d } t} ||Gd d } |j} |j\} }| 5| j| |f| | ddd|j| jjd||| | u|j| j|f|| f| |f|jt!|d|d\}}|\}|j|i|jt#|||jt#|j||j|jj$| u|j|jj&|u|j|jj(|f|j|jj*| u|j|jj,|u|j|jj.| uy#1swYxYw)Nrrh implementerrirac eZdZy)GComponentsTests.test_registerAdapter_wo_explicit_provided..IFooNrGr&rrrJrxzrKrrJrrQrc eZdZy)KComponentsTests.test_registerAdapter_wo_explicit_provided.._FactoryNrGr&rrrprzrPrrprqrp)rSrDrvrqrjrrrbrarr"r]r+r-rsr(r0rur,rrvrirrQr`)r rDrvrjrbrJrUr^rVrwrerpr3r!rrrrxs r)test_registerAdapter_wo_explicit_providedz9ComponentsTests.test_registerAdapter_wo_explicit_providedts>;8? > F|F|( T     }}++-  L  D7U K L  //248>uE#$ % 44dWdE5IJ"E* , Wq)1:b R   5*56  5<<1DEF  --56  --56 ..8  ))U23  ))U23  ,,89# L Ls <II!cddlm}Gdd|}|d}d}d}Gdd}|j}|jt|j |||| y) Nrrhc eZdZy)HComponentsTests.test_registerAdapter_no_required_available..IFooNrGr&rrrJr~rKrrJrQrc eZdZy)LComponentsTests.test_registerAdapter_no_required_available.._FactoryNrGr&rrrprs rrprvrrQrrr rDrJrUrVrwrpr3s r*test_registerAdapter_no_required_availablez:ComponentsTests.test_registerAdapter_no_required_availablesb> > F|  }} )T%9%98#'e%  Arc ddlm}Gdd|}|d}|d}d}d}Gdd }|j}|jt|j ||||| y) Nrrhc eZdZy)EComponentsTests.test_registerAdapter_w_invalid_required..IFooNrGr&rrrJrrKrrJrrQrc eZdZy)IComponentsTests.test_registerAdapter_w_invalid_required.._FactoryNrGr&rrrprrKrrprrr) r rDrJrUr^rVrwrpr3s r'test_registerAdapter_w_invalid_requiredz7ComponentsTests.test_registerAdapter_w_invalid_requiredsk> > F|F|  }} )T%9%98E  Grcddlm}ddlm}ddlm}ddlm}Gdd|}|d}d}d }Gd d } |j} |j\} } | 5| j| dg||| ddd|j| jjd |||| u|j| j|f||f| |f|jt!| d | d\} }| \}|j|i|jt#|||jt#|j$||j|j$j&| u|j|j$j(|u|j|j$j*|f|j|j$j,|u|j|j$j.|u|j|j$j0| uy#1swYxYw)Nrrhrrirac eZdZy)MComponentsTests.test_registerAdapter_w_required_containing_None..IFooNrGr&rrrJrrKrrJrQrc eZdZy)QComponentsTests.test_registerAdapter_w_required_containing_None.._FactoryNrGr&rrrprrKrrprrp)rSrDzope.interface.interfacerrqrjrrrbrr"r]r+r-rsr(r0rur,rarrvrirrQr`)r rDrrjrbrJrUrVrwrpr3r!rrrrxs r/test_registerAdapter_w_required_containing_Nonez?ComponentsTests.test_registerAdapter_w_required_containing_Nones>68? > F|  }}++-  9  D6D&+% ! 9 9  //29=dCEJ#$ % 44i\45NO"E* , Wq)1:b R   5*56  5<<1DEF  --56  --56 .. =  ))U23  ))U23  ,,89% 9 9s H;;Icddlm}ddlm}ddlm}ddlm}ddlm}Gdd|}|d}|d }d } d } Gd d } ||Gdd} || } |j}|j\}}|5|j| | g|| | ddd|j|jjd| || | u|j|j| f|| f| | f|jt!|d|d\}}|\}|j|i|jt#|||jt#|j$||j|j$j&|u|j|j$j(|u|j|j$j*| f|j|j$j,| u|j|j$j.| u|j|j$j0| uy#1swYxYw)Nrrhru) implementedByrirac eZdZy)NComponentsTests.test_registerAdapter_w_required_containing_class..IFooNrGr&rrrJrrKrrJrrQrc eZdZy)RComponentsTests.test_registerAdapter_w_required_containing_class.._FactoryNrGr&rrrprrKrrpc eZdZy)RComponentsTests.test_registerAdapter_w_required_containing_class.._ContextNrGr&rr_ContextrrPrrrrp)rSrDrvrrqrjrrrbrr"r]r+r-rsr(r0rur,rarrvrirrQr`)r rDrvrrjrbrJrUr^rVrwrpr _ctx_implr3r!rrrrxs r0test_registerAdapter_w_required_containing_classz@ComponentsTests.test_registerAdapter_w_required_containing_classs)>;=8? > F|F|   T     !(+ }}++-  9  H:&+% ! 9 9  //29=dCEJ#$ % 44i\45NO"E* , Wq)1:b R   5*56  5<<1DEF  --56  --56 .. =  ))U23  ))U23  ,,89% 9 9s I&&I0c ddlm}Gdd|}|d}d}d}Gdd}|j}|jt|j |t g||| y) Nrrhc eZdZy)MComponentsTests.test_registerAdapter_w_required_containing_junk..IFooNrGr&rrrJr rKrrJrQrc eZdZy)QComponentsTests.test_registerAdapter_w_required_containing_junk.._FactoryNrGr&rrrprrKrrpr)rSrDrrbrcr]rars r/test_registerAdapter_w_required_containing_junkz?ComponentsTests.test_registerAdapter_w_required_containing_junksf> > F|  }} )T%9%98fhZ#'e%  Arcddlm}ddlm}ddlm}Gdd|}|d}|dd}d }Gfd d }|j } |j\} } | 5| j|||| ddd|j| jjd |||u|j| jf||f||f|jt| d | d\} } | \}|j| i|jt|||jt|j ||j|j j"| u|j|j j$|u|j|j j&f|j|j j(|u|j|j j*|u|j|j j,|uy#1swYxYw)Nrrhrirac eZdZy)GComponentsTests.test_registerAdapter_wo_explicit_required..IFooNrGr&rrrJrrKrrJrrQrceZdZWfZy)KComponentsTests.test_registerAdapter_wo_explicit_required.._FactoryNr)rHrI__component_adapts__r^srrpr! $(7 rrprrprh)r rDrjrbrJrUrVrwrpr3r!rrrrxr^s @r)test_registerAdapter_wo_explicit_requiredz9ComponentsTests.test_registerAdapter_wo_explicit_requireds>8? > F|F| + +}}++-  -  Du&+ ! - -  //248>uE#$ % 44dWdE5IJ"E* , Wq)1:b R   5*56  5<<1DEF  --56  --56 ..8  ))U23  ))U23  ,,89% - -s $H>>Ic .ddlm}Gdd|}|d}|d}d}d}d}|j}|j\} } | 5|j ||f|||d ddd|j t | dy#1swY%xYw) Nrrhc eZdZy);ComponentsTests.test_registerAdapter_wo_event..IFooNrGr&rrrJr=rKrrJrrQrctr rZrfs rr\z?ComponentsTests.test_registerAdapter_wo_event.._factoryDr]rF)rx)rSrDrr"r]r(ru) r rDrJrUr^rVrwr\r3r!rs rtest_registerAdapter_wo_eventz-ComponentsTests.test_registerAdapter_wo_event:s> > F|F| (}}++-  .  D7D%', ! . . Wq) . .s B  Bcj|j}|jt|jddyN)r`rv)rrbrcunregisterAdapterr;s r3test_unregisterAdapter_neither_factory_nor_providedzCComponentsTests.test_unregisterAdapter_neither_factory_nor_providedMs/}} )T%;%;"&  7rcddlm}Gdd|}|d}|j}|jt|j d|dy)Nrrhc eZdZy)QComponentsTests.test_unregisterAdapter_neither_factory_nor_required..IFooNrGr&rrrJrTrKrrJr`rvri)rSrDrrbrcrr,s r3test_unregisterAdapter_neither_factory_nor_requiredzCComponentsTests.test_unregisterAdapter_neither_factory_nor_requiredRsJ> > F|}} )T%;%;"&  Frcddlm}Gdd|}|d}|d}Gdd}|j}|j\}}|5|j ||f|} ddd|j  y#1swYxYw)Nrrhc eZdZy)9ComponentsTests.test_unregisterAdapter_miss..IFooNrGr&rrrJr]rKrrJrc eZdZy)=ComponentsTests.test_unregisterAdapter_miss.._FactoryNrGr&rrrprarKrrp)rSrDrr"rr r rDrJrUr^rpr3r!rrs rtest_unregisterAdapter_missz+ComponentsTests.test_unregisterAdapter_miss[s> > F|F|  }}++-  D**8dWdCE D  D Ds BB cddlm}ddlm}ddlm}Gdd|}|d}|d}Gdd }|j }|j||f||j\} } | 5|j||f|} ddd|j |j|jj|j|j|jt!| d | d\} } | \}|j| i|jt#|||jt#|j$||j|j$j&|u|j|j$j(|u|j|j$j*|f|j|j$j,d |j|j$j.d |j|j$j0|uy#1swYxYw) Nrrhrrac eZdZy)YComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required..IFooNrGr&rrrJrnrKrrJrc eZdZy)]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.._FactoryNrGr&rrrprrrKrrprpro)rSrDrqrrrrbrr]r"rr+rr-rsr0r(rur,rarrvrirrQr`)r rDrrbrJrUr^rpr3r!rrrrrxs r;test_unregisterAdapter_hit_w_explicit_provided_and_requiredzKComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_requiredjs>:? > F|F|  }} Xw5++-  D**8dWdCE D  001 445 Wq)1:b R   5,78  5<<1DEF  --56  --56 ..8 **B/ **B/  ,,89! D D 1II c<ddlm}ddlm}ddlm}ddlm}Gdd|}|d}|d}||Gd d }|j} | j||f||j\} } | 5| j||f} ddd|j |jt| d | d\} }| \}|j|i|jt|||jt|j||j|jj | u|j|jj"|u|j|jj$|f|j|jj&d |j|jj(d |j|jj*|uy#1swY}xYw) Nrrhrurrac eZdZy)IComponentsTests.test_unregisterAdapter_wo_explicit_provided..IFooNrGr&rrrJrrKrrJrc eZdZy)MComponentsTests.test_unregisterAdapter_wo_explicit_provided.._FactoryNrGr&rrrprrPrrprpro)rSrDrvrqrrrrbrr]r"rr+r(rur,rarrvrirrQr`)r rDrvrrbrJrUr^rpr3r!rrrrrxs r+test_unregisterAdapter_wo_explicit_providedz;ComponentsTests.test_unregisterAdapter_wo_explicit_provideds>;:? > F|F| T     }} Xw5++-  >**8dW=E >  Wq)1:b R   5,78  5<<1DEF  --56  --56 ..8 **B/ **B/  ,,89 > > HHc ddlm}ddlm}ddlm}Gdd|}|d}|dGfdd }|j }|j|f||j\}} |5|j|| } ddd|j |jt| d | d\} } | \} |j| i|jt| ||jt| j||j| jj|u|j| jj |u|j| jj"f|j| jj$d |j| jj&d |j| jj(|uy#1swY}xYw) Nrrhrrac eZdZy)IComponentsTests.test_unregisterAdapter_wo_explicit_required..IFooNrGr&rrrJrrKrrJrceZdZWfZy)MComponentsTests.test_unregisterAdapter_wo_explicit_required.._FactoryNrrsrrprrrrprvrpro)rSrDrqrrrrbrr]r"rr+r(rur,rarrvrirrQr`)r rDrrbrJrUrpr3r!rrrrrxr^s @r+test_unregisterAdapter_wo_explicit_requiredz;ComponentsTests.test_unregisterAdapter_wo_explicit_requireds>:? > F|F| + +}} Xw5++-  D**8d*CE D  Wq)1:b R   5,78  5<<1DEF  --56  --56 ..8 **B/ **B/  ,,89 D D 4HH cv|j}|jt|jgyr )rr(rregisteredAdaptersr;s rtest_registeredAdapters_emptyz-ComponentsTests.test_registeredAdapters_emptys+}} d5578"=rcddlm}ddlm}Gdd|}|d}|d}d}d}d}Gd d } |j } | j | |f|||| j | |f|||t | jd } |jt| d |jt| d||j| dj| u|j| dj|u|j| dj|f|j| dj|u|j| dj |u|j| dj"| u|jt| d||j| dj| u|j| dj|u|j| dj|f|j| dj|u|j| dj |u|j| dj"| uy)Nrrhrac eZdZy)>ComponentsTests.test_registeredAdapters_notempty..IFooNrGr&rrrJrrKrrJrQrrc eZdZy)BComponentsTests.test_registeredAdapters_notempty.._FactoryNrGr&rrrprrKrrpc|jSr rr s rr"zBComponentsTests.test_registeredAdapters_notempty..s affrr#rrp)rSrDrrrbrr]r%rr(rur+r,rrvrirrQr`) r rDrbrJrUr^rVrrrpr3r&s r test_registeredAdapters_notemptyz0ComponentsTests.test_registeredAdapters_notemptys>? > F|F|  }} XwfeD XwfeDT,,.4DE S1%  3q6+>?@ A4/0 A4/0 Q4'2 A v-. A u,- A(23  3q6+>?@ A4/0 A4/0 Q4'2 A v-. A u,- A(23rcddlm}Gdd|}|d}|j}t}|j |j ||duy)Nrrhc eZdZy)?ComponentsTests.test_queryAdapter_miss_no_default..IFooNrGr&rrrJrrKrrJrSrDrrar+ queryAdapter)r rDrJrUr3_contexts r!test_queryAdapter_miss_no_defaultz1ComponentsTests.test_queryAdapter_miss_no_defaultsJ> > F|}}8 ))(D9TABrcddlm}Gdd|}|d}|j}t}t}|j |j ||||uy)Nrrhc eZdZy)>ComponentsTests.test_queryAdapter_miss_w_default..IFooNrGr&rrrJrrKrrJr1r)r rDrJrUr3rr3s r test_queryAdapter_miss_w_defaultz0ComponentsTests.test_queryAdapter_miss_w_defaultsZ> > F|}}88    hh  ?8 K Mrczddlm}ddlm}Gdd|}|d}|d}Gdd}||Gd d }|}|j} | j ||f|| j ||} |j t| ||j | j|uy) Nrrhruc eZdZy)3ComponentsTests.test_queryAdapter_hit..IFooNrGr&rrrJrrKrrJrceZdZdZy)7ComponentsTests.test_queryAdapter_hit.._Factoryc||_yr rfr rgs rrz@ComponentsTests.test_queryAdapter_hit.._Factory.__init__  & rNr)rHrIrr&rrrpr  'rrpc eZdZy)7ComponentsTests.test_queryAdapter_hit.._ContextNrGr&rrrr rPrr) rSrDrvrr]rr+r,rg r rDrvrJrUr^rprrr3adapters rtest_queryAdapter_hitz%ComponentsTests.test_queryAdapter_hits>; > F|F| ' ' T     :}} Xw5##Hd3  7H56 834rcddlm}ddlm}ddlm}Gdd|}|d}|d}||Gdd }|}|j } |j || j||y) Nrrhrur;c eZdZy)2ComponentsTests.test_getAdapter_miss..IFooNrGr&rrrJrrKrrJrc eZdZy)6ComponentsTests.test_getAdapter_miss.._ContextNrGr&rrrrrPrr)rSrDrvrqr<rrb getAdapter) r rDrvr<rJrUr^rrr3s rtest_getAdapter_missz$ComponentsTests.test_getAdapter_missss>;B > F|F| T     :}} .//8T ;rcfddlm}ddlm}Gdd|}|d}|d}Gdd}||Gd d }|}|j} | j ||f|| j ||} |j | ||j| j|y) Nrrhruc eZdZy)1ComponentsTests.test_getAdapter_hit..IFooNrGr&rrrJr)rKrrJrceZdZdZy)5ComponentsTests.test_getAdapter_hit.._Factoryc||_yr rfrs rrz>ComponentsTests.test_getAdapter_hit.._Factory.__init__.rrNrr&rrrpr-rrrpc eZdZy)5ComponentsTests.test_getAdapter_hit.._ContextNrGr&rrrr 0rPrr) rSrDrvrr]rassertIsInstanceassertIsrgrs rtest_getAdapter_hitz#ComponentsTests.test_getAdapter_hit&s>; > F|F| ' ' T     :}} Xw5//(D1 gx0 goox0rcddlm}ddlm}Gdd|}Gdd|}Gdd |}||Gd d }||Gd d |}Gdd}Gdd} |j } | j | |f|| j ||f||j | |} | j| |} |j| | |j| j| t|| } | j| |} |j| ||j| j| y)Nrrruc eZdZy)8ComponentsTests.test_getAdapter_hit_super..IBaseNrGr&rrIBaser>rKrrc eZdZy);ComponentsTests.test_getAdapter_hit_super..IDerivedNrGr&rrIDerivedrArKrrc eZdZy)7ComponentsTests.test_getAdapter_hit_super..IFooNrGr&rrrJrDrKrrJc eZdZy)7ComponentsTests.test_getAdapter_hit_super..BaseNrGr&rrBaserGrPrrc eZdZy):ComponentsTests.test_getAdapter_hit_super..DerivedNrGr&rrDerivedrKrPrrceZdZdZy)>ComponentsTests.test_getAdapter_hit_super..AdapterBasec||_yr rfrs rrzGComponentsTests.test_getAdapter_hit_super..AdapterBase.__init__PrrNrr&rr AdapterBaserOrrrceZdZdZy)AComponentsTests.test_getAdapter_hit_super..AdapterDerivedc||_yr rfrs rrzJComponentsTests.test_getAdapter_hit_super..AdapterDerived.__init__TrrNrr&rrAdapterDerivedr!Srrr# rrrSrvrr]_should_not_changerr r rgrr rrvrrrJrrrr#r3derivedrsupers rtest_getAdapter_hit_superz)ComponentsTests.test_getAdapter_hit_super:s9,; I  u  9  U      X  d    ' ' ' '}} ^h[$? [5(D9 %)//'40 g~6 goow/Wg&//$- g{3 goow/rcddlm}ddlm}Gdd|}Gdd|}Gdd |}Gd d }Gd d |}||Gdd|}||Gdd||} Gdd} Gdd} |j } | j | |f|| j | |f||j | | } | j| |}|j|| |j|j| t| | }| j||}|j|| |j|j| y)Nrrruc eZdZy)aComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..IBaseNrGr&rrrr,jrKrrc eZdZy)dComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..IDerivedNrGr&rrrr.mrKrrc eZdZy)`ComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..IFooNrGr&rrrJr0prKrrJc eZdZy)`ComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..BaseNrGr&rrrr2srKrrc eZdZy)bComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..Child1NrGr&rrChild1r4vrKrr5c eZdZy)bComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..Child2NrGr&rrChild2r7yrPrr8c eZdZy)cComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..DerivedNrGr&rrrr:}rPrrceZdZdZy)gComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..AdapterBasec||_yr rfrs rrzpComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..AdapterBase.__init__rrNrr&rrrr<rrrceZdZdZy)jComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..AdapterDerivedc||_yr rfrs rrzsComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamond..AdapterDerived.__init__rrNrr&rrr#r?rrr#r$)r rrvrrrJrr5r8rrr#r3r'rr(rs rBtest_getAdapter_hit_super_when_parent_implements_interface_diamondzRComponentsTests.test_getAdapter_hit_super_when_parent_implements_interface_diamondfsS,; I  u  9    T  U  T    X  ff    ' ' ' '}} ^h[$? [5(D9 %)//'40 g~6 goow/Wg&//$- g{3 goow/rc:ddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} |j} |j | j | | f|dy) Nrrhruc eZdZy)9ComponentsTests.test_queryMultiAdapter_miss..IFooNrGr&rrrJrDrKrrJrIBazc eZdZy)>ComponentsTests.test_queryMultiAdapter_miss.._Context1NrGr&rr _Context1rGrPrrHc eZdZy)>ComponentsTests.test_queryMultiAdapter_miss.._Context2NrGr&rr _Context2rJrPrrK)rSrDrvrr(queryMultiAdapter r rDrvrJrUr^ibazrHrK _context1 _context2r3s rtest_queryMultiAdapter_missz+ComponentsTests.test_queryMultiAdapter_misss>; > F|F|F| T      T     K K }} //I0FM rcTddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} t} |j } |j | j | | f|| | uy) Nrrhruc eZdZy)CComponentsTests.test_queryMultiAdapter_miss_w_default..IFooNrGr&rrrJrTrKrrJrrEc eZdZy)HComponentsTests.test_queryMultiAdapter_miss_w_default.._Context1NrGr&rrrHrVrPrrHc eZdZy)HComponentsTests.test_queryMultiAdapter_miss_w_default.._Context2NrGr&rrrKrXrPrrKr1)rSrDrvrarr+rL) r rDrvrJrUr^rNrHrKrOrPr3r3s r%test_queryMultiAdapter_miss_w_defaultz5ComponentsTests.test_queryMultiAdapter_miss_w_defaults>; > F|F|F| T      T     K K 8}}   " "Iy#94+3 # 58@ A Brcddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} Gd d } |j} | j | ||f|| j | | f|} |j t| | |j| j| | fy)Nrrhruc eZdZy)8ComponentsTests.test_queryMultiAdapter_hit..IFooNrGr&rrrJr\rKrrJrrEc eZdZy)=ComponentsTests.test_queryMultiAdapter_hit.._Context1NrGr&rrrHr^rPrrHc eZdZy)=ComponentsTests.test_queryMultiAdapter_hit.._Context2NrGr&rrrKr`rPrrKceZdZdZy)._Factoryc||f|_yr rfr context1context2s rrzEComponentsTests.test_queryMultiAdapter_hit.._Factory.__init__'1 rNrr&rrrprb 2rrp) rSrDrvrr]rLr+r,r(rgr rDrvrJrUr^rNrHrKrOrPrpr3rs rtest_queryMultiAdapter_hitz*ComponentsTests.test_queryMultiAdapter_hits>; > F|F|F| T      T     K K  2 2}} Xd|T:(()Y)?F  7H56 9i*@Arc>ddlm}ddlm}ddlm}Gdd|}|d}|d}|d}||Gd d }||Gd d } |} | } |j } |j || j| | f|y) Nrrhrur;c eZdZy)7ComponentsTests.test_getMultiAdapter_miss..IFooNrGr&rrrJrmrKrrJrrEc eZdZy)._Context1NrGr&rrrHrorPrrHc eZdZy)._Context2NrGr&rrrKrqrPrrK)rSrDrvrqr<rrbgetMultiAdapter) r rDrvr<rJrUr^rNrHrKrOrPr3s rtest_getMultiAdapter_missz)ComponentsTests.test_getMultiAdapter_misss>;B > F|F|F| T      T     K K }} ...I0F Nrcddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} Gd d } |j} | j | ||f|| j | | f|} |j t| | |j| j| | fy)Nrrhruc eZdZy)6ComponentsTests.test_getMultiAdapter_hit..IFooNrGr&rrrJrvrKrrJrrEc eZdZy);ComponentsTests.test_getMultiAdapter_hit.._Context1NrGr&rrrHrxrPrrHc eZdZy);ComponentsTests.test_getMultiAdapter_hit.._Context2NrGr&rrrKrzrPrrKceZdZdZy):ComponentsTests.test_getMultiAdapter_hit.._Factoryc||f|_yr rfrds rrzCComponentsTests.test_getMultiAdapter_hit.._Factory.__init__rgrNrr&rrrpr|rhrrp) rSrDrvrr]rrr+r,r(rgris rtest_getMultiAdapter_hitz(ComponentsTests.test_getMultiAdapter_hits>; > F|F|F| T      T     K K  2 2}} Xd|T:&& 9'=tD  7H56 9i*@Arcvfd}||_||j_||jj_y)Nc(jdy)NzNothing should get changed)fail)rr s r no_changesz6ComponentsTests._should_not_change..no_changes s II2 3r)changedr- _v_lookup)r r3rs` rr%z"ComponentsTests._should_not_change s- 4! * *4 'rc8ddlm}ddlm}Gdd|}Gdd|}Gdd |}||Gd d }||Gd d |}Gdd}Gdd|} |j } | j | ||f|| j |||f||j | |} | j| | f|} |j| | |j| j| |j| j| t|| } | j| | f|} |j| ||j| | |j| j| |j| j| y)Nrrruc eZdZy)=ComponentsTests.test_getMultiAdapter_hit_super..IBaseNrGr&rrrrrKrrc eZdZy)@ComponentsTests.test_getMultiAdapter_hit_super..IDerivedNrGr&rrrrrKrrc eZdZy).IFooNrGr&rrrJrrKrrJc eZdZy).BaseNrGr&rrrr rPrrc eZdZy)?ComponentsTests.test_getMultiAdapter_hit_super..DerivedNrGr&rrrr$rPrrceZdZdZy)CComponentsTests.test_getMultiAdapter_hit_super..AdapterBasec ||_||_yr )rerfrds rrzLComponentsTests.test_getMultiAdapter_hit_super..AdapterBase.__init__)s ( ( rNrr&rrrr(s )rrc eZdZy)FComponentsTests.test_getMultiAdapter_hit_super..AdapterDerivedNrGr&rrr#r-rKrr#)rrrSrvrr]r%rrr r rerfrassertNotIsInstancer&s rtest_getMultiAdapter_hit_superz.ComponentsTests.test_getMultiAdapter_hit_supers,; I  u  9  U      X  d    ) )  [ }} ^h-A4H [5(*;TB %)&&'94@ g~6 g&&0 g&&0Wg&&&g= g{3   .9 g&&0 g&&0rcLddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} |j} |j t | j | | f|gy) Nrrhruc eZdZy)4ComponentsTests.test_getAdapters_empty..IFooNrGr&rrrJrErKrrJrrEc eZdZy)9ComponentsTests.test_getAdapters_empty.._Context1NrGr&rrrHrJrPrrHc eZdZy)9ComponentsTests.test_getAdapters_empty.._Context2NrGr&rrrKrMrPrrK)rSrDrvrr(r getAdaptersrMs rtest_getAdapters_emptyz&ComponentsTests.test_getAdapters_emptyBs>; > F|F|F| T      T     K K }}  !!9i"8$? @" Frc ddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} |j} g fd } | j | ||f||j t | j| | f|g|j | | fgy) Nrrhruc eZdZy)CComponentsTests.test_getAdapters_factory_returns_None..IFooNrGr&rrrJrYrKrrJrrEc eZdZy)HComponentsTests.test_getAdapters_factory_returns_None.._Context1NrGr&rrrHr^rPrrHc eZdZy)HComponentsTests.test_getAdapters_factory_returns_None.._Context2NrGr&rrrKrarPrrKc,j||fyr r)rerf _called_withs r_side_effect_onlyzPComponentsTests.test_getAdapters_factory_returns_None.._side_effect_onlyhs   8 4 5r)rSrDrvrr]r(rr)r rDrvrJrUr^rNrHrKrOrPr3rrs @r%test_getAdapters_factory_returns_Nonez5ComponentsTests.test_getAdapters_factory_returns_NoneVs>; > F|F|F| T      T     K K }}   .t dC  !!9i"8$? @" F I(>'?@rcddlm}ddlm}Gdd|}|d}|d}|d}||Gdd }||Gd d }|} |} Gd d } Gdd} d} d}|j}|j | ||f|| |j | ||f||t |j | | f|}|jt|d|j|dd| |jt|dd| |j|dd||jt|dd| y)Nrrhruc eZdZy)8ComponentsTests.test_getAdapters_non_empty..IFooNrGr&rrrJrtrKrrJrrEc eZdZy)=ComponentsTests.test_getAdapters_non_empty.._Context1NrGr&rrrHryrPrrHc eZdZy)=ComponentsTests.test_getAdapters_non_empty.._Context2NrGr&rrrKr|rPrrKceZdZdZy)=ComponentsTests.test_getAdapters_non_empty.._Factory1c||f|_yr rfrds rrzFComponentsTests.test_getAdapters_non_empty.._Factory1.__init__rgrNrr&rr _Factory1rrhrrceZdZdZy)=ComponentsTests.test_getAdapters_non_empty.._Factory2c||f|_yr rfrds rrzFComponentsTests.test_getAdapters_non_empty.._Factory2.__init__rgrNrr&rr _Factory2rrhrrrrrrrp) rSrDrvrr]r%rr(rur+r,)r rDrvrJrUr^rNrHrKrOrPrrrrr3founds rtest_getAdapters_non_emptyz*ComponentsTests.test_getAdapters_non_emptypsl>; > F|F|F| T      T     K K  2 2 2 2}} Yt dH Yt dHt''I(>EF UQ' q!f-  58A; :; q!f-  58A; :;rc ddlm}Gdd|}|d}|d}d}d}d}|j}|jt|j ||f|||y) Nrrhc eZdZy)NComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name..IFooNrGr&rrrJrrKrrJrrrQctr rZrfs rr\zRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.._factoryr]r)rSrDrrbrcregisterSubscriptionAdapter) r rDrJrUr^rwrVr\r3s r0test_registerSubscriptionAdapter_w_nonblank_namez@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_namese> > F|F| (}} )T%E%E"TGT5% Arcddlm}ddlm}ddlm}Gdd|}|d}|d}d}d }d } |j } |j\} } | 5| j| |f|| ddd| jjd |||} |jt| d |j| d| u|j| j|f||| |fg|jt| d | d\}}|\}|j|i|jt|||jt|j ||j|j j"| u|j|j j$|u|j|j j&|f|j|j j(||j|j j*|u|j|j j,| uy#1swYxYw) NrrhriSubscriptionRegistrationc eZdZy)_ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required..IFooNrGr&rrrJrrKrrJrrorQctr rZrfs rr\zcComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required.._factoryr]rrRrprSrDrqrjrrrrr"rr-rtr(rur+r1r,rarrvrirrQr`)r rDrjrrJrUr^_blankrVr\r3r!rr&rrrxs rAtest_registerSubscriptionAdapter_w_explicit_provided_and_requiredzQComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_requireds >8D > F|F| (}}++-  9  , ,Xw27 - 9 9mm((+D1$7? S1% A(*+ 99 7D&(EBC E Wq)1:b R   5*56  5<<1IJK  --56  --56 ..8 **F3  ))U23  ,,89' 9 9s IIcddlm}ddlm}ddlm}ddlm}Gdd|}|d}|d}d }d } ||Gd d } |j} |j\} } | 5| j| |f| ddd| jjd||| }|jt|d|j|d| u|j| j|f|| | |fg|jt| d| d\}}|\}|j|i|jt!|||jt!|j"||j|j"j$| u|j|j"j&|u|j|j"j(|f|j|j"j*| |j|j"j,|u|j|j"j.| uy#1swYxYw)Nrrhrurirc eZdZy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided..IFooNrGr&rrrJrrKrrJrrQroc eZdZy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.._FactoryNrGr&rrrprrPrrprRrp)rSrDrvrqrjrrrrr"rr-rtr(rur+r1r,rarrvrirrQr`)r rDrvrjrrJrUr^rVrrpr3r!rr&rrrxs r5test_registerSubscriptionAdapter_wo_explicit_providedzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provideds >;8D > F|F| T     }}++-  L  , ,XwU , K Lmm((+D1$7? S1% A(*+ 99 7D&(EBC E Wq)1:b R   5*56  5<<1IJK  --56  --56 ..8 **F3  ))U23  ,,89% L Ls 2I))I3cddlm}ddlm}ddlm}Gdd|}|d}|dd}d }Gfd d }|j } |j\} } | 5| j||| ddd| jjd ||} |jt| d |j| d|u|j| jf||||fg|jt| d | d\} }| \}|j|i|jt|||jt|j ||j|j j"| u|j|j j$|u|j|j j&f|j|j j(||j|j j*|u|j|j j,|uy#1swYxYw)Nrrhrirc eZdZy)SComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required..IFooNrGr&rrrJrrKrrJrrQroceZdZWfZy)WComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.._FactoryNrrsrrprrrrp)rvrQrpr)r rDrjrrJrUrVrrpr3r!rr&rrrxr^s @r5test_registerSubscriptionAdapter_wo_explicit_requiredzEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_requireds >8D > F|F| + +}}++-  9  , ,t% - 9 9mm((+D1$7? S1% A(*+ 99 7D&(EBC E Wq)1:b R   5*56  5<<1IJK  --56  --56 ..8 **F3  ))U23  ,,89' 9 9s $II$c,ddlm}Gdd|}|d}|d}d}d}d}|j}|j\} } | 5|j ||f||d ddd|j t | dy#1swY%xYw) Nrrhc eZdZy)GComponentsTests.test_registerSubscriptionAdapter_wo_event..IFooNrGr&rrrJrrKrrJrrorQctr rZrfs rr\zKComponentsTests.test_registerSubscriptionAdapter_wo_event.._factoryr]rFrQrx)rSrDrr"rr(ru) r rDrJrUr^rrVr\r3r!rs r)test_registerSubscriptionAdapter_wo_eventz9ComponentsTests.test_registerSubscriptionAdapter_wo_events> > F|F| (}}++-  F  , ,Xw27u - F F Wq) F Fs B  Bcv|j}|jt|jgyr )rr(rregisteredSubscriptionAdaptersr;s r)test_registeredSubscriptionAdapters_emptyz9ComponentsTests.test_registeredSubscriptionAdapters_empty's+}} dAACDbIrcddlm}ddlm}Gdd|}|d}|d}d}d}Gdd }|j } | j ||f|| | j ||f|| t | j} |jt| d |jt| d||j| dj| u|j| dj|u|j| dj|f|j| dj||j| dj |u|j| dj"|u|jt| d ||j| d j| u|j| d j|u|j| d j|f|j| d j||j| d j |u|j| d j"|uy) Nrrhrc eZdZy)JComponentsTests.test_registeredSubscriptionAdapters_notempty..IFooNrGr&rrrJr/rKrrJrQroc eZdZy)NComponentsTests.test_registeredSubscriptionAdapters_notempty.._FactoryNrGr&rrrpr5rKrrprRrrp)rSrDrrrrrrrr(rur+r,rrvrirrQr`) r rDrrJrUr^rVrrpr3r&s r,test_registeredSubscriptionAdapters_notemptyzD > F|F|  }} ((D7Du(M ((D7Du(M46689 S1%  3q6+CDE A4/0 A4/0 Q4'2 Qf- A u,- A(23  3q6+CDE A4/0 A4/0 Q4'2 Qf- A u,- A(23rcddlm}Gdd|}|d}|d}d}|j}|jt|j |||y)Nrrhc eZdZy)PComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name..IFooNrGr&rrrJrOrKrrJrnonblank)rirvrrSrDrrbrcunregisterSubscriptionAdapter)r rDrJrUr^ _nonblankr3s r2test_unregisterSubscriptionAdapter_w_nonblank_namezBComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_nameLsX> > F|F| }} )T%G%G#'$Y  Hrcj|j}|jt|jddyr)rrbrcrr;s r?test_unregisterSubscriptionAdapter_neither_factory_nor_providedzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_providedXs/}} )T%G%G"&  7rcddlm}Gdd|}|d}|j}|jt|j d|dy)Nrrhc eZdZy)]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required..IFooNrGr&rrrJr_rKrrJrrr,s r?test_unregisterSubscriptionAdapter_neither_factory_nor_requiredzOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required]sJ> > F|}} )T%G%G"&  Frc:ddlm}Gdd|}|d}|d}Gdd}|j}|j\}}|5|j ||f|} ddd|j  |j |y#1swY,xYw)Nrrhc eZdZy)EComponentsTests.test_unregisterSubscriptionAdapter_miss..IFooNrGr&rrrJrhrKrrJrc eZdZy)IComponentsTests.test_unregisterSubscriptionAdapter_miss.._FactoryNrGr&rrrprlrKrrp)rSrDrr"rrrs r'test_unregisterSubscriptionAdapter_missz7ComponentsTests.test_unregisterSubscriptionAdapter_missfs> > F|F|  }}++-  P66x$$OE P  ! P Ps BBcddlm}ddlm}ddlm}Gdd|}|d}|d}Gdd }|j }|j||f||j\} } | 5|jd|f|} ddd|j |j|jj|j|j|jt!| d | d\} } | \}|j| i|jt#|||jt#|j$||j|j$j&|u|j|j$j(|u|j|j$j*|f|j|j$j,d |j|j$j.d |j|j$j0duy#1swYxYw) Nrrhrrc eZdZy)OComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory..IFooNrGr&rrrJrzrKrrJrc eZdZy)SComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.._FactoryNrGr&rrrpr~rKrrprprorSrDrqrrrrrrr"rr+rr-rtr1r(rur,rarrvrirrQr`r rDrrrJrUr^rpr3r!rrrrrxs r1test_unregisterSubscriptionAdapter_hit_wo_factoryzAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factoryvs>:D > F|F|  }} ((D7DA++-  L66tdWdKE L  334 99: Wq)1:b R   5,78  5<<1IJK  --56  --56 ..8 **B/ **B/  ,,45! L Lrcddlm}ddlm}ddlm}Gdd|}|d}|d}Gdd }|j }|j||f||j\} } | 5|j||f|} ddd|j |j|jj|j|j|jt!| d | d\} } | \}|j| i|jt#|||jt#|j$||j|j$j&|u|j|j$j(|u|j|j$j*|f|j|j$j,d |j|j$j.d |j|j$j0|uy#1swYxYw) Nrrhrrc eZdZy)NComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory..IFooNrGr&rrrJrrKrrJrc eZdZy)RComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.._FactoryNrGr&rrrprrKrrprprorrs r0test_unregisterSubscriptionAdapter_hit_w_factoryz@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factorys>:D > F|F|  }} ((D7DA++-  P66x$$OE P  334 99: Wq)1:b R   5,78  5<<1IJK  --56  --56 ..8 **B/ **B/  ,,89! P Prc<ddlm}ddlm}ddlm}ddlm}Gdd|}|d}|d}||Gd d }|j} | j||f||j\} } | 5| j||f} ddd|j |jt| d | d\} }| \}|j|i|jt|||jt|j||j|jj | u|j|jj"|u|j|jj$|f|j|jj&d |j|jj(d |j|jj*|uy#1swY}xYw) Nrrhrurrc eZdZy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided..IFooNrGr&rrrJr rKrrJrc eZdZy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.._FactoryNrGr&rrrpr rPrrprpro)rSrDrvrqrrrrrrr"rr+r(rur,rarrvrirrQr`)r rDrvrrrJrUr^rpr3r!rrrrrxs r7test_unregisterSubscriptionAdapter_wo_explicit_providedzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provideds>;:D > F|F| T     }} ((D7DA++-  J66x$IE J  Wq)1:b R   5,78  5<<1IJK  --56  --56 ..8 **B/ **B/  ,,89 J Jrc ddlm}ddlm}ddlm}Gdd|}|d}|dGfdd }|j }|j|f||j\}} |5|j|| } ddd|j |jt| d | d\} } | \} |j| i|jt| ||jt| j||j| jj|u|j| jj |u|j| jj"f|j| jj$d |j| jj&d |j| jj(|uy#1swY}xYw) Nrrhrrc eZdZy)UComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required..IFooNrGr&rrrJrrKrrJrceZdZWfZy)YComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.._FactoryNrrsrrprrrrprrpro)rSrDrqrrrrrrr"rr+r(rur,rarrvrirrQr`)r rDrrrJrUrpr3r!rrrrrxr^s @r7test_unregisterSubscriptionAdapter_wo_explicit_requiredzGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_requireds>:D > F|F| + +}} ((D7DA++-  P66x$6OE P  Wq)1:b R   5,78  5<<1IJK  --56  --56 ..8 **B/ **B/  ,,89 P Prcddlm}ddlm}Gdd|}|d}|d}|j}||Gdd}|}|j t |j |f|gy) Nrrhruc eZdZy)4ComponentsTests.test_subscribers_empty..IFooNrGr&rrrJrrKrrJrc eZdZy)3ComponentsTests.test_subscribers_empty..BarNrGr&rrBarrrPrr)rSrDrvrr(r subscribers) r rDrvrJrUr^r3rbars rtest_subscribers_emptyz&ComponentsTests.test_subscribers_emptysx>; > F|F|}} T     e d..vt<=rBrc ddlm}ddlm}Gdd|}|d}|d G fdd}Gd d |}|j}|j | f||j | f|| Gd d }|} |j | f|} d } t | | } |jt| d|jt| d||jt| d|y)Nrrhruc eZdZy)8ComponentsTests.test_subscribers_non_empty..IFooNrGr&rrrJrrKrrJrceZdZWfZdZy)._Factoryc||_yr )rrs rrzEComponentsTests.test_subscribers_non_empty.._Factory.__init__ s ' rN)r)rHrIrrrsrrpr! s$(7  (rrpc eZdZy)._DerivedNrGr&rr_Derivedr$ rKrr%c eZdZy)7ComponentsTests.test_subscribers_non_empty..BarNrGr&rrrr'rPrrc.|jjSr )rr)xs r _klassnamez>ComponentsTests.test_subscribers_non_empty.._klassnames;;'' 'rr#rrp) rSrDrvrrrr%r(rur+r,) r rDrvrJrUrpr%r3rrrr+r^s @rtest_subscribers_non_emptyz*ComponentsTests.test_subscribers_non_emptys>; > F|F| ( ( x }} ((D7DA ((D7DA T     e&&vt4  ([j9  [)1-  ;q>8<=  ;q>8<=rcddlm}Gdd|}|d}d}|j}d}|jt|j |||y)Nrrhc eZdZy)BComponentsTests.test_registerHandler_w_nonblank_name..IFooNrGr&rrrJr/!rKrrJrctr rZrfs rr\zFComponentsTests.test_registerHandler_w_nonblank_name.._factory&r]rrir)rSrDrrbrcregisterHandler)r rDrJrUrr3r\s r$test_registerHandler_w_nonblank_namez4ComponentsTests.test_registerHandler_w_nonblank_namesU> > F| }} ( )T%9%98#'i  9rc\ddlm}ddlm}ddlm}Gdd|}|d}d}d}d }|j } |j\} } | 5| j||f| ddd| jjd |d|} |jt| d |j| d|u|j| j|f|||fg|jt| d | d\} }| \}|j|i|jt|||jt|j ||j|j j"| u|j|j j$|f|j|j j&||j|j j(|u|j|j j*|uy#1swYxYw) NrrhriHandlerRegistrationc eZdZy)FComponentsTests.test_registerHandler_w_explicit_required..IFooNrGr&rrrJr81rKrrJrorQctr rZrfs rr\zJComponentsTests.test_registerHandler_w_explicit_required.._factory6r]rrRrp)rSrDrqrjrrr6rr"r2r-rtr(rur+r2r,rarrirrQr`)r rDrjr6rJrUrrVr\r3r!rr&rrrxs r(test_registerHandler_w_explicit_requiredz8ComponentsTests.test_registerHandler_w_explicit_required,s>8? > F| (}}++-  @  D7 ? @mm((+D1$7? S1% A(*+ 44 7FHe<= ? Wq)1:b R   5*56  5<<1DEF  --56 ..8 **F3  ))U23  ,,89# @ @s H!!H+c ddlm}Gdd|}|d d}d}G fdd}|j}|j\}}|5|j ||d ddd|j j d  d|} |jt| d |j| d|u|j|j f|||fg|jt|dy#1swYxYw) Nrrhc eZdZy)PComponentsTests.test_registerHandler_wo_explicit_required_no_event..IFooNrGr&rrrJr=QrKrrJrQroceZdZWfZy)TComponentsTests.test_registerHandler_wo_explicit_required_no_event.._FactoryNrrUsrrpr?Vs$(7 rrpFrrp) rSrDrr"r2r-rtr(rur+r2) r rDrJrVrrpr3r!rr&rUs @r2test_registerHandler_wo_explicit_required_no_eventzBComponentsTests.test_registerHandler_wo_explicit_required_no_eventNs> > F|  }}++-  D  U C Dmm((+D1$7? S1% A(*+ 44 7FHe<= ? Wq) D Ds C>>Dct|j}|jt|jyr )rrrregisteredHandlersr;s rtest_registeredHandlers_emptyz-ComponentsTests.test_registeredHandlers_emptyes)}} d55789rcddlm}ddlm}Gdd|}|d}d}d}|j }|j ||f|j ||fd}t |j| } |jt| d |jt| d||j| dj|f|j| djd |j| dj||j| djd |jt| d ||j| d j|f|j| d jd |j| d j||j| d jd y) Nrrhr5c eZdZy)?ComponentsTests.test_registeredHandlers_non_empty..IFooNrGr&rrrJrGlrKrrJctr rZrfs r _factory1zDComponentsTests.test_registeredHandlers_non_empty.._factory1or]rctr rZrfs r _factory2zDComponentsTests.test_registeredHandlers_non_empty.._factory2qr]rcB|jjjSr )r`__code__co_namer)s r _factory_namezHComponentsTests.test_registeredHandlers_non_empty.._factory_namevs99%%-- -rr#rrorp)rSrDrrr6rr2r%rCr(rur+r,rirr`rQ) r rDr6rJrUrIrKr3rOrs r!test_registeredHandlers_non_emptyz1ComponentsTests.test_registeredHandlers_non_emptyis>? > F| ( (}} Y0 Y0 .T446MJ  [)1-  ;q>3FGH Q004': Q,,b1 Q//; Q,,b1  ;q>3FGH Q004': Q,,b1 Q//; Q,,b1rcddlm}Gdd|}|d}d}|j}|jt|j |f|y)Nrrhc eZdZy)DComponentsTests.test_unregisterHandler_w_nonblank_name..IFooNrGr&rrrJrSrKrrJrr1)rSrDrrbrcunregisterHandler)r rDrJrUrr3s r&test_unregisterHandler_w_nonblank_namez6ComponentsTests.test_unregisterHandler_w_nonblank_namesN> > F| }} )T%;%;$(7  .IFooNrGr&rrrJrZrKrrJri)rSrDrrTr)r rDrJrUr3rs rtest_unregisterHandler_missz+ComponentsTests.test_unregisterHandler_misssH> > F|}}&&&8 rcddlm}ddlm}ddlm}Gdd|}|d}|j }d}|j }|j||f|j\}} |5|j||f} ddd|j |jt| d| d\} } | \} |j| i|jt| ||jt| j||j| jj|u|j| jj |f|j| jj"d |j| jj$|uy#1swY0xYw) Nrrhrr5c eZdZy)XComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided..IFooNrGr&rrrJr_rKrrJctr rZrfs rr\z\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.._factoryr]rrprorSrDrqrrrr6rr2r"rTr+r(rur,rarrirr`r rDrr6rJrUr3r\r!rrrrrxs r:test_unregisterHandler_hit_w_factory_and_explicit_providedzJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_providedsg>:? > F|}} (}} Xw/++-  >**8dW=E >  Wq)1:b R   5,78  5<<1DEF  --56 ..8 **B/  ,,89 > > 1F33F=cddlm}ddlm}ddlm}Gdd|}|d}|j }d}|j }|j||f|j\}} |5|j|f} ddd|j |jt| d | d\} } | \} |j| i|jt| ||jt| j||j| jj|u|j| jj |f|j| jj"d |j| jj$duy#1swY0xYw) Nrrhrr5c eZdZy)QComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided..IFooNrGr&rrrJrgrKrrJctr rZrfs rr\zUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.._factoryr]rr[rprorarbs r3test_unregisterHandler_hit_w_only_explicit_providedzCComponentsTests.test_unregisterHandler_hit_w_only_explicit_providedsh>:? > F|}} (}} Xw/++-  =**TG*.IFooNrGr&rrrJrlrKrrJceZdZWfZy)MComponentsTests.test_unregisterHandler_wo_explicit_required.._FactoryNrr@srrprnrrrprpro)rSrDrqrrrr6rr2r"rTr+r(rur,rarrirrQr`)r rDrr6rJrpr3r!rrrrrxrUs @r+test_unregisterHandler_wo_explicit_requiredz;ComponentsTests.test_unregisterHandler_wo_explicit_requiredsv>:? > F| + +}} X&++-  5**84E 5  Wq)1:b R   5,78  5<<1DEF  --56 ..8 **B/ **B/  ,,89 5 5s )GGcddlm}ddlm}Gdd|}|d}|j}||Gdd}|}|j |fy)Nrrhruc eZdZy)/ComponentsTests.test_handle_empty..IFooNrGr&rrrJrrrKrrJc eZdZy).ComponentsTests.test_handle_empty..BarNrGr&rrrrtrPrr)rSrDrvrhandle)r rDrvrJrUr3rrs rtest_handle_emptyz!ComponentsTests.test_handle_emptysY>; > F|}} T     e SFrct ddlm}ddlm}Gdd|}|d}g fd}g fd}|j}|j ||f|j ||f||Gdd }|} |j | |j | g|j | gy) Nrrhruc eZdZy)3ComponentsTests.test_handle_non_empty..IFooNrGr&rrrJryrKrrJc(j|yr r)rg _called_1s r _factory_1z9ComponentsTests.test_handle_non_empty.._factory_1   )rc(j|yr r)rg _called_2s r _factory_2z9ComponentsTests.test_handle_non_empty.._factory_2 r}rc eZdZy)2ComponentsTests.test_handle_non_empty..BarNrGr&rrrr rPrr)rSrDrvrr2rur() r rDrvrJrUr|rr3rrr{rs @@rtest_handle_non_emptyz%ComponentsTests.test_handle_non_emptys>; > F|  *  *}} Z$1 Z$1 T     e C SE* SE*rcGddt}|j}t}|r|n t}|j|||j||d|j t |j jd|j |j j|d|r|fn||fiig|j |j j||rdnd i|j||}|j||j||d}|j||j |j ji|j t |j jd y) Nc eZdZy)QComponentsTests.test_register_unregister_identical_objects_provided..IFooNrGr&rrrJr rKrrJrrrrprorr) rrrarTr(rur.rt _providedrr+)r identicalrJr3firstsecondress r3test_register_unregister_identical_objects_providedzCComponentsTests.test_register_unregister_identical_objects_provided sU 9 }}# UT2 Vd? T^^8891= 44 2IyE6?C8 7   11 y!a4  $$UT$: $$Vd$G  1126 T^^8891=rc(|jdy)NF)r)rr s r2test_register_unregister_nonequal_objects_providedzBComponentsTests.test_register_unregister_nonequal_objects_provided/ s @@5@QrcGddt}Gdd}|j}tdD]*}|j||dj |,|j j }|j j}|jt|d|jt|d d|jt|d |d|j j}|jt|d|jt|d d|jt|d |d|jt|d |d dt|x}|j _|jiix} |d |<td D]$} tt| } |d || | | <&|j||t|x} |j _ | jiix} | d |<d | d <td dD]/} tt| } |d || } | d xx| fz cc<1|j} |j|j j ||j| d dddd|jd}|j|j j |dz|j| ||j|||jt| d |d t|d |d |d |d D]}|j!|| d |d |j}|j|dd dd d|jd}|j|||j|j j |dzy)NceZdZdZy)GComponentsTests.test_rebuildUtilityRegistryFromLocalCache..IFoo Does nothingNr)rHrI__doc__r&rrrJr3  rrJceZdZdZy)YComponentsTests.test_rebuildUtilityRegistryFromLocalCache..UtilityImplementingFoorNrr&rrUtilityImplementingFoor6 rrrz{}rrprro r& )did_not_registerneeded_registereddid_not_subscribeneeded_subscribedT)rebuild)rrrangerTformatr. _generationrsr(rurttyperstrassertNotEqual$rebuildUtilityRegistryFromLocalCacheassertIn)r rJrcompsiorig_generation orig_adaptersorig_subscribers new_adaptersdrnew_subscribersr3rebuild_results_preflightrebuild_resultsorig_subscriberpreflight_after rebuild_afters r)test_rebuildUtilityRegistryFromLocalCachez9ComponentsTests.test_rebuildUtilityRegistryFromLocalCache2 s 9    r WA  ! !"8":Dt{{ST~ ! V W //5511  ]+Q/ ]1-.2 ]1-d34b9 ??77 -.2 -a0115 -a067; -a06r:;R@4G4 3F3HH u0B$&&LOD !"I 3Ds4y>D#A&t,T2AdG 3 M<89O>N9O9QQ%//6r"'))OA t $"!RL Ds4y>D #D)$/D bEdW E  %*$N$N$P! 44oF 2 "!#!"!# 5   DDTDR 44o6IJ 2OD }5  "4(, -  #D)"- . 0 0248< IO MM/?1+=d+CB+G H I DDF  "!"!#!" +  BB4BP  8 44o6IJr)test)T)vr)rHrIrrr"r4r7r<r@rWrfryrrrrrrrrrrrrrrrrrrrrr rrrrr'r-r4r9r@rDrIrNrSrWr_rjrsr{rrrrrrrrrrrrrrrrrrrr r)rArQrYrjrsr~r%rrrrrrrrrrrrrrrrrr rrr,r3r:rArDrPrUrWr\rcrirorvrrrrrrs@rr r sw9  :F= = (?6@:< M6@* %*10'6RO" *C,C>G ? "6>:> 6D!6FO$O$O,>6(((,?0>9O<G:? AL $*!:F2"%:NA G!:F(:T A":H*&7 F  :@:@:<> 4DC M5(; 1(*0X00d(B,B2N*B25-1^F(A4!8 9 :D*.:28 <= :666:8 +.>8RTKrr ceZdZfdZxZS)UnhashableComponentsTestscHGddtt| t}|S)Nc eZdZy)=UnhashableComponentsTests._getTargetClass..ComponentsNrGr&rrrr rKrr)rrrr)r rrs rrz)UnhashableComponentsTests._getTargetClass s# 8$OQSW r)r)rHrIrrrs@rrr s rrceZdZdZddZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy)UtilityRegistrationTestscddlm}|S)Nrrk)rrrl)r rls rrz(UtilityRegistrationTests._getTargetClass ?""rNcddlm}Gdd|}|d}Gdd}|}d}d } |j} | ||||| |||fS) Nrrhc eZdZy)AUtilityRegistrationTests._makeOne..InterfaceClassSubclassNrGr&rrInterfaceClassSubclassr rKrrrJceZdZdZy)4UtilityRegistrationTests._makeOne.._RegistrycyN _REGISTRYr&r s r__repr__z=UtilityRegistrationTests._makeOne.._Registry.__repr__ "rNr)rHrIrr&rr _Registryr  #rrr DOCSTRINGrSrDr) r r_r`rDrrUrrrdocklasss rrz!UtilityRegistrationTests._makeOne sj> ^ &f- # #;$$&hdIsGD rcJddlm}ddlm}|||j y)Nr verifyClassIUtilityRegistration)zope.interface.verifyrrqrr)r rrs r+test_class_conforms_to_IUtilityRegistrationzDUtilityRegistrationTests.test_class_conforms_to_IUtilityRegistration 5B($*>*>*@ArcVddlm}ddlm}|j \}}}|||y)Nr verifyObjectr)rrrqrr)r rrur_s r.test_instance_conforms_to_IUtilityRegistrationzGUtilityRegistrationTests.test_instance_conforms_to_IUtilityRegistration $6BMMOAq)2.rcGdd}|}|j|\}}}|jt|d|zy)NceZdZdZy):UtilityRegistrationTests.test___repr__.._ComponentTESTNrGr&rr _Componentr HrrzAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')r9r r _componentr _registryrws rr<z&UtilityRegistrationTests.test___repr__ sG  \ #}}Z8Iu b O$ & 'rcGdd}|}|j|\}}}t|_|jt |d|zy)NceZdZdZy)KUtilityRegistrationTests.test___repr___provided_wo_name.._ComponentcyNrr&r s rrzTUtilityRegistrationTests.test___repr___provided_wo_name.._Component.__repr__ rNrr&rrrr  rrAUtilityRegistration(_REGISTRY, None, %r, TEST, None, 'DOCSTRING')rrarvr(r:rs rtest___repr___provided_wo_namez7UtilityRegistrationTests.test___repr___provided_wo_name R   \ #}}Z8Iuh  b O$ & 'rcGdd}|}|j|\}}}t|_|jt |d|zy)NceZdZdZy)LUtilityRegistrationTests.test___repr___component_wo_name.._Componentcyrr&r s rrzUUtilityRegistrationTests.test___repr___component_wo_name.._Component.__repr__ rrNrr&rrrr rrrrrrs rtest___repr___component_wo_namez8UtilityRegistrationTests.test___repr___component_wo_name rrct}|j|\}}}|j|jt |yr rarr(__hash__idr rrrrws r test___hash__z&UtilityRegistrationTests.test___hash__ 8X #}}Z8Iu 2/rcjt}|j|\}}}|j||k(yr rarr+rs rtest___eq___identityz-UtilityRegistrationTests.test___eq___identity .X #}}Z8Iu b!rct}|j|\}}}|j|\}}}|j||k(yr rr rrrrwur2rs rtest___eq___hitz(UtilityRegistrationTests.test___eq___hit BX #}}Z8IuMM*- Q c "rct}t}|j|\}}}|j|\}}}|j||k(yr rarrr r _component2rrrwr rs rtest___eq___missz)UtilityRegistrationTests.test___eq___miss KX h #}}Z8IuMM+. Q s#rcjt}|j|\}}}|j||k7yr rrs rtest___ne___identityz-UtilityRegistrationTests.test___ne___identity 0X #}}Z8Iu r"rct}|j|\}}}|j|\}}}|j||k7yr rr s rtest___ne___hitz(UtilityRegistrationTests.test___ne___hit DX #}}Z8IuMM*- Q s#rct}t}|j|\}}}|j|\}}}|j||k7yr rrs rtest___ne___missz)UtilityRegistrationTests.test___ne___miss IX h #}}Z8IuMM+. Q c "rcjt}|j|\}}}|j||kyr rrs rtest___lt___identityz-UtilityRegistrationTests.test___lt___identity 0X #}}Z8Iu b!rct}|j|\}}}|j|\}}}|j||kyr rr s rtest___lt___hitz(UtilityRegistrationTests.test___lt___hit DX #}}Z8IuMM*- Q c"rct}t}|j|\}}}|j|\}}}|dz|_|j||kyN2rarrr+rs rtest___lt___missz)UtilityRegistrationTests.test___lt___miss TX h #}}Z8IuMM+. Q3; S!rcjt}|j|\}}}|j||kyr rrs rtest___le___identityz-UtilityRegistrationTests.test___le___identity r rct}|j|\}}}|j|\}}}|j||kyr rr s rtest___le___hitz(UtilityRegistrationTests.test___le___hit rrct}t}|j|\}}}|j|\}}}|dz|_|j||kyr&r(rs rtest___le___missz)UtilityRegistrationTests.test___le___miss TX h #}}Z8IuMM+. Q3; c "rcjt}|j|\}}}|j||kDyr rrs rtest___gt___identityz-UtilityRegistrationTests.test___gt___identity( r!rct}t}|j|\}}}|j|\}}}|dz|_|j||kDyr&r(rs rtest___gt___hitz(UtilityRegistrationTests.test___gt___hit- TX h #}}Z8IuMM+. Q3; b!rct}|j|\}}}|j|\}}}|j||kDyr rr s rtest___gt___missz)UtilityRegistrationTests.test___gt___miss5 DX #}}Z8IuMM*- Q r"rcjt}|j|\}}}|j||k\yr rrs rtest___ge___identityz-UtilityRegistrationTests.test___ge___identity; r rct}t}|j|\}}}|j|\}}}|dz|_|j||k\yr&rarrrrs rtest___ge___missz)UtilityRegistrationTests.test___ge___miss@ VX h #}}Z8IuMM+. Q3; s#rct}|j|\}}}|j|\}}}|dz|_|j||k\yr&r(r s rtest___ge___hitz(UtilityRegistrationTests.test___ge___hitH MX #}}Z8IuMM*- Q3; r "r)NN)r)rHrIrrrrr<rrrr rrrrrr r#r)r,r.r0r3r5r8r;r>rAr&rrrr s#&B / ' ' '0 " # $# $ #" # "" # #" "# " $#rrceZdZdZddZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy)AdapterRegistrationTestscddlm}|S)Nrra)rrrb)r rbs rrz(AdapterRegistrationTests._getTargetClassR rrNcddlm}Gdd|}|d}|d}Gdd}|}d}d } |j} | ||f|||| ||fS) Nrrhc eZdZy)/AdapterRegistrationTests._makeOne..IFooNrGr&rrrJrHY rKrrJrceZdZdZy)4AdapterRegistrationTests._makeOne.._Registrycyrr&r s rrz=AdapterRegistrationTests._makeOne.._Registry.__repr__^ rrNrr&rrrrJ] rrrrrr r r_rDrJrUr^rrrrrs rrz!AdapterRegistrationTests._makeOneV r> > F|F| # #;$$&htYD rcJddlm}ddlm}|||j y)NrrIAdapterRegistration)rrrqrPr)r rrPs r+test_class_conforms_to_IAdapterRegistrationzDAdapterRegistrationTests.test_class_conforms_to_IAdapterRegistrationi rrcVddlm}ddlm}|j \}}}|||y)NrrrO)rrrqrPr)r rrParrs r.test_instance_conforms_to_IAdapterRegistrationzGAdapterRegistrationTests.test_instance_conforms_to_IAdapterRegistrationn rrcGdd}|}|j|\}}}|jt|d|zy)NceZdZdZy):AdapterRegistrationTests.test___repr__.._ComponentrNrGr&rrrrWu rrrzCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')r9r rrrSrrws rr<z&AdapterRegistrationTests.test___repr__t sI  \ #}}Z8Iu b % ' (rcGdd}|}|j|\}}}t|_|jt |d|zy)NceZdZdZy)KAdapterRegistrationTests.test___repr___provided_wo_name.._Componentcyrr&r s rrzTAdapterRegistrationTests.test___repr___provided_wo_name.._Component.__repr__ rrNrr&rrrr[~ rrrCAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')rrXs rrz7AdapterRegistrationTests.test___repr___provided_wo_name} T   \ #}}Z8Iuh  b % ' (rcGdd}|}|j|\}}}t|_|jt |d|zy)NceZdZdZy)LAdapterRegistrationTests.test___repr___component_wo_name.._Componentcyrr&r s rrzUAdapterRegistrationTests.test___repr___component_wo_name.._Component.__repr__ rrNrr&rrrra rrrr]rrXs rrz8AdapterRegistrationTests.test___repr___component_wo_name r^rct}|j|\}}}|j|jt |yr rr rrSrrws rrz&AdapterRegistrationTests.test___hash__ rrcjt}|j|\}}}|j||k(yr rrds rr z-AdapterRegistrationTests.test___eq___identity r rct}|j|\}}}|j|\}}}|j||k(yr rr rrSrrwar2rs rrz(AdapterRegistrationTests.test___eq___hit rrct}t}|j|\}}}|j|\}}}|j||k(yr rr rrrSrrwrhrs rrz)AdapterRegistrationTests.test___eq___miss rrcjt}|j|\}}}|j||k7yr rrds rrz-AdapterRegistrationTests.test___ne___identity rrct}|j|\}}}|j|\}}}|j||k7yr rrgs rrz)AdapterRegistrationTests.test___ne___miss rrct}t}|j|\}}}|j|\}}}|j||k7yr rrjs rtest___ne___hit_componentz2AdapterRegistrationTests.test___ne___hit_component rrcddlm}Gdd|}|d}t}|j|\}}}|j|\}} } ||_|j ||k7y)Nrrhc eZdZy)?AdapterRegistrationTests.test___ne___hit_provided..IFooNrGr&rrrJrq rKrrJrE)rSrDrarrvr+) r rDrJrNrrSrrwrhrs rtest___ne___hit_providedz1AdapterRegistrationTests.test___ne___hit_provided sa> > F|X #}}Z8IuMM*- Q  c "rcddlm}Gdd|}|d}t}t}|j|\}}}|j|\} } } |f| _|j || k7y)Nrrhc eZdZy)?AdapterRegistrationTests.test___ne___hit_required..IFooNrGr&rrrJru rKrrJrE)rSrDrarrir+) r rDrJrNrrrSrrwrhrs rtest___ne___hit_requiredz1AdapterRegistrationTests.test___ne___hit_required sj> > F|X h #}}Z8IuMM+. Qw  c "rcjt}|j|\}}}|j||kyr rrds rr z-AdapterRegistrationTests.test___lt___identity r!rct}|j|\}}}|j|\}}}|j||kyr rrgs rr#z(AdapterRegistrationTests.test___lt___hit r$rct}t}|j|\}}}|j|\}}}|dz|_|j||kyr&r(rjs rr)z)AdapterRegistrationTests.test___lt___miss r*rcjt}|j|\}}}|j||kyr rrds rr,z-AdapterRegistrationTests.test___le___identity r rct}|j|\}}}|j|\}}}|j||kyr rrgs rr.z(AdapterRegistrationTests.test___le___hit rrct}t}|j|\}}}|j|\}}}|dz|_|j||kyr&r(rjs rr0z)AdapterRegistrationTests.test___le___miss r1rcjt}|j|\}}}|j||kDyr rrds rr3z-AdapterRegistrationTests.test___gt___identity r!rct}t}|j|\}}}|j|\}}}|dz|_|j||kDyr&r(rjs rr5z(AdapterRegistrationTests.test___gt___hit r6rct}|j|\}}}|j|\}}}|j||kDyr rrgs rr8z)AdapterRegistrationTests.test___gt___miss r9rcjt}|j|\}}}|j||k\yr rrds rr;z-AdapterRegistrationTests.test___ge___identity r rct}t}|j|\}}}|j|\}}}|dz|_|j||k\yr&r=rjs rr>z)AdapterRegistrationTests.test___ge___miss r?rct}|j|\}}}|j|\}}}|dz|_|j||k\yr&r(rgs rrAz(AdapterRegistrationTests.test___ge___hit rBrr )r)rHrIrrrQrTr<rrrr rrrrrnrrrvr r#r)r,r.r0r3r5r8r;r>rAr&rrrDrDP s#&B / ( ( (0 " # $# $ # # #" # "" # #" "# " $#rrDc&eZdZdZddZdZdZy)SubscriptionRegistrationTestscddlm}|S)Nrr)rrr)r rs rrz-SubscriptionRegistrationTests._getTargetClass# s D''rNcddlm}Gdd|}|d}|d}Gdd}|}d}d } |j} | ||f|||| ||fS) Nrrhc eZdZy)4SubscriptionRegistrationTests._makeOne..IFooNrGr&rrrJr* rKrrJrceZdZdZy)9SubscriptionRegistrationTests._makeOne.._Registrycyrr&r s rrzBSubscriptionRegistrationTests._makeOne.._Registry.__repr__/ rrNrr&rrrr. rrrrrrrLs rrz&SubscriptionRegistrationTests._makeOne' rMrcJddlm}ddlm}|||j y)Nrr ISubscriptionAdapterRegistration)rrrqrr)r rrs r7test_class_conforms_to_ISubscriptionAdapterRegistrationzUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistration: s5N4d6J6J6LMrcVddlm}ddlm}|j \}}}|||y)Nrrr)rrrqrr)r rrsarrs r:test_instance_conforms_to_ISubscriptionAdapterRegistrationzXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistration? s$6N]]_ Q5s;rr )r)rHrIrrrrr&rrrr! s(&N .IFooNrGr&rrrJrO rKrrJceZdZdZy)4HandlerRegistrationTests._makeOne.._Registrycyrr&r s rrz=HandlerRegistrationTests._makeOne.._Registry.__repr__S rrNrr&rrrrR rrrrrr) r r_rDrJrUrrrrrs rrz!HandlerRegistrationTests._makeOneL sg> > F| # #;$$&hy#> rcJddlm}ddlm}|||j y)NrrIHandlerRegistration)rrrqrr)r rrs r+test_class_conforms_to_IHandlerRegistrationzDHandlerRegistrationTests.test_class_conforms_to_IHandlerRegistration^ rrcVddlm}ddlm}|j \}}}|||y)Nrrr)rrrqrr)r rrhrrs r.test_instance_conforms_to_IHandlerRegistrationzGHandlerRegistrationTests.test_instance_conforms_to_IHandlerRegistrationc rrcd}|j|\}}}|j|j|u|j|j|ju|j|jduy)Nctr rZrfs rr\z:HandlerRegistrationTests.test_properties.._factoryj r]r)rr+handlerr`rv)r r\rrs rtest_propertiesz(HandlerRegistrationTests.test_propertiesi s^ (MM(+Aq  h./  bjj01  t+,rcGdd}|j|\}}}|jt|d|zy)NceZdZdZy)GHandlerRegistrationTests.test___repr___factory_w_name.._FactoryrNrGr&rrrprr rrrp=HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')r9r rprrrws rtest___repr___factory_w_namez5HandlerRegistrationTests.test___repr___factory_w_nameq sD   $ hj 9Iu b % ' (rcGdd}|j|\}}}|jt|d|zy)NceZdZdZy)HHandlerRegistrationTests.test___repr___factory_wo_name.._Factorycyrr&r s rrzQHandlerRegistrationTests.test___repr___factory_wo_name.._Factory.__repr__{ rrNrr&rrrprz rrrprr9rs rtest___repr___factory_wo_namez6HandlerRegistrationTests.test___repr___factory_wo_namey sF  !% hj 9Iu b % ' (rr ) r)rHrIrrrrrrrr&rrrrF s&#$B / -((rrceZdZdZdZy)PersistentAdapterRegistryc|jj}t|D]3}||jvs|j ds#|j |5|j dd|S)N_vro)__dict__copyr _delegated startswithpop)r stateks r __getstate__z&PersistentAdapterRegistry.__getstate__ s^ ""$e ADOO#q||D'9 !    $ rc|jdd}|jj||j||_|j j |y)Nr*r&)rrupdate _createLookupr*rr)r rbasess r __setstate__z&PersistentAdapterRegistry.__setstate__ sI +r* U#  t$rN)r)rHrIrrr&rrrr s %rrceZdZdZy)PersistentComponentsc@t|_t|_yr )rr-r.r s r_init_registriesz%PersistentComponents._init_registries s13 24rN)r)rHrIrr&rrrr s5rrc eZdZy)PersistentDictComponentsNrGr&rrrr srrceZdZdZy)PersistentComponentsDictcZtj|tj||yr )rrr)r rs rrz!PersistentComponentsDict.__init__ s d%%dD1rNrr&rrrr s2rrc$eZdZdZdZdZdZy)TestPersistentComponentsctdS)Nr)rr s rrz!TestPersistentComponents._makeOne s #F++rcyr r&r mades r_check_equality_after_picklez5TestPersistentComponents._check_equality_after_pickle s rcddl}|j}|j||j|j|}|j |j dyNrr)picklerdumpsloadsr(r))r rr3comp2s rtest_pickles_emptyz+TestPersistentComponents.test_pickles_empty sG}} T V\\$/0 0rcddl}|j}t}|j|t|j ||j t|j|j|}|j|jd|j|j t|j|t|j ||j t|j|yr) rrrarTrr r?rrr(r)assertIsNotNoner)r rr3utilityrs r&test_pickles_with_utility_registrationz?TestPersistentComponents.test_pickles_with_utility_registration s}}(     gooi0 2 V\\$/0 0 U--i89     g&&y1 3 ))%0rN)r)rHrIrrrrr&rrrr s, 11rrceZdZdZdZdZy)TestPersistentDictComponentsctSr )rr s rrz,TestPersistentDictComponents._getTargetClass ''rc>|jd}d|d<|S)Nrr*r$rr;s rrz%TestPersistentDictComponents._makeOne s%%t##%62U  rcR|jd||j|ddy)Nr$r)rr(rs rrz9TestPersistentDictComponents._check_equality_after_pickle s$ eT" eb)rN)r)rHrIrrrr&rrrr s( *rrceZdZdZy)TestPersistentComponentsDictctSr )rr s rrz,TestPersistentComponentsDict._getTargetClass rrN)r)rHrIrr&rrrr s(rrceZdZdZdZdZy)r c ||_|Dcic]}|t||c}|_|jD]\}}t |||ycc}wr )modulegetattr to_restoreitemssetattr)r rrr$values rrz_Monkey.__init__ sR @BC3 44C((* (JC FC ' (DsAc|Sr r&r s r __enter__z_Monkey.__enter__ s rcv|jjD]\}}t|j||yr )rrrr)r exc_typeexc_valexc_tbr$rs r__exit__z_Monkey.__exit__ s2////1 -JC DKKe , -rN)r)rHrIrrrr&rrr r s( -rr )runittestrrr'rrrrTestCaser rrrDrrrrrrrrrrr r&rrrs$;.o%Kh''o%KdKw#x00w#tN#x00N#b"