eIedZddlZddlmZddlmZddlmZeZGddejZ Gdd ejZ Gd d ejZ Gd d ejZ Gdde eZ Gdde ZGddeZGddeZGddeeejZGddeejZGddejZGddejZGddejZGd d!e ZGd"d#eZGd$d%ejZGd&d'ejZGd(d)Zd*Zd+ZGd,d-Zy).zTest Interface implementation N)MissingSomeAttrs)OptimizationTestMixin)CleanUpceZdZdZdZy)Test_invariantcddlmddlm}dGfdd}|jt ||ddgiy)Nr invariant TAGGED_DATActNNotImplementedErrorargskws E/usr/lib/python3/dist-packages/zope/interface/tests/test_interface.py_checkz,Test_invariant.test_w_single.._check' %' 'c"eZdZWWy))Test_invariant.test_w_single..FooN__name__ __module__ __qualname__)rr srFoor*s f rr invariantszope.interface.interfacer r assertEqualgetattr)selfr rrr s @@r test_w_singlezTest_invariant.test_w_single#s=68 (   k48&1 3rcddlmddlm}ddGfdd}|jt ||ddgiy) Nrr r ctrrrs rrz.Test_invariant.test_w_multiple.._check4rrctrrrs r_another_checkz6Test_invariant.test_w_multiple.._another_check7rrc6eZdZWWWWy)+Test_invariant.test_w_multiple..FooNr)r)rr srrr+:s f  n %rrrr )r$r rr)rr s @@@rtest_w_multiplezTest_invariant.test_w_multiple0sF68 ( ( & & k48&(@A CrN)rrrr%r,rrrr!s  3CrrceZdZdZdZdZy)Test_taggedValuecvddlmddlm}Gfdd}|jt ||dddgiy)Nr taggedValuer c$eZdZWddgy)+Test_taggedValue.test_w_single..FoobarbazNrr1srrr4Hs w 'rrr5r6r!r2r r"r#r$r rr2s @rr%zTest_taggedValue.test_w_singleDs888 ( ( k48%) +rcxddlmddlm}Gfdd}|jt ||ddgddy) Nrr1r c8eZdZWddgWddy)-Test_taggedValue.test_w_multiple..Foor5r6quxspamNrr1srrr;Rs w ' v &rrr6r=r5r<r7r8s @rr,z Test_taggedValue.test_w_multipleNs888 ' ' k48"'8 :rcvddlmddlm}Gfdd}|jt ||ddddy) Nrr1r cLeZdZWddgWddWddy)9Test_taggedValue.test_w_multiple_overwriting..Foor5r6r<r=frobNrr1srrrA]s# w ' v & v &rrrBr=r>r7r8s @rtest_w_multiple_overwritingz,Test_taggedValue.test_w_multiple_overwritingYs688 ' ' k48!'7 9rN)rrrr%r,rCr-rrr/r/Bs+ : 9rr/c`eZdZdZdZddZdZdZdZdZ d Z d Z d Z d Z d ZdZdZy) ElementTests AnElementcddlm}|S)Nr)Element)r!rH)r$rHs r_getTargetClasszElementTests._getTargetClassjs 4rNcJ| |j}|j|Sr) DEFAULT_NAMErI)r$names r_makeOnezElementTests._makeOnens( <$$D%t##%d++rc|j}|j|j|j|j|j |j|j|j d|j|j d|jt|jgy)N) rMr"rrKgetName__doc__getDoclistgetTaggedValueTagsr$elements rtest_ctor_defaultszElementTests.test_ctor_defaultsss--/ ))4+<+<= *D,=,=> "- )2. g88:;R@rc|jd}|j|jd|j|jdy)Nz An Element)rMr"rrQrUs rtest_ctor_no_doc_space_in_namez+ElementTests.test_ctor_no_doc_space_in_name{s:-- - ))40 ,7rcf|j}|jt|jdyNnonesuch)rM assertRaisesKeyErrorgetTaggedValuerUs rtest_getTaggedValue_missz%ElementTests.test_getTaggedValue_misss%--/ (G$:$:JGrc|j}|jgt|j|j dd|jdgt|jyNfoor5)rMr"rSgetDirectTaggedValueTagssetTaggedValuerUs rtest_getDirectTaggedValueTagsz*ElementTests.test_getDirectTaggedValueTagss[--/ T'"B"B"DEFue, %$w'G'G'I"JKrcf|j}|j|jddyr[rMr"queryTaggedValuerUs rtest_queryTaggedValue_missz'ElementTests.test_queryTaggedValue_misss(--/ 11*=tDrch|j}|j|jdddyNr\r5rhrUs r$test_queryTaggedValue_miss_w_defaultz1ElementTests.test_queryTaggedValue_miss_w_defaults*--/ 11*eDeLrcf|j}|jt|jdyr[)rMr]r^getDirectTaggedValuerUs rtest_getDirectTaggedValue_missz+ElementTests.test_getDirectTaggedValue_misss%--/ (G$@$@*Mrcf|j}|j|jddyr[rMr"queryDirectTaggedValuerUs r test_queryDirectTaggedValue_missz-ElementTests.test_queryDirectTaggedValue_misss(--/ 77 CTJrch|j}|j|jdddyrlrrrUs r*test_queryDirectTaggedValue_miss_w_defaultz7ElementTests.test_queryDirectTaggedValue_miss_w_defaults*--/ 77 EJERrc |j}|jdd|jt|j dg|j|j dd|j|j ddyrb)rMrer"rSrTr_rirUs rtest_setTaggedValuez ElementTests.test_setTaggedValuess--/ue, g88:;eWE //6> 11%8%@rcNddlm}ddlm}|j }|||y)Nr)IElement verifyObject)zope.interface.interfacesrzzope.interface.verifyr|rM)r$rzr|rVs r test_verifieszElementTests.test_verifiess66--/Xw'rr)rrrrKrIrMrWrYr`rfrjrmrprtrvrxrr-rrrErEfsQL, A8 HLEMNKSA(rrEc(eZdZdZeZdZdZdZy)GenericSpecificationBaseTestscddlm}|S)Nr)SpecificationBasePy)r!r)r$rs r_getFallbackClassz/GenericSpecificationBaseTests._getFallbackClasss @""rc,|jSrrIr$s rrMz&GenericSpecificationBaseTests._makeOnes%t##%''rcddlm}ddlm|j }fd}t ||5|j |jtdddy#1swYyxYw)Nr interface_emptycSrr-objrs r _providedByzGGenericSpecificationBaseTests.test_providedBy_miss.._providedByMr providedBy) zope.interfacerzope.interface.declarationsrrM_Monkey assertFalserobject)r$rsbrrs @rtest_providedBy_missz2GenericSpecificationBaseTests.test_providedBy_misssQ,6 ]]_  Y; 7 6   R]]684 5 6 6 6 )A""A+cddlm}ddlm|j }fd}t ||5|j |jtdddy#1swYyxYw)NrrrcSrr-rs r_implementedByzMGenericSpecificationBaseTests.test_implementedBy_miss.._implementedByrr implementedBy) rrrrrMrrrr)r$rrrrs @rtest_implementedBy_missz5GenericSpecificationBaseTests.test_implementedBy_misssS,6 ]]_  Yn = 9   R--fh7 8 9 9 9rN)rrrrrIrMrrr-rrrrs#(O(69rrceZdZdZy)SpecificationBaseTestscddlm}|S)Nr)SpecificationBase)r!r)r$rs rrIz&SpecificationBaseTests._getTargetClasss >  rNrrrrIr-rrrrs!rrc0eZdZdZdZdZdZdZdZy)SpecificationBasePyTestsc|j}i|_|j|jt yrrM_impliedr isOrExtendsrr$rs rtest___call___missz+SpecificationBasePyTests.test___call___miss- ]]_  12rcx|j}t}|ii|_|j||yrrMrr assertTruer$rtestings rtest___call___hitz*SpecificationBasePyTests.test___call___hit/ ]]_(m  7 $rc|j}i|_|j|jt yrrrs rtest_isOrExtends_missz.SpecificationBasePyTests.test_isOrExtends_missrrcx|j}t}|ii|_|j||yrrrs rtest_isOrExtends_hitz-SpecificationBasePyTests.test_isOrExtends_hitrrcddlm}|jGfddfd}t||5|j j t dddy#1swYyxYw)NrrceZdZWiiZy)>SpecificationBasePyTests.test_implementedBy_hit.._DeclNrrrrrsr_Declr ByHrrcSrr-rrs rrzGSpecificationBasePyTests.test_implementedBy_hit.._implementedBy 7Nrr)rrrMrrrr)r$rrrrs @@rtest_implementedBy_hitz/SpecificationBasePyTests.test_implementedBy_hitsX, ]]_ ! !  Yn = 8 OOB,,VX6 7 8 8 8 )A))A2cddlm}|jGfddfd}t||5|j j t dddy#1swYyxYw)NrrceZdZWiiZy);SpecificationBasePyTests.test_providedBy_hit.._DeclNrrsrrrrrrcSrr-rs rrzASpecificationBasePyTests.test_providedBy_hit.._providedByrrr)rrrMrrrr)r$rrrrs @@rtest_providedBy_hitz,SpecificationBasePyTests.test_providedBy_hitsV, ]]_ ! !  Y; 7 5 OOBMM&(3 4 5 5 5rN) rrrrrrrrrr-rrrrs 3 % 3 % 85rrc0eZdZdZdZdZdZdZdZy)!NameAndModuleComparisonTestsMixinc&|jddS)Nab)rMrs r_makeOneToComparez3NameAndModuleComparisonTestsMixin._makeOneToCompares}}S#&&rc ddl}|j}t||}t|d|z}G fdd Gdd }Gdd }|j|jd |j|j d |j t5t|d ddd|j t5t|d ddd||fD]#}|j||t%Gd d } |j||| |j|| tGdd} |j|| t|j t5||| dddGddt} | _ |j | 5t|d ddd|j | 5t|d ddd||fD]Q}|j | 5|||ddd|j | 5||dddSy#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYqxYw#1swYxYw)Nrz__%s__ceZdZeZfdZy)aNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnMissingct tj||S#t$rj}||wxYwr)r__getattribute__AttributeErrorExc)r$rLexcRaisesErrorOnMissings rrzrNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnMissing.__getattribute__s>$!224>>%$.22Cd)O$s7N)rrrrrr)rsrrrs  C $rrc"eZdZdZedZy)`NameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnModulecd|_yNrc)rrs r__init__ziNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnModule.__init__s % rctr)rrs rrzkNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnModule.__module__s$$rN)rrrrpropertyr-rrRaisesErrorOnModulers &  % %rrceZdZdZy)^NameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnNamecd|_yrrrs rrzgNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..RaisesErrorOnName.__init__$s "'rNrrrrr-rrRaisesErrorOnNamer#s (rrrcrrc&eZdZdZeZeZeZeZeZy)`NameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..AllowsAnyComparisoncyNTr-)r$others r__eq__zgNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..AllowsAnyComparison.__eq__5rN rrrr__lt____le____gt____ge____ne__r-rrAllowsAnyComparisonr4s  FFFFFrrc$eZdZdZeZeZeZeZeZy)_NameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..AllowsNoComparisonNrr-rrAllowsNoComparisonrAs FFFFFFrrc eZdZy)XNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparison..MyExceptionNrr-rr MyExceptionrN rr)operatorrr#r"rrr]rassertIsNotImplementedr TypeError Exceptionr) r$rLribopmethrrclsrrrrs @r!__check_NotImplemented_comparisonzCNameAndModuleComparisonTestsMixin.__check_NotImplemented_comparisons   # # % Xt $r8d?+  $ $ %"6 % ( 4 ( ,.77? *,77?   ~ . 9 ')< 8 9   ~ . 5 %' 4 5'(99 7C MM$su+~ 6 7  "6  22456 d.01>B   d-/0.A   y ) ) r%' ( ) ) $/   { + 9 ')< 8 9   { + 5 %' 4 5'(99 C"";/ 2su  "";/ SU    _ 9 9 5 5> ) ) 9 9 5 5    sT*JJ&J$J(J4K)K J JJ%(J14J=K K c&|jdy)NltC_NameAndModuleComparisonTestsMixin__check_NotImplemented_comparisonrs rtest__lt__NotImplementedz:NameAndModuleComparisonTestsMixin.test__lt__NotImplemented^ ..t4rc&|jdy)Nler rs rtest__le__NotImplementedz:NameAndModuleComparisonTestsMixin.test__le__NotImplementedar rc&|jdy)Ngtr rs rtest__gt__NotImplementedz:NameAndModuleComparisonTestsMixin.test__gt__NotImplementeddr rc&|jdy)Nger rs rtest__ge__NotImplementedz:NameAndModuleComparisonTestsMixin.test__ge__NotImplementedgr rN) rrrrr r rrrr-rrrrs"'Un5555rrc8eZdZdZdZd dZdZdZdZdZ y) InterfaceBaseTestsMixinctrrrs rrIz'InterfaceBaseTestsMixin._getTargetClassns!!rcddlm}|S)Nr)InterfaceBasePy)r!r)r$rs rrz)InterfaceBaseTestsMixin._getFallbackClassqs <rNcLGfdd|j}|||S)NceZdZdZfdZy),InterfaceBaseTestsMixin._makeOne..IBc||Srr-)r$conforms r _call_conformz:InterfaceBaseTestsMixin._makeOne..IB._call_conformxs t}$rcSrr-)r$robject_should_provides rrz7InterfaceBaseTestsMixin._makeOne..IB.providedByzs ,,rN)rrrr!r)r#srIBrws  % -rr$r)r$r#rLmoduler$s ` rrMz InterfaceBaseTestsMixin._makeOnevs' -%%' - $rc|jd}tGfdd}|j||y)NFceZdZfdZy)UInterfaceBaseTestsMixin.test___call___w___conform___returning_value.._AdaptedcSrr-)r$iface conformeds r __conform__zaInterfaceBaseTestsMixin.test___call___w___conform___returning_value.._Adapted.__conform__s   rNrrrr,)r+sr_Adaptedr(s !rr.)rMrr)r$rr.r+s @r+test___call___w___conform___returning_valuezCInterfaceBaseTestsMixin.test___call___w___conform___returning_value~s8 ]]5 !H  ! ! bni0rc|jd}||jf}t}t}|j||||y)NF)rMrIrr)r$r__traceback_info__adapted alternates r7test___call___wo___conform___ob_no_provides_w_alternatezOInterfaceBaseTestsMixin.test___call___wo___conform___ob_no_provides_w_alternatesG ]]5 !!5!5!77(H  b),i8rc|jd}|jt5}|tddd|j dt j y#1swY/xYw)NFzCould not adapt)rMr]rrassertInstr exception)r$rrs r7test___call___w___conform___ob_no_provides_wo_alternatezOInterfaceBaseTestsMixin.test___call___w___conform___ob_no_provides_wo_alternatesX ]]5 !   y ) S vxL  'S]]);<  s A&&A/cPtj||jdy)Nr,)expected_missing)r test_raisesrMrs r6test___call___w_no_conform_catches_only_AttributeErrorzNInterfaceBaseTestsMixin.test___call___w_no_conform_catches_only_AttributeErrors$$T4==?][r)FNN) rrrrIrrMr/r4r9r=r-rrrrks&"  19=\rrceZdZdZy)InterfaceBaseTestscddlm}|S)Nr) InterfaceBase)r!rA)r$rAs rrIz"InterfaceBaseTests._getTargetClass :rNrr-rrr?r?srr?c6eZdZejZdZdZdZy)InterfaceBasePyTestscx|jd}Gdd}|}|j|||y)NTceZdZdZy)SInterfaceBasePyTests.test___call___w___conform___miss_ob_provides.._Adaptedcyrr-r$r*s rr,z_InterfaceBasePyTests.test___call___w___conform___miss_ob_provides.._Adapted.__conform__rrNr-r-rrr.rG rr.)rMr)r$rr.r2s r,test___call___w___conform___miss_ob_provideszAInterfaceBasePyTests.test___call___w___conform___miss_ob_providess5 ]]4   * bk7+rc||jd}t}|j|j||yr)rMrr __adapt__)r$rr2s rtest___adapt___ob_providesz/InterfaceBasePyTests.test___adapt___ob_providess. ]]4 ( bll7+W5rcddlm}|jd}t}gfd}d}t |||g5|j |j |||j||fgdddy#1swYyxYw)NrrFc,j||fyrappend)r*r_misseds r _hook_misszQInterfaceBasePyTests.test___adapt___ob_no_provides_uses_hooks.._hook_misss NNE3< (rc|Srr-r*rs r _hook_hitzPInterfaceBasePyTests.test___adapt___ob_no_provides_uses_hooks.._hook_hitsJr adapter_hooks)rrrMrrrrMr")r$rrr2rTrWrSs @r(test___adapt___ob_no_provides_uses_hooksz=InterfaceBasePyTests.test___adapt___ob_no_provides_uses_hookss{, ]]5 !( )  Yz9.E F 7 MM",,w/ 9   WG}o 6 7 7 7s 7A<<BN) rrrrrrIrKrNrZr-rrrDrDs.??O,6 7rrDcpeZdZdZefdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZdZy)SpecificationTestscddlm}|S)Nr) Specification)r!r^)r$r^s rrIz"SpecificationTests._getTargetClassrBrch|tur|jS|j|Sr)_markerrI)r$basess rrMzSpecificationTests._makeOnes4 G )4'')+ +%t##%e,,rcpddlm}|j}|j|jd|jt |j d|j||j v|j||j v|jt |jdy)Nr Interfacer-) r!rdrMr" __bases__lenrr dependents)r$rdspecs r test_ctorzSpecificationTests.test_ctors6}} , T]]+Q/  -.  T]]23 T__-q1rc|j}t}|j||jt |j d|j|j |dyN)rMDummyDependent subscriber"rgrhr$rideps rtest_subscribe_first_timez,SpecificationTests.test_subscribe_first_timesS}} s T__-q1 -q1rc|j}t}|j||j||j|j|dy)Nre)rMrnror"rhrps rtest_subscribe_againz'SpecificationTests.test_subscribe_againsF}} s s -q1rcz|j}t}|jt|j|yr)rMrnr]r^ unsubscriberps rtest_unsubscribe_missz(SpecificationTests.test_unsubscribe_misss-}} (D$4$4c:rc8|j}t}|j||j||j||j |j |d|j||j ||j vyrl)rMrnrorvr"rhrrps rtest_unsubscribez#SpecificationTests.test_unsubscribesy}} s s  -q1  /0rcddlm}|j}t}|j |Gdd|}Gdd|}|f|_|j |j|g|j |j|d|f|_|j |jj|d|j |j|dy)Nrrcc eZdZy)VSpecificationTests.test___setBases_subscribes_bases_and_notifies_dependents..INrr-rrIr|rrr}c eZdZy)VSpecificationTests.test___setBases_subscribes_bases_and_notifies_dependents..JNrr-rrJrrrrrm) r!rdrMrnrorfr"_changedrhget)r$rdrirqr}rs r8test___setBases_subscribes_bases_and_notifies_dependentszKSpecificationTests.test___setBases_subscribes_bases_and_notifies_dependentss6}} s       v. d+Q/ ))$/6 d+Q/rcddlm}Gdd|}|j}d|_d|j|<|j ||j |j|j||jvy)Nrrcc eZdZy)GSpecificationTests.test_changed_clears_volatiles_and_implied..INrr-rrr}rrrr}rr-)r!rdrM_v_attrsrchanged assertIsNoner)r$rdr}ris r)test_changed_clears_volatiles_and_impliedz.IFooNrr-rrIFoorrrr)r!rdrMr"rS interfacesr$rdrris r"test_interfaces_skips_already_seenz5SpecificationTests.test_interfaces_skips_already_seen sA6 9 }}dD\* doo/04&9rcddlm}Gdd|}|j|}|j|j |dy)Nrrcc eZdZy).IFooNrr-rrrrrrrTstrict)r!rdrMrextendsrs rtest_extends_strict_wo_selfz.SpecificationTests.test_extends_strict_wo_selfs:6 9 }}T" d489rch|j}|j|j|dy)NTr)rMrrr$ris rtest_extends_strict_w_selfz-SpecificationTests.test_extends_strict_w_selfs(}} d489rch|j}|j|j|dy)NFr)rMrrrs rtest_extends_non_strict_w_selfz1SpecificationTests.test_extends_non_strict_w_selfs&}}  T% 89rc|j}t}d|i|_|j|j d|uyr)rMrrrr)r$rircs rtest_get_hit_w__v_attrsz*SpecificationTests.test_get_hit_w__v_attrs"s8}}h   3./rc<ddlmddlm}Gfdd|}Gfdd|}|j||g}|j |j d|j du|j |j d |j d uy) Nr Attributercc eZdZWdZy)CSpecificationTests.test_get_hit_from_base_wo__v_attrs..IFoorcN)rrrrcrsrrr+ E"Crrc eZdZWdZy)CSpecificationTests.test_get_hit_from_base_wo__v_attrs..IBarr5Nrrrr5rsrIBarr-rrrrcr5)r!rrdrMrr)r$rdrrrirs @r"test_get_hit_from_base_wo__v_attrsz5SpecificationTests.test_get_hit_from_base_wo__v_attrs(su66 #9 # #9 #}}dD\* 488E?:; 488E?:;rc Hddlm}ddlm}ddlm}Gdd|}Gdd}Gd d |}Gd d |}||Gd d}Gdd||} |j || j || ||||||t|fy)Nrrc implementerrc eZdZy)TSpecificationTests.test_multiple_inheritance_no_interfaces..IDefaultViewNameNrr-rrIDefaultViewNamer=rrrc eZdZy)KSpecificationTests.test_multiple_inheritance_no_interfaces..ContextNrr-rrContextr@rrrc eZdZy)LSpecificationTests.test_multiple_inheritance_no_interfaces..RDBModelNrr-rrRDBModelrCrrrc eZdZy)JSpecificationTests.test_multiple_inheritance_no_interfaces..IOtherNrr-rrIOtherrFrrrc eZdZy)MSpecificationTests.test_multiple_inheritance_no_interfaces..OtherBaseNrr-rr OtherBaserI rrc eZdZy)ISpecificationTests.test_multiple_inheritance_no_interfaces..ModelNrr-rrModelrMrrr)r!rdrrrr"__sro__r) r$rdrrrrrrrrs r'test_multiple_inheritance_no_interfacesz:SpecificationTests.test_multiple_inheritance_no_interfaces3s 7;= y    w  Y  V      Iw   % ( (e$i(g&f%   rN)rrrrIr`rMrjrrrtrwryrrrrrrrrrr-rrr\r\sW%- 222; 10 -::::0 <' rr\c8eZdZdZ d3dZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ 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/Z0d0Z1d1Z2d2Z3y)4InterfaceClassTestscddlm}|S)NrInterfaceClass)r!r)r$rs rrIz#InterfaceClassTests._getTargetClass_s ;rNc6|j|||||Srr)r$rLraattrsrQrs rrMzInterfaceClassTests._makeOnecs %t##%dE5':NNrc|j}|d}|j|jd|j|jd|j|jd|j|j dy)NITestingrOr-)rIr"rrQrfgetBases)r$klassinsts rrWz&InterfaceClassTests.test_ctor_defaultsgsl$$&Z   3 r* , "-rcf|j}|jt|dtfy)Nr)rIr]rr)r$rs rtest_ctor_bad_basesz'InterfaceClassTests.test_ctor_bad_basesos($$& )UJ Drc~ddlm}ddlm}d}|dd||d}|j}|d| }|j |j d|j |j d|j |jd |j |j|jy) Nrr fromFunctioncy DOCSTRINGNr-r-rr_barzBInterfaceClassTests.test_ctor_w_attrs_attrib_methods.._barvrrrOrcr5rrr-) r!rrrIr"rrQrfnameskeys)r$rrrATTRSrrs r test_ctor_w_attrs_attrib_methodsz4InterfaceClassTests.test_ctor_w_attrs_attrib_methodsss69 !%,$T*$$&Zu-  3 r* , uzz|4rc:dii}|j}|d|}|j|jd|j|jd|j|jd|jt |j gy)N __locals__rrrOr-rIr"rrQrfrSrr$rrrs rtest_ctor_attrs_w___locals__z0InterfaceClassTests.test_ctor_attrs_w___locals__s}r"$$&Zu-  3 r* , djjl+R0rc:dii}|j}|d|}|j|jd|j|jd|j|jd|jt |j gy)N__annotations__rrrOr-rrs r!test_ctor_attrs_w___annotations__z5InterfaceClassTests.test_ctor_attrs_w___annotations__s}"B'$$&Zu-  3 r* , djjl+R0rcFddlm}d|i}|j}|d|}|j|jd|j|j d|j|j d|jt|jgy)Nr)_decorator_non_returndropmerrrOr-) r!rrIr"rrQrfrSr)r$rrrrs r'test_ctor_attrs_w__decorator_non_returnz;InterfaceClassTests.test_ctor_attrs_w__decorator_non_returnsB01$$&Zu-  3 r* , djjl+R0rcrddlm}dti}|j}|j ||d|y)Nr)InvalidInterfaceinvalidrr)zope.interface.exceptionsrrrIr])r$rrrs r#test_ctor_attrs_w_invalid_attr_typez7InterfaceClassTests.test_ctor_attrs_w_invalid_attr_types7>FH%$$& *E:UKrczddi}|j}|d|d}|j|jdy)NrQATTRrEXPLICIT)rrQ)rIr"rQrs rtest_ctor_w_explicit___doc__z0InterfaceClassTests.test_ctor_w_explicit___doc__s<F#$$&ZujA z2rcx|j}|jt|j|gyr)rMr"rSrrIs rtest_interfacesz#InterfaceClassTests.test_interfacess-  e..01E7;rc|j}|jd|f}|j|j|fyNISub)ra)rMr"rr$r*subs r test_getBasesz!InterfaceClassTests.test_getBasess9 mmF5(m3 %2rcd|j}|j|j|yr)rMrisEqualOrExtendedByrIs r!test_isEqualOrExtendedBy_identityz5InterfaceClassTests.test_isEqualOrExtendedBy_identitys$  11%89rc|j}|jd|f}|j|j||j|j|yr)rMrrrrs r!test_isEqualOrExtendedBy_subifacez5InterfaceClassTests.test_isEqualOrExtendedBy_subifacesQ mmF5(m3 11#67 0078rc|jd}|jd}|j|j||j|j|y)NOneAnother)rMrr)r$oneanothers r"test_isEqualOrExtendedBy_unrelatedz6InterfaceClassTests.test_isEqualOrExtendedBy_unrelatedsPmmE"-- * 009: 44S9:rcddlm}ddlm}d}|dd||d}d|d di}|jd | }|jd |f| }|j t |j ddgy)Nrrrcyrr-r-rrrzFInterfaceClassTests.test_names_w_all_False_ignores_bases.._barrrrrOrr6BazIBaserIDerivedrarFallr!rrrMr"sortedrr$rrr BASE_ATTRS DERIVED_ATTRSbasederiveds r$test_names_w_all_False_ignores_basesz8InterfaceClassTests.test_names_w_all_False_ignores_basess69 &ub1)$/  % 4 }}WJ}7-- 4'-O  % 89E7Crcddlm}ddlm}d}|dd||d}|j|}|j t |j d d d gy) Nrrrcyrr-r-rrrz@InterfaceClassTests.test_names_w_all_True_no_bases.._barrrrrOrrTr r5rcrr$rrrrrs rtest_names_w_all_True_no_basesz2InterfaceClassTests.test_names_w_all_True_no_basess\69 !%,$T*mm%m(  d 34uenErcddlm}ddlm}d}|dd||d}d|d di}|jd | }|jd |f| }|j t |j dgdy)Nrrrcyrr-r-rrrzFInterfaceClassTests.test_names_w_all_True_w_bases_simple.._barrrrrOrr6r r rr r Tr r5r6rcrrs r$test_names_w_all_True_w_bases_simplez8InterfaceClassTests.test_names_w_all_True_w_bases_simples69 &ub1)$/  % 4 }}WJ}7-- 4'-O  $ 78:OPrcddlm}ddlm}d}d}|dd||d}|||d dd }|jd | }|jd |f|}|j t |j dgdy)Nrrrcyrr-r-rrrzJInterfaceClassTests.test_names_w_all_True_bases_w_same_names.._barrrcyrr-r-rr_foozJInterfaceClassTests.test_names_w_all_True_bases_w_same_names.._foorrrrOrr rcr6r rr r Tr rr r$rrrr"rrrrs r(test_names_w_all_True_bases_w_same_namesz._barrrcyrr-r-rrr"z/InterfaceClassTests.test___iter__.._foorrrrOrr r#r rr r r)r!rrrMr"rr$s r test___iter__z!InterfaceClassTests.test___iter__s69  &ub1)$/ !-T 2 )% 4 }}WJ}7-- 4'-O *?@rcddlm}ddlm}d}|dd||d}d|d di}|jd | }|jd |f| }|j t |j dd|dfgy)Nrrrcyrr-r-rrrzUInterfaceClassTests.test_namesAndDescriptions_w_all_False_ignores_bases.._barrrrrOrr6r r rr r Fr r!rrrMr"rnamesAndDescriptionsrs r3test_namesAndDescriptions_w_all_False_ignores_baseszGInterfaceClassTests.test_namesAndDescriptions_w_all_False_ignores_bases s69 &ub1)$/  % 4 }}WJ}7-- 4'-O  < < < GH -"67 rcddlm}ddlm}d}|dd||d}|j|}|j t |j d d |d fd |d fgy) Nrrrcyrr-r-rrrzOInterfaceClassTests.test_namesAndDescriptions_w_all_True_no_bases.._barrrrrOrrFr r5rcr,rs r-test_namesAndDescriptions_w_all_True_no_baseszAInterfaceClassTests.test_namesAndDescriptions_w_all_True_no_basessx69 !%,$T*mm%m(  8 8U 8 CD %,/ %,/ rc&ddlm}ddlm}d}|dd||d}d|d di}|jd | }|jd |f| }|j t |j dd|dfd|dfd|dfgy)Nrrrcyrr-r-rrrzMInterfaceClassTests.test_namesAndDescriptions_w_all_True_simple.._bar-rrrrOrr6r r rr r Tr r5rcr,rs r+test_namesAndDescriptions_w_all_True_simplez?InterfaceClassTests.test_namesAndDescriptions_w_all_True_simple*s69 &ub1)$/  % 4 }}WJ}7-- 4'-O  < < < FG *U"34 -"67 *U"34 rc:ddlm}ddlm}d}d}|dd||d}|||d dd }|jd | }|jd |f|}|j t |j dd|dfd|dfd|dfgy)Nrrrcyrr-r-rrrzYInterfaceClassTests.test_namesAndDescriptions_w_all_True_bases_w_same_names.._bar?rrcyrr-r-rrr"zYInterfaceClassTests.test_namesAndDescriptions_w_all_True_bases_w_same_names.._fooArrrrOrr r#r rr r Tr r5r6rcr,r$s r7test_namesAndDescriptions_w_all_True_bases_w_same_nameszKInterfaceClassTests.test_namesAndDescriptions_w_all_True_bases_w_same_names<s69  &ub1)$/ !-T 2 )% 4 }}WJ}7-- 4'-O  < < < FG *U"34 -"67 -"67 rcf|j}|jt|jdyr[)rMr]r^getDescriptionForr$rs rtest_getDescriptionFor_missz/InterfaceClassTests.test_getDescriptionFor_missQs%mmo (C$9$9:Frcddlm}ddlm}d}|dd||d}|j|}|j |j d |d |j |j d |d y) Nrrrcyrr-r-rrrz._barXrrrrOrrrcr5)r!rrrMr"r:rs rtest_getDescriptionFor_hitz.InterfaceClassTests.test_getDescriptionFor_hitUsv69 !%,$T*mm%m( ..u5uU|D ..u5uU|Drc\|jfd}|jt|y)NcdSr[r-)rsr_testz8InterfaceClassTests.test___getitem___miss.._testcs z? "r)rMr]r^)r$rBrs @rtest___getitem___missz)InterfaceClassTests.test___getitem___missas#mmo # (E*rcddlm}ddlm}d}|dd||d}|j|}|j |d |d |j |d |d y) Nrrrcyrr-r-rrrz6InterfaceClassTests.test___getitem___hit.._barjrrrrOrrrcr5)r!rrrMr"rs rtest___getitem___hitz(InterfaceClassTests.test___getitem___hitgsh69 !%,$T*mm%m( UU5\2 UU5\2rcJ|j}|jd|vyr[)rMrr;s rtest___contains___missz*InterfaceClassTests.test___contains___missss mmo s*+rcddlm}ddlm}d}|dd||d}|j|}|j d |v|j d |vy) Nrrrcyrr-r-rrrz7InterfaceClassTests.test___contains___hit.._barzrrrrOrrrcr5)r!rrrMrrs rtest___contains___hitz)InterfaceClassTests.test___contains___hitwsX69 !%,$T*mm%m(  %  %rcf|j}|j|jddyr[)rMr"directr;s rtest_direct_missz$InterfaceClassTests.test_direct_misss&mmo J/6rcddlm}ddlm}d}d}|dd||d}|||d dd }|jd | }|jd |f|}|j |j d|d|j |j d|d|j |j ddy)Nrrrcyrr-r-rrrzBInterfaceClassTests.test_direct_hit_local_miss_bases.._barrrcyrr-r-rrr"zBInterfaceClassTests.test_direct_hit_local_miss_bases.._foorrrrOrr r#r rr r rcr6r5)r!rrrMr"rMr$s r test_direct_hit_local_miss_basesz4InterfaceClassTests.test_direct_hit_local_miss_basess69  &ub1)$/ !-T 2 )% 4 }}WJ}7-- 4'-O . e0DE . e0DE .5rcf|j}|j|jddyr[)rMr"queryDescriptionForrIs rtest_queryDescriptionFor_missz1InterfaceClassTests.test_queryDescriptionFor_misss(  22:>Ercddlm}d|ddi}|j|}|j|j d|dy)NrrattrTitle Descriptionr)rrrMr"rT)r$rrr*s rtest_queryDescriptionFor_hitz0InterfaceClassTests.test_queryDescriptionFor_hitsE,7M:; E * 226:E&MJrcgfd}|j}t}|jd|g|j|j |d|j|fifgy)Nc,j||fyrrQ)rr _called_withs r _passablezCInterfaceClassTests.test_validateInvariants_pass.._passables   r +rr)rMrrer"validateInvariants)r$r^r*rr]s @rtest_validateInvariants_passz0InterfaceClassTests.test_validateInvariants_passsf   h \I;7 11#6= # ~6rc"ddlmgfd}gfd}|j}t}|j d||g|j |j ||j|fifg|j|fifgy)NrInvalidc,j||fyrrQrr_passable_called_withs rr^zTInterfaceClassTests.test_validateInvariants_fail_wo_errors_passed.._passable ! ( ($ 4rc.j||frrQrrrc_fail_called_withs r_failzPInterfaceClassTests.test_validateInvariants_fail_wo_errors_passed.._fail  $ $dBZ 0MrrrrcrMrrer]r_r")r$r^rkr*rrcrjrfs @@@r-test_validateInvariants_fail_wo_errors_passedzAInterfaceClassTests.test_validateInvariants_fail_wo_errors_passeds5 "   h \Iu+=> '5#;#;SA .3&"? *sfb\N;rc\ddlmg}gfd}|j}t}|j d|g|j |j |||j|fifg|jt|d|jt|dy)Nrrbc.j||frrQris rrkzOInterfaceClassTests.test_validateInvariants_fail_w_errors_passed.._failrlrrrm rrcrMrrer]r_r"rgr isinstance)r$_errorsrkr*rrcrjs @@r,test_validateInvariants_fail_w_errors_passedz@InterfaceClassTests.test_validateInvariants_fail_w_errors_passeds5  h \E73 '5#;#;S'J *sfb\N; Wq)  71:w78rcnddlmgfd}gfd}|jd}|jd|f}t}|j d|g|j d|g|j |j ||j|fifg|j|fifgy)Nrrbc,j||fyrrQres rr^z\InterfaceClassTests.test_validateInvariants_fail_in_base_wo_errors_passed.._passablergrc.j||frrQris rrkzXInterfaceClassTests.test_validateInvariants_fail_in_base_wo_errors_passed.._failrlrr r rrm) r$r^rkrrrrcrjrfs @@@r5test_validateInvariants_fail_in_base_wo_errors_passedzIInterfaceClassTests.test_validateInvariants_fail_in_base_wo_errors_passeds5 "  }}W%-- TG4h L5'2|i[9 '7#=#=sC .3&"? *sfb\N;rc ddlmg}g fd}gfd}|jd}|jd|f}t}|j d|g|j d|g|j |j |||j |fifg|j|fifg|jt|d|jt|dy) Nrrbc,j||fyrrQres rr^z[InterfaceClassTests.test_validateInvariants_fail_in_base_w_errors_passed.._passablergrc.j||frrQris rrkzWInterfaceClassTests.test_validateInvariants_fail_in_base_w_errors_passed.._failrlrr r rrmrq) r$rsr^rkrrrrcrjrfs @@@r4test_validateInvariants_fail_in_base_w_errors_passedzHInterfaceClassTests.test_validateInvariants_fail_in_base_w_errors_passeds5 "  }}W%-- TG4h L5'2|i[9 '7#=#=sGL .3&"? *sfb\N; Wq)  71:w78rcgfd}t}|jd}|jd|g|jd|f}|j||j dt y)Nc,j||fyrrQres rr^zbInterfaceClassTests.test_validateInvariants_inherited_not_called_multiple_times.._passablergrr rr rm)rrMrer_r"rg)r$r^rrrrfs @r;test_validateInvariants_inherited_not_called_multiple_timeszOInterfaceClassTests.test_validateInvariants_inherited_not_called_multiple_timessm " h}}W% L9+6-- TG4""3' C 567rcf|jd}|j|jdy)NPickleMe)rMr" __reduce__rIs rtest___reduce__z#InterfaceClassTests.test___reduce__s) j) ))+Z8rcn|jd}|jt|tdy)NHashMe)rz#zope.interface.tests.test_interface)rMr"hashrIs rtest___hash___normalz(InterfaceClassTests.test___hash___normal s4 h' eGH IrcGdd|j}|}|jt5t|dddy#1swYyxYw)NceZdZdZy)IInterfaceClassTests.test___hash___missing_required_attrs..Derivedcyrr-rs rrzRInterfaceClassTests.test___hash___missing_required_attrs..Derived.__init__srNrr-rrDerivedrs rr)rIr]rr)r$rrs r$test___hash___missing_required_attrsz8InterfaceClassTests.test___hash___missing_required_attrssJ d**, )   ~ .  M   s A  Ac|j}|j|dk|j|dk|j|dk(|j|dk7|j|dk\|j|dkD|jd|k|jd|k|jd|k(|jd|k7|jd|k\|jd|kDyrrMrrrIs rtest_comparison_with_Nonez-InterfaceClassTests.test_comparison_with_Nones   %  & $'  & $' & & ' '  &  & u %rc|j}|j||k|j||k|j||k(|j||k7|j||k\|j||kDyr)rMrrrIs r"test_comparison_with_same_instancez6InterfaceClassTests.test_comparison_with_same_instance)ss  ' ' ' %( ' 'rc0|jdd}|jdd}|j||k|j||k|j||k|j||k|j||k(|j||k(|j||k7|j||k7|j||k\|j||k\|j||kD|j||kDy)NINamezzope.interface.tests.onerzzope.interface.tests.otherr)r$rrs r8test_comparison_with_same_named_instance_in_other_modulezLInterfaceClassTests.test_comparison_with_same_named_instance_in_other_module4smmG0JmK g2N O e $ % u % #& & #& u %  % &  % u%  $rc6GddtGfdd|j}|jd}|j||j|j t ||j|j t5|dddd||_|j|||j t |||j 5|ddddy#1swY`xYw#1swYyxYw)Nc eZdZy)DInterfaceClassTests.test_assignment_to__class__..MyExceptionNrr-rrrrHrrrceZdZfdZy)IInterfaceClassTests.test_assignment_to__class__..MyInterfaceClassc|rr-)r$targetrs r__call__zRInterfaceClassTests.test_assignment_to__class__..MyInterfaceClass.__call__Ls!&))rNrrrr)rsrMyInterfaceClassrKs *rrrrm) rrIrMassertIsInstancertyper]r __class__)r$rrrs @rtest_assignment_to__class__z/InterfaceClassTests.test_assignment_to__class__Fs )  *t335 *}}W% dD$8$8$:; d4j$"6"6"89   y )  G * d$45 d4j"23   { +  G      s D1 DD Dcddlm}Gdd|j}|d|f}|j|ddGdd |}|j|ddGd d |}|j t 5|ddd||_|j|ddy#1swY)xYw) NrrcceZdZdZy)JInterfaceClassTests.test_assignment_to__class__2..MyInterfaceClassc|Srr-)r$rs rrzSInterfaceClassTests.test_assignment_to__class__2..MyInterfaceClass.__call__cs rNrr-rrrrbrJrrrrm)rmc eZdZy)>InterfaceClassTests.test_assignment_to__class__2..IBarNrr-rrrrirrrc eZdZy)?InterfaceClassTests.test_assignment_to__class__2..ISpamNrr-rrISpamrnrrr)rrdrIr"r]rr)r$rdrrrrs rtest_assignment_to__class__2z0InterfaceClassTests.test_assignment_to__class__2]s - t335   5 a$' 4  a$' I   y )  G + q4(   s B55B>c|j}|jt5d|_dddy#1swYyxYw)Nzdifferent.module)rMr]rr)r$rs rtest__module__is_readonlyz-InterfaceClassTests.test__module__is_readonlyws7}}   ~ . 10DO 1 1 1s 7A)ITestr-NNN)4rrrrIrMrWrrrrrrrrrrrrrrrr%r)r.r1r4r8r<r?rCrFrHrKrNrRrUrZr`rnrtrxr|rrrrrrrrrrr-rrrr]sDH O.E 5111L 3 <3 :9 ; D F QQ"A" $*G E+ 3, &76&FK 7<" 9<&9, 89I &" (%$.)41rrcDeZdZdZdZdZdZdZdZdZ 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/Z1d0Z2d1Z3d2Z4d3Z5d4Z6y5)6InterfaceTestscxddlm}ddlmGfdd|}|j|dj|uy)Nrrcrc eZdZWdZy).I1My attrN)rrrrWrsrI1rs Y'DrrrW)rrdrrr)r$rdrrs @r!test_attributes_link_to_interfacez0InterfaceTests.test_attributes_link_to_interfaces2,, ( ( 6 ,,23rcfddlm}Gdd|}|j|dj|uy)NrrcceZdZdZy)9InterfaceTests.test_methods_link_to_interface..I1cyzA methodNr-)rcr5bingos rmethodz@InterfaceTests.test_methods_link_to_interface..I1.methodrrNrrrrr-rrrrs rrr)rrdrr)r$rdrs rtest_methods_link_to_interfacez-InterfaceTests.test_methods_link_to_interfaces.,   8 .."45rcddlm}ddlm}ddlm}Gdd|Gdd|}Gfd d }|}|j j||j |j||j |j ||v|j |||v|j ||v|j |||vy) NrrcrrceZdZdZdZy).ICurrentcy docstringNr-rrs rmethod1zDInterfaceTests.test_classImplements_simple..ICurrent.method1rrcyrr-rs rmethod2zDInterfaceTests.test_classImplements_simple..ICurrent.method2rrN)rrrrrr-rrICurrentrs   rrc eZdZy):InterfaceTests.test_classImplements_simple..IOtherNrr-rrrrrrrc eZdZWZdZdZy);InterfaceTests.test_classImplements_simple..Currentctrrr$rrs rrzCInterfaceTests.test_classImplements_simple..Current.method1 )++rctrrrs rrzCInterfaceTests.test_classImplements_simple..Current.method2rrN)rrr__implemented__rr)rsrCurrentrs&O , ,rr)rrdrrrrr")r$rdrrrrcurrentrs @rtest_classImplements_simplez*InterfaceTests.test_classImplements_simples,0- y  Y  , ,) ..w78 --g67 8, M'$::; =#99: Jw$778 :g#667rcddlm}ddlm}ddlm}Gdd|Gdd}Gfd d }|}|j j||j |j||j ||v|j |||v|j ||v|j |||vy) NrrcrrceZdZdZy)CInterfaceTests.test_classImplements_base_not_derived..IBasecyrr-r-rrrzJInterfaceTests.test_classImplements_base_not_derived..IBase.methodrrNrr-rrr r rr c eZdZy)FInterfaceTests.test_classImplements_base_not_derived..IDerivedNrr-rrr rrrr ceZdZWZdZy)EInterfaceTests.test_classImplements_base_not_derived..Currentctrrrs rrzLInterfaceTests.test_classImplements_base_not_derived..Current.methodrrNrrrrr)r srrrs #O ,rrrrdrrrr)r$rdrrr rrr s @r%test_classImplements_base_not_derivedz4InterfaceTests.test_classImplements_base_not_deriveds,0- I  u  , ,) ++G45 //89 w!778 ]7%;;< G!445 Z%889rc`ddlm}ddlm}ddlm}Gdd|}Gdd|Gfd d }|}|j |j||j j||j |||v|j |||j v|j ||v|j |||v|j |||j v|j ||vy) NrrcrrceZdZdZy)CInterfaceTests.test_classImplements_base_and_derived..IBasecyrr-r-rrrzJInterfaceTests.test_classImplements_base_and_derived..IBase.methodrrNrr-rrr rrrr c eZdZy)FInterfaceTests.test_classImplements_base_and_derived..IDerivedNrr-rrr rrrr ceZdZWZdZy)EInterfaceTests.test_classImplements_base_and_derived..Currentctrrrs rrzLInterfaceTests.test_classImplements_base_and_derived..Current.methodrrNr)r srrrs &O ,rr)rrdrrrr flattened)r$rdrrr rrr s @r%test_classImplements_base_and_derivedz4InterfaceTests.test_classImplements_base_and_deriveds,0- I  u  , , ) ++G45 ..w78 -"889 w!7!A!A!CCD M'$::; *W"556 G!4!>!>!@@A Jw$778rc ddlm}ddlm}ddlm}Gdd|Gdd Gfd d }G fd d }Gd d||}|}|j j||j j||j ||v|j ||v|j ||v|j ||vy)NrrcrrceZdZdZy);InterfaceTests.test_classImplements_multiple..ILeftcyrr-r-rrrzBInterfaceTests.test_classImplements_multiple..ILeft.methodrrNrr-rrILeftrrrrc eZdZy).IRightNrr-rrIRightrrrrceZdZWZdZy):InterfaceTests.test_classImplements_multiple..Leftctrrrs rrzAInterfaceTests.test_classImplements_multiple..Left.methodrrNrrsrLeftr #O ,rrceZdZWZy);InterfaceTests.test_classImplements_multiple..RightNrrrrrsrRightr$Orrc eZdZy):InterfaceTests.test_classImplements_multiple..AmbiNrr-rrAmbirrrr)rrdrrr) r$rdrrrrrambirrs @@rtest_classImplements_multiplez,InterfaceTests.test_classImplements_multiples,0- I  U  , ,  % % 4 v ++D12 ,,T23 t!445 -"556 D!112 *T"223rc ddlm}ddlm}ddlm}Gdd|Gdd Gd d |Gfd d  G fd d}Gfdd G fdd |}|}|j j||j j||j j||j ||v|j ||v|j ||v|j ||v|j ||v|j ||vy)NrrcrrceZdZdZy)PInterfaceTests.test_classImplements_multiple_w_explict_implements..ILeftcyrr-r-rrrzWInterfaceTests.test_classImplements_multiple_w_explict_implements..ILeft.method rrNrr-rrrr  s rrc eZdZy)QInterfaceTests.test_classImplements_multiple_w_explict_implements..IRightNrr-rrrrrrrc eZdZy)QInterfaceTests.test_classImplements_multiple_w_explict_implements..IOtherNrr-rrrrrrrceZdZWZdZy)OInterfaceTests.test_classImplements_multiple_w_explict_implements..Leftctrrrs rrzVInterfaceTests.test_classImplements_multiple_w_explict_implements..Left.methodrrNrrsrrrrrrceZdZWZy)PInterfaceTests.test_classImplements_multiple_w_explict_implements..RightNrrsrrrrrrceZdZWZy)PInterfaceTests.test_classImplements_multiple_w_explict_implements..OtherNr)rsrOtherrrrrcBeZdZWjWjfZy)PInterfaceTests.test_classImplements_multiple_w_explict_implements..MixedNr)rrsrMixedr s"22E4I4IIOrrr) r$rdrrrrmixedrrrrrs @@@@@r2test_classImplements_multiple_w_explict_implementszAInterfaceTests.test_classImplements_multiple_w_explict_implementss6,0- I  U  Y  , ,  % % % % JD% J ++E23 --e45 ,,U34 u!556 =#778 -"667 E!223 :e#445 *U"334rc2ddlm}|j}|d}|d|f}|d}|d||f}|j|j ||j|j ||j|j ||j |j ||j |j ||j|j ||j |j |y)Nrrc FunInterface BarInterface BobInterface BazInterface)rrdrrrr)r$rdnewr r!r"r#s rtestInterfaceExtendsInterfacez,InterfaceTests.testInterfaceExtendsInterface/s,!!>* >L?; >* >L,+HI   ,,\:;  ,,\:;  ,,\:; --l;< --l;<  ,,\:; --l;.ICheckMercyrr-r-rrrz8InterfaceTests.test_verifyClass..ICheckMe.methodIrrNrrrrWrrsrICheckMer)FY'D rr,ceZdZWZdZdZy)0InterfaceTests.test_verifyClass..CheckMevaluectrrrs rrz7InterfaceTests.test_verifyClass..CheckMe.methodPrrNrrrrrWrr,srCheckMer/L&OD ,rr4)rrrdr~r'r)r$rdr'r4rr,s @@rtest_verifyClasszInterfaceTests.test_verifyClass@s7,,5 y   , ,  Hg67rcddlmddlm}ddlm}Gfdd|Gfdd}|}|j ||y) Nrrrcr{c&eZdZWdZdZy)2InterfaceTests.test_verifyObject..ICheckMercyrr-r-rrrz9InterfaceTests.test_verifyObject..ICheckMe.method^rrNr+rsrr,r9[r-rr,ceZdZWZdZdZy)1InterfaceTests.test_verifyObject..CheckMer0ctrrrs rrz8InterfaceTests.test_verifyObject..CheckMe.methoderrNr2r3srr4r<ar5rr4)rrrdr~r|r)r$rdr|r4check_merr,s @@rtest_verifyObjectz InterfaceTests.test_verifyObjectUs>,,6 y   , ,9  Xx89rcfddlm}Gdd|}|j|j|y)Nrrcc eZdZy)LInterfaceTests.test_interface_object_provides_Interface..AnInterfaceNrr-rr AnInterfacerBorrrC)rrdrr)r$rdrCs r(test_interface_object_provides_Interfacez7InterfaceTests.test_interface_object_provides_Interfacels*, )   ,,[9:rcddlmddlm}Gfdd|}|jt |j ddgy)Nrrrcc&eZdZWdZdZy)1InterfaceTests.test_names_simple..ISimplercyrr-r-rrrz8InterfaceTests.test_names_simple..ISimple.method|rrNr+rsrISimplerGyY'D rrIrWrrrrdr"rrr$rdrIrs @rtest_names_simplez InterfaceTests.test_names_simplets7,, i  0682DErcddlmddlm}Gfdd|}Gfdd|}|jt |j gd|jt |j d gd y) Nrrrcc&eZdZWdZdZy)0InterfaceTests.test_names_derived..IBasercyrr-r-rrrz7InterfaceTests.test_names_derived..IBase.methodrrNr+rsrr rPrJrr c,eZdZWdZdZdZy)3InterfaceTests.test_names_derived..IDerivedMy attr2cyrr-r-rrrz:InterfaceTests.test_names_derived..IDerived.methodrrcyrr-r-rrrz;InterfaceTests.test_names_derived..IDerived.method2rrNrrrattr2rrrsrr rSsj)E  rr )rXrrTr rWrXrrrKr$rdr r rs @rtest_names_derivedz!InterfaceTests.test_names_derivedsf,, I  u   017 9 4 89? Arcddlmddlm}ddlm}Gfdd|}t |j }|jt|d|j|ddd|jt|dd |j|dd jd|j|dd jd |j|d dd |jt|d d ||j|d d jd |j|d d jd y) NrrMethodrcc&eZdZWdZdZy)@InterfaceTests.test_namesAndDescriptions_simple..ISimplercy My methodNr-r-rrrzGInterfaceTests.test_namesAndDescriptions_simple..ISimple.methodrrNr+rsrrIr`Y'D rrIrerWrmrrrc) rrr!r^rdrr-r"rgrrrrrQ)r$r^rdrI name_valuesrs @r test_namesAndDescriptions_simplez/InterfaceTests.test_namesAndDescriptions_simples(,3, i  W99;<  [)1- Q*F3  ;q>!#4i@A Q*33V< Q*22I> Q*H5  ;q>!#4f=> Q*33X> Q*22K@rcddlmddlm}ddlm}Gfdd|}Gfdd|}t |j }|jt|d |j|ddd |jt|dd |j|dd jd |j|dd jd |j|d dd |jt|d d ||j|d d jd |j|d d jd|j|ddd|jt|dd ||j|dd jd|j|dd jdt |j d}|jt|d|j|ddd|jt|dd |j|dd jd|j|dd jd|j|d dd |jt|d d |j|d d jd |j|d d jd |j|ddd |jt|dd ||j|dd jd |j|dd jd|j|d dd|jt|d d ||j|d d jd|j|d d jdy)Nrrrcr]c&eZdZWdZdZy)?InterfaceTests.test_namesAndDescriptions_derived..IBasercyrbr-r-rrrzFInterfaceTests.test_namesAndDescriptions_derived..IBase.methodrrNr+rsrr rirdrr c,eZdZWdZdZdZy)BInterfaceTests.test_namesAndDescriptions_derived..IDerivedrTcyMy method, overriddenNr-r-rrrzIInterfaceTests.test_namesAndDescriptions_derived..IDerived.methodrrcy My method2Nr-r-rrrzJInterfaceTests.test_namesAndDescriptions_derived..IDerived.method2rrNrWrsrr rlj)E ( rr rXrmrTrrorerrrTr rWr) rrrdr!r^rr-r"rgrrrrrQ)r$rdr^r r rers @r!test_namesAndDescriptions_derivedz0InterfaceTests.test_namesAndDescriptions_deriveds,,3 I   u X::<=  [)1- Q*G4  ;q>!#4i@A Q*33W= Q*22J? Q*H5  ;q>!#4f=> Q*33X> Q*224KL Q*I6  ;q>!#4f=> Q*33Y? Q*22LAX::t:DE  [)1- Q*F3  ;q>!#4i@A Q*33V< Q*22I> Q*G4  ;q>!#4i@A Q*33W= Q*22J? Q*H5  ;q>!#4f=> Q*33X> Q*224KL Q*I6  ;q>!#4f=> Q*33Y? Q*22LArchddlm}Gdd|}|jt|jdy)Nrrcc eZdZy)IInterfaceTests.test_getDescriptionFor_nonesuch_no_default..IEmptyNrr-rrIEmptyryrrrzr\)rrdr]r^r:r$rdrzs r*test_getDescriptionFor_nonesuch_no_defaultz9InterfaceTests.test_getDescriptionFor_nonesuch_no_defaults+, Y  (F$<$.ISimplercyrbr-r-rrrzDInterfaceTests.test_getDescriptionFor_simple..ISimple.methodrrNr+rsrrIrrdrrIrWrrrc rrr!r^rdr:rrrr"rrQr$r^rdrIa_descm_descrs @rtest_getDescriptionFor_simplez,InterfaceTests.test_getDescriptionFor_simples,3, i  **62  6956 &1 3**84  6623 (3 5rc~ ddlm ddlm}ddlm}G fdd|}G fdd|}|j d }|j t| |j|jd |j|jd |j d }|j t|||j|jd |j|jd |j d }|j t| |j|jd |j|jd|j d}|j t|||j|jd|j|jdy)Nrrr]rcc&eZdZWdZdZy).IBasercyrbr-r-rrrzCInterfaceTests.test_getDescriptionFor_derived..IBase.methodrrNr+rsrr rrdrr c,eZdZWdZdZdZy)?InterfaceTests.test_getDescriptionFor_derived..IDerivedrTcyrnr-r-rrrzFInterfaceTests.test_getDescriptionFor_derived..IDerived.methodrrcyrqr-r-rrrzGInterfaceTests.test_getDescriptionFor_derived..IDerived.method2rrNrWrsrr rrsrr rWrrrorXrTrrrr r$r^rdr r rra2_descm2_descrs @rtest_getDescriptionFor_derivedz-InterfaceTests.test_getDescriptionFor_derived sW,3, I   u ++F3  6956 &1 3++H5  6623 (3 )@A,,W5  7I67 ))73 *5,,Y7  7F34 ))95 ,7rchddlm}Gdd|}|jt|jdy)Nrrcc eZdZy)7InterfaceTests.test___getitem__nonesuch..IEmptyNrr-rrrzr5rrrzr\)rrdr]r^ __getitem__r{s rtest___getitem__nonesuchz'InterfaceTests.test___getitem__nonesuch2s+, Y  (F$6$6 Crcddlmddlm}ddlm}Gfdd|}|d}|j t ||j|jd|j|jd|d }|j t |||j|jd |j|jd y) Nrrr]rcc&eZdZWdZdZy)6InterfaceTests.test___getitem__simple..ISimplercyrbr-r-rrrz=InterfaceTests.test___getitem__simple..ISimple.methodCrrNr+rsrrIr@rdrrIrWrrrc rrr!r^rdrrrr"rrQrs @rtest___getitem__simplez%InterfaceTests.test___getitem__simple:s,3, i    6956 &1 3"  6623 (3 5rc ddlm ddlm}ddlm}G fdd|}G fdd|}|d }|j t | |j|jd |j|jd |d }|j t |||j|jd |j|jd |d }|j t | |j|jd |j|jd|d}|j t |||j|jd|j|jdy)Nrrr]rcc&eZdZWdZdZy)6InterfaceTests.test___getitem___derived..IBasercyrbr-r-rrrz=InterfaceTests.test___getitem___derived..IBase.methodYrrNr+rsrr rVrdrr c,eZdZWdZdZdZy)9InterfaceTests.test___getitem___derived..IDerivedrTcyrnr-r-rrrz@InterfaceTests.test___getitem___derived..IDerived.method_rrcyrqr-r-rrrzAInterfaceTests.test___getitem___derived..IDerived.method2brrNrWrsrr r\rsrr rWrrrorXrTrrrrrs @rtest___getitem___derivedz'InterfaceTests.test___getitem___derivedPs?,3, I   u &!  6956 &1 3(#  6623 (3 )@A7#  7I67 ))73 *59%  7F34 ))95 ,7rcLddlm}Gdd|}|jd|vy)Nrrcc eZdZy)8InterfaceTests.test___contains__nonesuch..IEmptyNrr-rrrzr|rrrzr\)rrdrr{s rtest___contains__nonesuchz(InterfaceTests.test___contains__nonesuchys&, Y  v-.rcddlmddlm}Gfdd|}|jd|v|jd|vy)Nrrrcc&eZdZWdZdZy)7InterfaceTests.test___contains__simple..ISimplercyrbr-r-rrrz>InterfaceTests.test___contains__simple..ISimple.methodrrNr+rsrrIrrdrrIrWrrrrdrrLs @rtest___contains__simplez&InterfaceTests.test___contains__simples9,, i  ')* G+,rcddlmddlm}Gfdd|}Gfdd|}|jd|v|jd |v|jd |v|jd |vy) Nrrrcc&eZdZWdZdZy)6InterfaceTests.test___contains__derived..IBasercyrbr-r-rrrz=InterfaceTests.test___contains__derived..IBase.methodrrNr+rsrr rrdrr c,eZdZWdZdZdZy)9InterfaceTests.test___contains__derived..IDerivedrTcyrnr-r-rrrz@InterfaceTests.test___contains__derived..IDerived.methodrrcyrqr-r-rrrzAInterfaceTests.test___contains__derived..IDerived.method2rrNrWrsrr rrsrr rWrrXrrrZs @rtest___contains__derivedz'InterfaceTests.test___contains__derivedsg,, I   u  (*+ H,- 8+,  X-.rc\ddlm}Gdd|}|jt|gy)Nrrcc eZdZy)1InterfaceTests.test___iter__empty..IEmptyNrr-rrrzrrrrz)rrdr"rSr{s rtest___iter__emptyz!InterfaceTests.test___iter__emptys', Y  fr*rcddlmddlm}Gfdd|}|jt t |ddgy)Nrrrcc&eZdZWdZdZy)3InterfaceTests.test___iter__simple..ISimplercyrbr-r-rrrz:InterfaceTests.test___iter__simple..ISimple.methodrrNr+rsrrIrrdrrIrWrrrrdr"rrSrLs @rtest___iter__simplez"InterfaceTests.test___iter__simples5,, i  W .0BCrcddlmddlm}Gfdd|}Gfdd|}|jt t |gdy) Nrrrcc&eZdZWdZdZy)2InterfaceTests.test___iter__derived..IBasercyrbr-r-rrrz9InterfaceTests.test___iter__derived..IBase.methodrrNr+rsrr rrdrr c,eZdZWdZdZdZy)5InterfaceTests.test___iter__derived..IDerivedrTcyrnr-r-rrrz.IDerived.methodrrcyrqr-r-rrrz=InterfaceTests.test___iter__derived..IDerived.method2rrNrWrsrr rrsrr rYrrZs @rtest___iter__derivedz#InterfaceTests.test___iter__deriveds@,, I   u  X/? Arcrddlm}Gdd|}|d}|j|jddy)Nrrcc eZdZdZde_y)LInterfaceTests.test_function_attributes_become_tagged_values..ITagMecyrr-r-rrrzSInterfaceTests.test_function_attributes_become_tagged_values..ITagMe.methodrrrmN)rrrroptionalr-rrITagMers FOrrrrrm)rrdr"r_)r$rdrrs r-test_function_attributes_become_tagged_valueszrcddlm}Gdd|}|j|jd|jt |gy)NrrcceZdZdZy)@InterfaceTests.test___doc___non_element..IHaveADocStringxxxNrrrrQr-rrIHaveADocStringr rrr)rrdr"rQrS)r$rdrs rtest___doc___non_elementz'InterfaceTests.test___doc___non_elements>, i  00%8 o.3rcddlmddlm}Gfdd|}|j|jd|jt |dgy)Nrrrcc$eZdZdZWdZy)?InterfaceTests.test___doc___as_element..IHaveADocStringrthe docNrrsrrrs  *GrrrOrQ)rrrdr"rQrS)r$rdrrs @rtest___doc___as_elementz&InterfaceTests.test___doc___as_elementsD,, +i + 00"5 o.  ? Q++,-% 1 --  5C   S*.."3 4 5  /   UZZ]A . . /.s#B:)C+:C(?C##C(cddlmddlm}ddlm}ddlmGfdd|}Gdd }|}||||j |j d tg|j |j|dd |_ |j |j|dd |_ |j |j|d|` |j|d dg|y)NrrrcdirectlyProvidesr cDeZdZWdZWdZWey)8InterfaceTests.test_invariant_simple..IInvariantrc*bar; must eval to Boolean True if foo doesNrrrrcr5 _ifFooThenBarrr sr IInvariantr  E"CHIC m $rrc eZdZy):InterfaceTests.test_invariant_simple..HasInvariantNrr-rr HasInvariantrrrrr*rmIf Foo, then Bar!) rrrdrr r"r_rr_r5rcr)r$rdrrrrrr s @@rtest_invariant_simplez$InterfaceTests.test_invariant_simples,,3, % %   %  3 22<@' * 66}EtL  66}EtL  66}EtL   --@,A$ &rcddlmddlm}ddlm}ddlmGfdd|}Gfdd |}Gd d }|j |j d tg|}|||d |_|j|ddg|d|_d|_ |j|ddg|d|_d|_ |j|dddg|d|_d|_ |j |j|dy)Nrrrcrr cDeZdZWdZWdZWey)8InterfaceTests.test_invariant_nested..IInvariantrcrNrrsrrr'rrrc eZdZWey);InterfaceTests.test_invariant_nested..ISubInvariantN)rrr_barGreaterThanFoor sr ISubInvariantr,s ( )rrc eZdZy):InterfaceTests.test_invariant_nested..HasInvariantNrr-rrrr/rrrrrrmrre%Please, Boo MUST be greater than Foo!) rrrdrr r"r_rrcrr5r_) r$rdrrrrrrr s @@rtest_invariant_nestedz$InterfaceTests.test_invariant_nested!s,,3, % %  *J *   55lC,- /$  6  --@,A' )   -BC' )    -.BD' )    66}EtLrcJ ddlmddlm}ddlm}ddlm G fdd|}Gdd }|}|||d |_|j d }|dd}|jt|jd ||j|d d g|d|_d |_ |j|d dg|d |_d|_ |j|dd dg|d |_d|_ |j|j|d|jd |y)Nrrrcrr cDeZdZWdZWdZWey):InterfaceTests.test_invariant_mutandis..IInvariantrcrNrrsrrr Vrrrc eZdZy).HasInvariantNrr-rrrr [rrrrrrmrrer)rrrdrr rcr_rRrrerr5r"r_) r$rdrrrrold_invariantsrrr s @@rtest_invariant_mutandisz&InterfaceTests.test_invariant_mutandisPs5,,3, % %    %  3 $22<@#A& ,-!!, ; --@,A$ &   -BCZ Q   -.BD$ &    66}EtL!!,?rc,ddlm}ddlmGdd|}|j|jd|jt |gGfdd|}|j|jd |jt |d gy) NrrcrceZdZdZy)7InterfaceTests.test___doc___element..IDocstringrNrr-rr IDocstringrrrrrc$eZdZdZWdZy)CInterfaceTests.test___doc___element..IDocstringAndAttributerrNrrsrIDocstringAndAttributers  *GrrrOrQ)rrdrr"rQrS)r$rdrrrs @rtest___doc___elementz#InterfaceTests.test___doc___elements,,   ++U3 j)2. +Y + /77< 45 {Crczddlm}ddlmddlm}ddlmddlmGfdd|}||Gd d }|j|d d |j|d d  |j|d d y#$r%}|jt|d Yd}~yd}~wwxYw)Nrrcrrr rbcHeZdZWdZWdZWfdZy):InterfaceTests.test_invariant_as_decorator..IRangez Lower boundz Upper boundcH|j|jkrdy)N max < min)maxmin)obrcs rrange_invariantzJInterfaceTests.test_invariant_as_decorator..IRange.range_invariants"66BFF?!+..#rN)rrrrrr )rrcr srIRangers)M*CM*C  / /rr!ceZdZdZy)9InterfaceTests.test_invariant_as_decorator..Rangec"||c|_|_yr)rr)r$rrs rrzBInterfaceTests.test_invariant_as_decorator..Range.__init__s%(#"$(rNrr-rrRanger#s .rr%rmrer) rrdrrr rrcr_r"r7) r$rdrr!r%rrrcr s @@@rtest_invariant_as_decoratorz*InterfaceTests.test_invariant_as_decorators,,.,5 / /Y / V  . .  . !!%1+.!!%1+. 2  % %eAqk 2 2   SV[ 1 1 2s7BB:B55B:c*ddlmddlm}ddlmGfdd|}Gfdd|}Gd d |}|j |j d d |j t|j d |j t|jd g|j |j d d|j |j d d|j t|jd d hy)Nrrrcr1cFeZdZWdZWdZWddy)0InterfaceTests.test_taggedValue..ITaggedrcrr<SpamN)rrrrcr5rr2srITaggedr)s"E"CHIC v &rr,c6eZdZWddWddy)1InterfaceTests.test_taggedValue..IDerivedr< Spam Spamrcr5Nrr1srr r.s { + u %rr c eZdZy)2InterfaceTests.test_taggedValue..IDerived2Nrr-rr IDerived2r1rrr2r<r*rcr/r5) rrrdr2r"r_r]r^rSrTset)r$rdr,r r2rr2s @@rtest_taggedValuezInterfaceTests.test_taggedValues,,. 'i '  &w &   //6? (G$:$:EB g88:;eWE 11%8+F 11%8%@ Y99;.FtagFNrrrr8r+srr9r7 s #C.Crr9c4eZdZWddWdZy)0InterfaceTests._make_taggedValue_tree..Er8ENr:r+srr>r=r;rr>c4eZdZWddWdZy)0InterfaceTests._make_taggedValue_tree..Dr8DNr:r+srrAr@r;rrAc4eZdZWddWdZy)0InterfaceTests._make_taggedValue_tree..Cr8CNr:r+srrDrCr;rrDc eZdZy)0InterfaceTests._make_taggedValue_tree..BNrr-rrBrFrrrGc eZdZy)0InterfaceTests._make_taggedValue_tree..ANrr-rrArIrrrJ)rr2r) r$rOr9r>rArDrGrJrr2s @@r_make_taggedValue_treez%InterfaceTests._make_taggedValue_treesc.,  ! ! ! ! ! ! !1 ! 1  1 rc&ddlm}|jt}|j |j j d|j|}|j |dj d|j |jdd|j |jdd|jdj dk(sJ|jdjdd|j |jddy)NrrcrDr8rG) rrdrLrr"r8rr_rirfre)r$rdclass_Aiface_As r"test_getTaggedValue_follows__iro__z1InterfaceTests.test_getTaggedValue_follows__iro__s ---f5 --s3--i8 00#6 //6< 11%8#>  #,,333!++E37 //6?@   x ( * " "5 ) * $ 11%8#> //6< %$q'A'A'C"DE{{1~&&#--- KKN 11%8#> //6< %$q'A'A'C"DE * *s 6F((F2cddlm}ddlmGfdd|}Gdd|}Gdd |}|j|j d |j d u|f|_|j|j d duy) Nrrcrc eZdZWdZy).I1rN)rrrrrsrrrUs #Arrc eZdZy).I2Nrr-rrI2rWrrrXc eZdZy).I3Nrr-rrI3rZrrr[r)rrdrrrrf)r$rdrrXr[rs @r!test_description_cache_managementz0InterfaceTests.test_description_cache_managementst -,       s rvvc{23!|  s t+,rcddlm}ddlm}Gdd|}||Gdd}|j||dy)Nrrcrc eZdZy)>InterfaceTests.test___call___defers_to___conform___..INrr-rrr}r_'rrr}ceZdZdZy)>InterfaceTests.test___call___defers_to___conform___..Ccy)Nrr-)r$protos rr,zJInterfaceTests.test___call___defers_to___conform___..C.__conform__,srNr-r-rrrDra*s rrD)rrdrr")r$rdrr}rDs r$test___call___defers_to___conform___z3InterfaceTests.test___call___defers_to___conform___#sI,.    Q     13#rcddlm}ddlm}Gdd|}||Gdd}|}|j|||uy)Nrrcrc eZdZy)9InterfaceTests.test___call___object_implements..INrr-rrr}rg5rrr}c eZdZy)9InterfaceTests.test___call___object_implements..CNrr-rrrDri8rrrD)rrdrr)r$rdrr}rDcs rtest___call___object_implementsz.InterfaceTests.test___call___object_implements1sN,.    Q     C ! "rcvddlm}Gdd|}Gdd}|}|jt||y)Nrrcc eZdZy)9InterfaceTests.test___call___miss_wo_alternate..INrr-rrr}rnBrrr}c eZdZy)9InterfaceTests.test___call___miss_wo_alternate..CNrr-rrrDrpErrrD)rrdr]rr$rdr}rDrjs rtest___call___miss_wo_alternatez.InterfaceTests.test___call___miss_wo_alternate?s6,      C )Q*rc|ddlm}Gdd|}Gdd}|}|j||||uy)Nrrcc eZdZy)8InterfaceTests.test___call___miss_w_alternate..INrr-rrr}ruNrrr}c eZdZy)8InterfaceTests.test___call___miss_w_alternate..CNrr-rrrDrwQrrrD)rrdrrqs rtest___call___miss_w_alternatez-InterfaceTests.test___call___miss_w_alternateKs;,      C !T d*+rcddlm}ddlm}d}fd}Gdd|}Gdd }|}|dd}||g|dd j ||u||ddy#||ddwxYw) NrrcrXcyrr-rVs r_missz:InterfaceTests.test___call___w_adapter_hook.._miss[s rcSrr-)r*rr$s r_hitz9InterfaceTests.test___call___w_adapter_hook.._hit^sKrc eZdZy)6InterfaceTests.test___call___w_adapter_hook..INrr-rrr}rarrr}c eZdZy)6InterfaceTests.test___call___w_adapter_hook..CNrr-rrrDrdrrrD)rrdr!rYr) r$rdrYr{r}r}rDrjold_adapter_hookss ` rtest___call___w_adapter_hookz+InterfaceTests.test___call___w_adapter_hookWsz,:        C)!,!4= a 1 OOAaDDL )0M! 0M! s AA%cddlm}ddlmddlm}Gfdd|}||Gdd}|j d |t |j d ||y) Nrrcinterfacemethodrc eZdZWdZy):InterfaceTests.test___call___w_overridden_adapt..IcyNrr-r$rs rrMzDInterfaceTests.test___call___w_overridden_adapt..I.__adapt__wrNrrrrMrsrr}rus   rr}c eZdZy):InterfaceTests.test___call___w_overridden_adapt..ONrr-rrrKr{rrrKr)rrdrrr"r)r$rdrr}rKrs @r test___call___w_overridden_adaptz/InterfaceTests.test___call___w_overridden_adaptpse,2.    Q     Qvx[) QqsV$rc ddlm}ddlmddlm}Gfdd|}Gdd|}||Gd d }||Gd d }|j d |t |j d|||j d|||j t5||ddd|j d ||y#1swY'xYw)Nrrcrrc eZdZWdZy)KInterfaceTests.test___call___w_overridden_adapt_and_conform..IAdaptcyrr-rs rrMzUInterfaceTests.test___call___w_overridden_adapt_and_conform..IAdapt.__adapt__rrNrrsrIAdaptr   rrceZdZdZy)LInterfaceTests.test___call___w_overridden_adapt_and_conform..ISimplezNothing special.Nrr-rrrIrs "rrIceZdZdZy)NInterfaceTests.test___call___w_overridden_adapt_and_conform..Conform24cyNr-rIs rr,zZInterfaceTests.test___call___w_overridden_adapt_and_conform..Conform24.__conform__srNr-r-rr Conform24rs rrceZdZdZy)PInterfaceTests.test___call___w_overridden_adapt_and_conform..ConformNonecyrr-rIs rr,z\InterfaceTests.test___call___w_overridden_adapt_and_conform..ConformNone.__conform__rrNr-r-rr ConformNoners rrrr)rrdrrr"rr]r)r$rdrrrIrrrs @r,test___call___w_overridden_adapt_and_conformz;InterfaceTests.test___call___w_overridden_adapt_and_conforms -2. Y   #i # V      V      VFH-. WY[12 VIK01   y ) # KM " # VKM23 # #s C99Dcddl}ddlm}ddlmddlm}Gfdd|}||Gdd}|j d |t |}|j|||y) Nrrcrrc,eZdZWfdZxZS)EInterfaceTests.test___call___w_overridden_adapt_call_super..IcF|j|syt| |Sr)rsuperrM)r$rrs rrMzOInterfaceTests.test___call___w_overridden_adapt_call_super..I.__adapt__s"s+w(--r)rrrrM __classcell__)rrs@rr}rs  . .rr}c eZdZy)EInterfaceTests.test___call___w_overridden_adapt_call_super..ONrr-rrrKrrrrKr)sysrrdrrr"rr)r$rrdrr}rKors @r+test___call___w_overridden_adapt_call_superz:InterfaceTests.test___call___w_overridden_adapt_call_supersi,2. .  . Q     Qvx[) C a1rcddlm}ddlmGfdd|}|jd|t |j|dj dy) Nrrcrc&eZdZWdZdZy)EInterfaceTests.test___adapt___as_method_and_implementation..Icyrr-rs rrMzOInterfaceTests.test___adapt___as_method_and_implementation..I.__adapt__rrcy)zThis is a protocolNr-)to_adapts rrMzOInterfaceTests.test___adapt___as_method_and_implementation..I.__adapt__rrNrrsrr}rs    %rr}rrMz (to_adapt))rrdrr"rgetSignatureStringr$rdr}rs @r+test___adapt___as_method_and_implementationz:InterfaceTests.test___adapt___as_method_and_implementationsJ,2 %  % Qvx[) ;::.IRootRootNrr-rrIRootrs rrc eZdZWdZy)EInterfaceTests.test___adapt__inheritance_and_type..IWithAdaptcyrr-rs rrMzOInterfaceTests.test___adapt__inheritance_and_type..IWithAdapt.__adapt__rrNrrsr IWithAdaptrrrrceZdZdZy)AInterfaceTests.test___adapt__inheritance_and_type..IOtherz Second branchNrr-rrrrs rrceZdZdZy)EInterfaceTests.test___adapt__inheritance_and_type..IUnrelated UnrelatedNrr-rr IUnrelatedrs rrceZdZdZy)HInterfaceTests.test___adapt__inheritance_and_type..IDerivedAdaptzInherits an adaptNrr-rr IDerivedAdaptrs #rrc$eZdZdZWdZy)IInterfaceTests.test___adapt__inheritance_and_type..IDerived2Adaptz$Overrides an inherited custom adapt.cyrr-rs rrMzSInterfaceTests.test___adapt__inheritance_and_type..IDerived2Adapt.__adapt__rrN)rrrrQrMrsrIDerived2Adaptrs 6   rrrr) rrdrr"rrrrassertNotEqualr) r$rdrrrrrrr*rs @r"test___adapt__inheritance_and_typez1InterfaceTests.test___adapt__inheritance_and_types],2 I     U    $J F $ ]  ]6845J MI 9E   Xu'7'7 8 9FJ. ;E   T%[$y/ : ; DOT*-=> j)4 +>? j$y/: ^FH56 D0$}2EF nd=.ABrcddlm}ddlmGfdd|}|j||d|j|j dy)Nrrcrc2eZdZWdZWdZy)9InterfaceTests.test_interfacemethod_is_general..Icy)zReplace an existing methodrr-rs rrzBInterfaceTests.test_interfacemethod_is_general..I.__call__srcyrr-rs r this_is_newzEInterfaceTests.test_interfacemethod_is_general..I.this_is_new rrN)rrrrrrsrr}rs)     rr}r)rrdrr"rrs @rtest_interfacemethod_is_generalz.InterfaceTests.test_interfacemethod_is_generalsA,2   4"% "-rN)7rrrrrrrrr rr%r6r?rDrMr[rfrvr|rrrrrrrrrrrrrrrrrrrr&r4rLrPrRr\rdrkrrrxrrrrrrrr-rrrr}s468>:,984B)5V="8*:.; FA2A07BrJ6,'8RD6,'8R/ -/2+ DA. ?4 =5 &<-M^3@jD"2:N2.=*F,-* $ # + ,12%(!4H, L*CX.rrc.eZdZdZdZdZdZdZdZy)AttributeTests TestAttributecddlm}|S)Nrr)r!r)r$rs rrIzAttributeTests._getTargetClass s 6rc|j}t||_t|}|j |j d||j |j dtzdz|y)N-)rMrrreprr startswithendswithrr$rrs rtest__repr__w_interfacez&AttributeTests.test__repr__w_interface s]: L  %TUWXY  3>4T#TUWXYrc|j}t|}|j|jd||j|j d|y)Nrz TestAttribute>)rMrrrrrs rtest__repr__wo_interfacez'AttributeTests.test__repr__wo_interface sG L  %TUWXY  #45q9rc|j}t||_t|}|j |t dzy)Nz.AttributeTests.TestAttribute)rMrrr7r"rrs rtest__str__w_interfacez%AttributeTests.test__str__w_interface! s8: K H'FFGrc^|j}t|}|j|dy)Nr)rMr7r"rs rtest__str__wo_interfacez&AttributeTests.test__str__wo_interface' s& K O,rN) rrrrKrIrrrrr-rrrr s""LZ: H -rrc^eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZy) MethodTests TestMethodcddlm}|S)Nrr])r!r^)r$r^s rrIzMethodTests._getTargetClass1 s 3 rc|j}|j|jiddi|_|j|jddi|`|j|jiyrb)rMr"rr$rs rtest_optional_as_propertyz%MethodTests.test_optional_as_property5 s] "- %. 5%.9 O "-rc ddlm}|j} ||jdy#|$rL}|j |j d|j |j |jYd}~yd}~wwxYw)Nr)BrokenImplementationz*__call__ should raise BrokenImplementation)rrrMrr"rrLrK)r$rrrs r)test___call___raises_BrokenImplementationz5MethodTests.test___call___raises_BrokenImplementation= smB D H IIB C $ 8   Q[[$ /   QVVT%6%6 7 7 8s1BAA==Bc:|j}|j}|jt|dg|jt|dg|j|di|j|dd|j|ddy)N positionalrequiredrvarargskwargs)rMgetSignatureInfor"rS)r$rinfos rtest_getSignatureInfo_barez&MethodTests.test_getSignatureInfo_bareH s&&( d<0126 d:./4 j)2. i$/ h.rcd|j}|j|jdy)Nz())rMr"rrs rtest_getSignatureString_barez(MethodTests.test_getSignatureString_bareQ s& 224d;rc|j}dgx|_|_|j|j dy)Nrcz(foo))rMrrr"rrs r'test_getSignatureString_w_only_requiredz3MethodTests.test_getSignatureString_w_only_requiredU s7/4g5FO 224g>rc|j}dgx|_|_ddi|_|j |j dy)Nrcr5z (foo='bar'))rMrrrr"rrs r"test_getSignatureString_w_optionalz.MethodTests.test_getSignatureString_w_optionalZ sB/4g5FO %. 224mDrcr|j}d|_|j|jdy)Nrz(*args))rMrr"rrs r!test_getSignatureString_w_varargsz-MethodTests.test_getSignatureString_w_varargs` s- 224i@rcr|j}d|_|j|jdy)Nrz(**kw))rMrr"rrs r test_getSignatureString_w_kwargsz,MethodTests.test_getSignatureString_w_kwargse s-  224h?rc|j}d|_t||_t |}|j |j d||j |jdtzdz|y)Nr*) rMrrrrrrrrrs rrz#MethodTests.test__repr__w_interfacej sd : L  %QRTUV  3>4T#TUWXYrc|j}d|_t|}|j|j d||j|j d|y)Nrrz TestMethod(**kw)>)rMrrrrrrs rrz$MethodTests.test__repr__wo_interfacer sN L  %QRTUV  #78!._func rrrrrrrrrrr"rPrRrrSrTrr$rrrs r test_barezTest_fromFunction.test_bare s u% )73 +6 ))40 f779:B?&&( d<0126 d:./4 j)2. i$/ h.rcddlm}Gdd|}d}|j||}|j|j|y)Nrrc eZdZy)0Test_fromFunction.test_w_interface..IFooNrr-rrrr rrrcyrr-r-rrrz1Test_fromFunction.test_w_interface.._func rrr)r!rrr"r)r$rrrrs rtest_w_interfacez"Test_fromFunction.test_w_interface s>; >  u5 ))40rcpd}|j|d}|j|jdy)Ncyrr-r-rrrz,Test_fromFunction.test_w_name.._func rr anotherName)rL)rr"rP)r$rrs r test_w_namezTest_fromFunction.test_w_name s0 u=9 )=9rcFd}|j|}|j}|jt|ddg|jt|ddg|j|di|j|dd|j|ddy)Ncyrr-rcs rrz5Test_fromFunction.test_w_only_required.._func rrrrcrrrrrrr"rSrs rtest_w_only_requiredz&Test_fromFunction.test_w_only_required s u%&&( d<01E7; d:./%9 j)2. i$/ h.rcJd d}|j|}|j}|jt|ddg|jt|dg|j|dddi|j|dd|j|ddy) Nr5cyrr-r s rrz0Test_fromFunction.test_w_optional.._func rrrrcrrrrr5r!rs rtest_w_optionalz!Test_fromFunction.test_w_optional s u%&&( d<01E7; d:./4 j)E5>: i$/ h.rcHd d}|j|d}|j}|jt|dg|jt|dg|j|di|j|dd|j|ddy) Ncyrr-rs rrz5Test_fromFunction.test_w_optional_self.._func rrrm)imlevelrrrrrr%r!rs rtest_w_optional_selfz&Test_fromFunction.test_w_optional_self s ua0&&( d<0126 d:./4 j)2. i$/ h.rcBd}|j|}|j}|jt|dg|jt|dg|j|di|j|dd|j|ddy)Ncyrr-)rs rrz/Test_fromFunction.test_w_varargs.._func rrrrrrrrr!rs rtest_w_varargsz Test_fromFunction.test_w_varargs s u%&&( d<0126 d:./4 j)2. i&1 h.rcBd}|j|}|j}|jt|dg|jt|dg|j|di|j|dd|j|ddy)Ncyrr-)rs rrz.Test_fromFunction.test_w_kwargs.._func rrrrrrrrr!rs r test_w_kwargszTest_fromFunction.test_w_kwargs s u%&&( d<0126 d:./4 j)2. i$/ h.rcNd d}|j|}|j}|jt|dddg|jt|ddg|j|dddi|j|dd |j|d d y) Nr6cyrr-)rcr5rrs rrz3Test_fromFunction.test_full_spectrum.._func rrrrcr5rrrrrrr6r!rs rtest_full_spectrumz$Test_fromFunction.test_full_spectrum s u%&&( d<01E5>B d:./%9 j)E5>: i&1 h.rN) rrrrrrrr"r&r*r-r0r4r-rrr r  s4) /1: / //$ / / /rr c$eZdZdZdZdZdZy)Test_fromMethodcddlm}||i|S)Nr) fromMethod)r!r8)r$rrr8s rrzTest_fromMethod._callFUT s74&2&&rcnGdd}|j|j}|j|jd|j|j d|j|j d|jt |jg|j}|jt |dg|jt |dg|j|di|j|dd|j|d dy) NceZdZdZy))Test_fromMethod.test_no_args..Foocyrr-rs rr5z-Test_fromMethod.test_no_args..Foo.bar rrNrr-rrrr; rJrrr5rrrrrr) rr5r"rPrRrrSrTrr$rrrs r test_no_argszTest_fromMethod.test_no_args s  sww' )51 +6 ))40 f779:B?&&( d<0126 d:./4 j)2. i$/ h.rcnGdd}|j|j}|j}|jt |dddg|jt |ddg|j|dddi|j|d d |j|d d y) NceZdZddZy)/Test_fromMethod.test_full_spectrum..Foocyrr-)r$rcr5rrs rr5z3Test_fromMethod.test_full_spectrum..Foo.bar rrNr3rr-rrrrA s rrrrcr5rrr6rrrr)rr5rr"rSr=s rr4z"Test_fromMethod.test_full_spectrum s  sww'&&( d<01E5>B d:./%9 j)E5>: i&1 h.rcLd}|j|}|j|jd|j|jd|j|jd|jt |j g|j}|jt |dg|jt |dg|j|di|j|dd|j|ddy) Ncyrr-r-rrrcz.Test_fromMethod.test_w_non_method..foo rrrcrrrrrrr)r$rcrrs rtest_w_non_methodz!Test_fromMethod.test_w_non_method s s# )51 +6 ))40 f779:B?&&( d<0126 d:./4 j)2. i$/ h.rN)rrrrr>r4rEr-rrr6r6 s'/ / /rr6ceZdZdZdZy)rncg|_yr)rrs rrzDummyDependent.__init__( s  rc:|jj|yr)rrR)r$originally_changeds rrzDummyDependent.changed+ s /0rN)rrrrrr-rrrnrn& s 1rrncddlm}t|dd}t|dd}|$t|t |r||kDs|dyyy)Nrrbrcr5r)rrcr#rrr)rrcrcr5s rrr/ sT1 #ud #C #ud #C :c495 SyAB B 6rcVddlm}t|ddrt|dds|dyy)Nrrbrcr5r)rrcr#)rrcs rrr; s11sE4 eT)B)***C rceZdZdZdZdZy)rc ||_|Dcic]}|t||c}|_|jD]\}}t |||ycc}wr)r%r# to_restoreitemssetattr)r$r%rkeyr0s rrz_Monkey.__init__C sR @BC3 44C((* (JC FC ' (DsAc|Srr-rs r __enter__z_Monkey.__enter__I s rcv|jjD]\}}t|j||yr)rNrOrPr%)r$exc_typeexc_valexc_tbrQr0s r__exit__z_Monkey.__exit__L s2////1 -JC DKKe , -rN)rrrrrSrXr-rrrrA s( -rr)rQunittestzope.interface.testsrrrrr`TestCaserr/rErrrrrr?rDr\rrrrr r6rnrrrr-rrr\s{16( (CX&&CB!9x((!9HE(8$$E(P9H$5$59<!:2!+5<+5\f5f5R*\?*\Z0.!**72H4E4E7>Z **Z z]1(++]1@L.X&&L.^$-\-BW0.W0tk/))k/\//h''//b11 C+ - -r