a dh@sddlZddlZddlZddlZddlmZddlZddlmZddlm Z ddl m Z m Z m Z mZmZmZmZmZmZmZmZmZGdddeZGdd d eZd d ZGd d d ejZedkredS)N) ALWAYS_EQ) is_instancemock) callDEFAULTpatchsentinel MagicMockMockNonCallableMockNonCallableMagicMock AsyncMock_Call _CallListcreate_autospecc@s(eZdZddZddZddZeZdS)ItercCstgd|_dS)NthisisZaniter)rthingselfr@/opt/imh-python/lib/python3.9/unittest/test/testmock/testmock.py__init__sz Iter.__init__cCs|SNrrrrr__iter__sz Iter.__iter__cCs t|jSr)nextrrrrrrsz Iter.nextN)__name__ __module__ __qualname__rrr__next__rrrrrsrc@s2eZdZdddZed ddZed ddZdS) SomethingNcCsdSrrrabcdrrrmeth zSomething.methcCsdSrr)clsr&r'r(r)rrrcmeth"szSomething.cmethcCsdSrrr&r'r(r)rrrsmeth%szSomething.smeth)N)N)N)r r!r"r* classmethodr- staticmethodr/rrrrr$s   r$cCsdSrrr&rrr something)r+r3c@sXeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[d\Z0d]d^Z1d_d`Z2dadbZ3dcddZ4dedfZ5dgdhZ6didjZ7dkdlZ8dmdnZ9dodpZ:dqdrZ;dsdtZdydzZ?d{d|Z@d}d~ZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^ddZ_ddZ`ddZaddZbdd„ZcddĄZdddƄZeddȄZfddʄZgdd̄Zhdd΄ZiddЄZjdd҄ZkddԄZlddքZmdd؄ZnddڄZodd܄ZpddބZqddZrddZsddZtddZuddZvddZwddZxddZyddZzddZ{ddZ|ddZ}ddZ~ddZddZddZddZddZddZddZddZd d Zd d Zd S(MockTestcCs tddS)Nzfrom unittest.mock import *)execrrrrtest_all.szMockTest.test_allcCst}||jd||jdd|t|jtd||jdd||j gd||j gd| d|j d | |jd | |jd ||jid dS) Nz called not initialised correctlyrz$call_count not initialised correctlyz&return_value not initialised correctlyz#call_args not initialised correctly(call_args_list not initialised correctlyz&method_calls not initialised correctlyZ_itemsz/default mock should not have '_items' attributez parent not initialised correctlyz!methods not initialised correctlyz$children not initialised incorrectly)r assertFalsecalled assertEqual call_count assertTruer return_value call_argscall_args_list method_calls assertNotIn__dict__ assertIsNone _mock_parent _mock_methods_mock_childrenrrrrrtest_constructor5s:      zMockTest.test_constructorcCstdd}||jddS)Nr=z(return value in constructor not honoured)r rCr=rGrrr test_return_value_in_constructorQs z)MockTest.test_return_value_in_constructorcCs*dd}t|}d|j_||ddS)NcSsdSrrrrrrfXr+z9MockTest.test_change_return_value_via_delegate..f)rrr=r:rrKrrrr%test_change_return_value_via_delegateWsz.MockTest.test_change_return_value_via_delegatecCsNdd}t|}t|j_|t|Wdn1s@0YdS)NcSsdSrrrrrrrK_r+z8MockTest.test_change_side_effect_via_delegate..f)r TypeErrorr side_effect assertRaisesrMrrr$test_change_side_effect_via_delegate^s   z-MockTest.test_change_side_effect_via_delegatecCstdd}|dt||dt|t|tdftdddfg}|D]\}}|d|t|j|d|t||d|t|j|d |t||d |t||d |t|jjjqNdS) Nfoonamez'%s'rbarz%s.barz%s.foo()z %s.foo().bingz%s()z%s()()z%s()().foo.bar.baz().bing)r assertInrepridrVrSZbingbaz)rrmocksrUrrr test_reprfs   zMockTest.test_reprcCsGdddt}t|d}|dt|t|d}|dt|t|d}|dt|t|d}|dt|t|dd}|dt||d t|tdd }|d t|t}|d t|tdgd}|d t|dS) Nc@s eZdZdS)z'MockTest.test_repr_with_spec..XNr r!r"rrrrXwsr^specz spec='X' spec_setz spec_set='X' rS)r`rUz name='foo' rTr`)objectr rWrXrArr^rrrrtest_repr_with_specvs$       zMockTest.test_repr_with_speccst}dd}||_|jt|dddd|jddddgdfdd}||_||||ggd d ttjd }||jtjd d d}t|tjd}||tjdS)Nc_s tddS)NZkablooie) SystemError)argskwargsrrreffectsz)MockTest.test_side_effect..effectrLfishrLrjrkcsSrpoprresultsrrrisrkrjrLzside effect not used correctlyrPz#side effect in constructor not usedcSstSrrrrrrrPsz.MockTest.test_side_effect..side_effect)rPr=) r rPrQrfassert_called_withr:r SideEffectRETURN)rrrirPrrqrtest_side_effects$   zMockTest.test_side_effectcsgdfdd}dd}t|}gd|_||||ggddgdt|}||_||||ggdddS) NrncsSrrorrqrrrisz2MockTest.test_autospec_side_effect..effectcSsdSrrrrrrrKr+z-MockTest.test_autospec_side_effect..fz1side effect not used correctly in create_autospecrsz'callable side effect not used correctly)rrPr:)rrirKrrrqrtest_autospec_side_effects  z"MockTest.test_autospec_side_effectcCs,dd}t|}td|_|td|dS)NcSsdSrrrrrrrKr+z7MockTest.test_autospec_side_effect_exception..fzBazinga!)r ValueErrorrPassertRaisesRegexrMrrr#test_autospec_side_effect_exceptions z,MockTest.test_autospec_side_effect_exceptioncCsRt}dg}td||d}|tjtjd|j}|tj|_|j}||| |j dd| |j |d| |j |d| |jd| |jd d | |jdd | |jgd | |jgd |jgf| |jg| |jtjd| |j|d| |jd| |jd|id| |j|d| |jjddS)Nr3child)rUparentr`r3zname incorrectly resetzparent incorrectly resetzmethods incorrectly resetzcalled not resetrzcall_count not resetzcall_args not resetzcall_args_list not resetz0method_calls not initialised correctly: %r != %rzside_effect incorrectly resetzreturn_value incorrectly resetzreturn value mock not resetzchildren reset incorrectlyzchildren incorrectly clearedzchild not reset)r r r$Z SomethingElser3rwrPr= reset_mockr: _mock_namerDrEr8r9r;r>r?r@ mock_callsrF)rrr`rr3r=rrrtest_reset_mocksV       zMockTest.test_reset_mockcCst}||_|dSr)r r=rrGrrrtest_reset_mock_recursionsz"MockTest.test_reset_mock_recursioncCst}|dSr)r mock_openrrr&rrr(test_reset_mock_on_mock_open_issue_18622sz1MockTest.test_reset_mock_on_mock_open_issue_18622cCs>t}|t|jtd|}|||d||tj}||jd||j dd||j tjfifd||j j tjfd||j j id||j tjfifgdtj|_|tjtjd}||tjd ||j d d||j tjfd tjifd||j tjfiftjfd tjifgd dS) Nz%Default return_value should be a Mockz'different result from consecutive callszcalled not setrLzcall_count incorrectzcall_args not setr7)keyzincorrect return valuerjrzcall_args_list not set)r r<rr=r:rr Argr9r;r>rgrhr?Z ReturnValueZKeyArg)rrresultZret_valrrr test_callsP     zMockTest.test_callc Cst}||tj|tjd|tjtjd||jdtjffdtjiftjfdtjifg||jtjfdtjif||jjtjf||jjdtji| |jdkdS)N)kwrrza long sequence) r r rZKwargr:r?r>rgrhr8rGrrrtest_call_args_comparison$s"   z"MockTest.test_call_args_comparisoncCs2t}|||k|||k||tk||tk||tjk||tjk|tj|k|tj|k||tk||tktt}ttj}|||k|||k|||k|||k||tk||tk||dk||dkdS)NrL)rr r<r8ANYrr)rZmmZcall1Zcall2rrrtest_calls_equal_with_any:s* z"MockTest.test_calls_equal_with_anycCsdt}|||t|jd||t|j|dddddd|jdddddddS)NrLrjrkrmZnothingr&r')r rvrQAssertionErrorrrGrrrtest_assert_called_withVsz MockTest.test_assert_called_withcCs t}|t|tjdSr)r rvrrrmrrrtest_assert_called_with_anyes z$MockTest.test_assert_called_with_anycCsd dd}t|d}|dddd|ddd|jdddd|jt|jdddd|t}|jd d Wdn1s0Y||jjtdS) NcSsdSrrr.rrrrKlr+z9MockTest.test_assert_called_with_function_spec..fr_rLrjrkr'r(r&r'r(e)N)r rvrQrassertIsInstance exception __cause__rOrrKrcmrrr%test_assert_called_with_function_specks    *z.MockTest.test_assert_called_with_function_speccszfdd}ttjd}||ttjd}||ttjd}||ttjd}||ttjd}||dS)NcsF|dddd|ddd|jddddjt|jdddddS)NrLrjrkrr)rvrQrrrrr_check|s  z._checkr_)r r$r*r-r/)rrrrrr#test_assert_called_with_method_spec{s   z,MockTest.test_assert_called_with_method_speccCsd}|t|dtWdn1s60Y|t|dtddWdn1sv0YdS)Nz"Expected '{0}' to have been calledrZ test_namerT)r|rformatr assert_called)rmsgrrr$test_assert_called_exception_messages (z-MockTest.test_assert_called_exception_messagecst|tj|tjddddjdddddddd|tfdddS)NrSrVrjrZcsjddddS)NbobrVrjrassert_called_once_withrrrrr+z7MockTest.test_assert_called_once_with..)r rrQrrrrrrtest_assert_called_once_withs z%MockTest.test_assert_called_once_withcs6tdd|ttdfdddS)NrLrjzCalls: [call(1), call(2)]cs dS)Nrjrrrrrrr+zAMockTest.test_assert_called_once_with_call_list..)r r|rreescaperrrr&test_assert_called_once_with_call_lists z/MockTest.test_assert_called_once_with_call_listcCsddd}t|d}|dddd|ddd|jdddd|jt|jdddd|t}|jd d Wdn1s0Y||jjt|d d d |t|jddd|t|jd d d dS)NcSsdSrrr.rrrrKr+z>MockTest.test_assert_called_once_with_function_spec..fr_rLrjrkrrrr)N)r rrQrrrrrOrrrr*test_assert_called_once_with_function_specs$    *   z3MockTest.test_assert_called_once_with_function_speccCsbt}|j}|t|td||j|dt}d|j_||dd||jjddS)Nzattribute isn't a mockz+different attributes returned for same namerkzmethod returned wrong valuez!method didn't record being called)r r3r<rr:r=r9rrr3rrr#test_attribute_access_returns_mockss  z,MockTest.test_attribute_access_returns_mockscCs0t}|j}||jdd||j|ddS)Nr3z attribute name not set correctlyz"attribute parent not set correctly)r r3r:rrDrrrr(test_attributes_have_name_and_parent_sets  z1MockTest.test_attributes_have_name_and_parent_setcCstt}|jddd|jjdtjd||jjdddtjifgd||jdd d difd ddtjifgddS) Nrkrlr)caker3)rrz#method calls not recorded correctly)rkrmzsomething_else.something)r r3something_elser ZCaker:r@rGrrrtest_method_calls_recordeds  z#MockTest.test_method_calls_recordedcCst}|||jdg||jddifgt}|d||jdg||jddifgt}|jdd||jdd difg||jddd difgt}|jdd d ||jddd d ifgdS) Nrr3r different)r3rrrLxrZmore)somer)r r3r:r@rGrrr test_method_calls_compare_easilys&    z)MockTest.test_method_calls_compare_easilyc CsHdgdfD]8}dD].}tfi||i}|j|tdt|dqq dS)Nr3r)r`rbz-Mock object has no attribute 'something_else'r)r r3r|AttributeErrorgetattr)rr`argrrrrtest_only_allowed_methods_existsz(MockTest.test_only_allowed_methods_existcs>Gdddt}fdd}|t|d|t|ddS)Nc@seZdZdZdZddZdS)z*MockTest.test_from_spec..SomethingrkNcSsdSrrrrrry r+z,MockTest.test_from_spec..Something.y)r r!r"r __something__rrrrrr$sr$cs:|j|j|jtdt|dtdt|ddS)Nz Mock object has no attribute 'z'zz)Mock object has no attribute '__foobar__'Z __foobar__)rrrr|rrrrrrtest_attributes"sz0MockTest.test_from_spec..test_attributesr_)rcr )rr$rrrrtest_from_specs zMockTest.test_from_speccCsJt}t|d}|||||dddd|jdddddS)NwrapsrLrjrkrl)r r:rrvrrealrrrrtest_wraps_calls6s  zMockTest.test_wraps_callscs8Gdddt}|}t|d|tfdddS)Nc@s eZdZdS)zFMockTest.test_wraps_prevents_automatic_creation_of_mocks..RealNr]rrrrRealCsrrcsSr)Znew_attrrrrrrIr+zJMockTest.test_wraps_prevents_automatic_creation_of_mocks..)rcr rQr)rrrrrr/test_wraps_prevents_automatic_creation_of_mocksBs z8MockTest.test_wraps_prevents_automatic_creation_of_mockscCs4t}t|d}d|_||d||jdS)Nrrk)r r=r:r8r9rrrr,test_wraps_call_with_nondefault_return_valueLs  z5MockTest.test_wraps_call_with_nondefault_return_valuecsGdddt}|}t|d|||tfdd|j|jjjdddd }|jjjdddd |||jdS) Nc@seZdZeZdS)z,MockTest.test_wraps_attributes..RealN)r r!r"r attributerrrrrWsrrcsjSrrlrrrrr^r+z0MockTest.test_wraps_attributes..rLrjrkrl) rcr r:rrQrassertNotEqualZfrogrv)rrrrrrrtest_wraps_attributesVs zMockTest.test_wraps_attributescCsdGdddt}|}t|d}tjtg|j_||tj||tj| t |jdS)Nc@seZdZddZdS)z[MockTest.test_customize_wrapped_object_with_side_effect_iterable_with_default..RealcSstjSr)r ORIGINAL_VALUErrrrmethodhszbMockTest.test_customize_wrapped_object_with_side_effect_iterable_with_default..Real.methodNr r!r"rrrrrrgsrr) rcr r VALUE1rrrPr:rrQ StopIterationrrrrrrrDtest_customize_wrapped_object_with_side_effect_iterable_with_defaultfs zMMockTest.test_customize_wrapped_object_with_side_effect_iterable_with_defaultcCsfGdddt}|}t|d}tjtjg|j_||tj||tj|t |jdS)Nc@seZdZddZdS)zNMockTest.test_customize_wrapped_object_with_side_effect_iterable..RealcSsdSrrrrrrrvr+zUMockTest.test_customize_wrapped_object_with_side_effect_iterable..Real.methodNrrrrrrusrr) rcr r rVALUE2rrPr:rQrrrrr7test_customize_wrapped_object_with_side_effect_iterablets z@MockTest.test_customize_wrapped_object_with_side_effect_iterablecCs:Gdddt}|}t|d}t|j_|t|jdS)Nc@seZdZddZdS)zOMockTest.test_customize_wrapped_object_with_side_effect_exception..RealcSsdSrrrrrrrr+zVMockTest.test_customize_wrapped_object_with_side_effect_exception..Real.methodNrrrrrrsrr)rcr RuntimeErrorrrPrQrrrr8test_customize_wrapped_object_with_side_effect_exceptions  zAMockTest.test_customize_wrapped_object_with_side_effect_exceptioncCsFGdddt}dd}|}t|d}||j_||tjdS)Nc@seZdZddZdS)zNMockTest.test_customize_wrapped_object_with_side_effect_function..RealcSsdSrrrrrrrr+zUMockTest.test_customize_wrapped_object_with_side_effect_function..Real.methodNrrrrrrsrcSstjSr)r VALUErrrrrPszUMockTest.test_customize_wrapped_object_with_side_effect_function..side_effectr)rcr rrPr:r r)rrrPrrrrr7test_customize_wrapped_object_with_side_effect_functions  z@MockTest.test_customize_wrapped_object_with_side_effect_functioncCs@Gdddt}|}t|d}tj|j_||tjdS)Nc@seZdZddZdS)zFMockTest.test_customize_wrapped_object_with_return_value..RealcSsdSrrrrrrrr+zMMockTest.test_customize_wrapped_object_with_return_value..Real.methodNrrrrrrsrr)rcr r rrr=r:rrrr/test_customize_wrapped_object_with_return_values   z8MockTest.test_customize_wrapped_object_with_return_valuecCspGdddt}|}t|d}tjtjg|j_tj|j_| |tj| |tj| t |jdS)Nc@seZdZddZdS)zVMockTest.test_customize_wrapped_object_with_return_value_and_side_effect..RealcSsdSrrrrrrrr+z]MockTest.test_customize_wrapped_object_with_return_value_and_side_effect..Real.methodNrrrrrrsrr) rcr r rrrrPZ WRONG_VALUEr=r:rQrrrrr?test_customize_wrapped_object_with_return_value_and_side_effects  zHMockTest.test_customize_wrapped_object_with_return_value_and_side_effectcCsLGdddt}|}t|d}dd|j_tj|j_||tjdS)Nc@seZdZddZdS)zWMockTest.test_customize_wrapped_object_with_return_value_and_side_effect2..RealcSsdSrrrrrrrr+z^MockTest.test_customize_wrapped_object_with_return_value_and_side_effect2..Real.methodNrrrrrrsrrcSstSrrurrrrrr+z[MockTest.test_customize_wrapped_object_with_return_value_and_side_effect2..)rcr rrPr rr=r:rrrr@test_customize_wrapped_object_with_return_value_and_side_effect2s    zIMockTest.test_customize_wrapped_object_with_return_value_and_side_effect2cCsnGdddt}|}t|d}tjtg|j_tj|j_| |tj| |tj| t |jdS)Nc@seZdZddZdS)z^MockTest.test_customize_wrapped_object_with_return_value_and_side_effect_default..RealcSsdSrrrrrrrr+zeMockTest.test_customize_wrapped_object_with_return_value_and_side_effect_default..Real.methodNrrrrrrsrr) rcr r rrrrPrxr=r:rQrrrrrGtest_customize_wrapped_object_with_return_value_and_side_effect_defaults  zPMockTest.test_customize_wrapped_object_with_return_value_and_side_effect_defaultcCsddi}t|d}||dd||dt|d|vd|j_||ddtj|j_||dd||dd||dt|d|vd|d<||dd||dt|d|v|d=||dddS)NrSrVrr=rZspam)r r:getrr8r=r r)rdataZ wrapped_dictrrrtest_magic_method_wraps_dicts$  z%MockTest.test_magic_method_wraps_dictcCsTGddd}t|d}|}||dd||dd||ddS)Nc@seZdZddZddZdS)z3MockTest.test_magic_method_wraps_class..FoocSs|Srr)rindexrrr __getitem__sz?MockTest.test_magic_method_wraps_class..Foo.__getitem__cSsdSNrSrrrrr__custom_method__szEMockTest.test_magic_method_wraps_class..Foo.__custom_method__N)r r!r"rrrrrrFoosrrrjrS)r r:rr)rrklassobjrrrtest_magic_method_wraps_classs  z&MockTest.test_magic_method_wraps_classcCs4ttd}|t|ttdd}|t|dSNrtrS)r rrQrGrrrtest_exceptional_side_effects  z%MockTest.test_exceptional_side_effectcCs4ttd}|t|ttdd}|t|dSr)r KeyboardInterruptrQrGrrr test_baseexceptional_side_effect s  z)MockTest.test_baseexceptional_side_effectcCst}|td|jdS)Nz not called)r r|rrvrGrrrtest_assert_called_with_messagesz(MockTest.test_assert_called_with_messagecCstdd}|td|jdS)NZgeoffreyrTz'Expected 'geoffrey' to be called once\.)r r|rrrGrrr$test_assert_called_once_with_messages  z-MockTest.test_assert_called_once_with_messagecs2t|tfddd_|jddS)NcsjSr)r rrrrr r+z'MockTest.test__name__..rS)r rQrr r:rrrr test__name__szMockTest.test__name__cCsJGdddt}t|dgd}|d|jd|tt|ddS)Nc@s eZdZdS)z-MockTest.test_spec_list_subclass..SubNr]rrrrSub'srrSr_rk)listr appendrvrQrr)rrrrrrtest_spec_list_subclass&s   z MockTest.test_spec_list_subclasscCsGdddt}t|d}|||t|d}|||||j||tjjdt|d}|||t|d}|||dS)Nc@s eZdZdS)z#MockTest.test_spec_class..XNr]rrrrr^1sr^r_r ra)rcr rassertIs __class__r:r rdrrrtest_spec_class0s       zMockTest.test_spec_classcCsGddd}t|d}|||t|d}|||||j||tjjdt|d}|||t|d}|||dS)Nc@s eZdZdS)z2MockTest.test_spec_class_no_object_base..XNr]rrrrr^Esr^r_r ra)r rrrr:r rdrrrtest_spec_class_no_object_baseDs       z'MockTest.test_spec_class_no_object_basecsLGdddt}t|dd_t|dfdd}d_|t|dS)Nc@seZdZdZdS)z8MockTest.test_setting_attribute_with_spec_set..XrkN)r r!r"rrrrrr^Ysr^r_rSracs d_dSrrrrrrset_attr`sz?MockTest.test_setting_attribute_with_spec_set..set_attr)rcr rrrQr)rr^rrrr$test_setting_attribute_with_spec_setXs   z-MockTest.test_setting_attribute_with_spec_setcCs4t}|tj|ttdttdS)NgeA)sysgetrecursionlimit addCleanupsetrecursionlimitintcopyr )rcurrentrrr test_copygszMockTest.test_copycs\Gdddt}||d|jdfdd}|t|fdd}|t|dS)Nc@s&eZdZddZddZeeeZdS)z8MockTest.test_subclass_with_properties..SubClasscSsdSNrkrrrrr_getssz=MockTest.test_subclass_with_properties..SubClass._getcSs tddS)Nz strange error) NameError)rvaluerrr_setusz=MockTest.test_subclass_with_properties..SubClass._setN)r r!r"r rpropertysome_attributerrrrSubClassrsrrarkcs d_dSr )rrsrrtest|sz4MockTest.test_subclass_with_properties..testcs d_dS)NrVrSrrrrrs)r r:rrQrr)rrrrrrtest_subclass_with_propertiesqs    z&MockTest.test_subclass_with_propertiescCs>t}dd}|t|_|d|d|t|dddS)NcSs||||Sr)Z_increment_mock_callZ _mock_callrrrr__call__s z,MockTest.test_setting_call..__call__onetwo)r typerrvrQrO)rrrrrrtest_setting_calls   zMockTest.test_setting_callcCst}tt|}tddttD}|t|||j|jf|dt||dt|d|_|_|dt||dt|dd|_ |d t|dS) NcSsg|]}|ds|qS)_) startswith).0rrrr r+z%MockTest.test_dir..r&r'r(r)cSstgSr)rrrrrrr+z#MockTest.test_dir..r) r setdirr:r&r'rWr(r)r)rrattrs type_attrsrrrtest_dirs    zMockTest.test_dircCsXttjd}tttj}tt|}|t||d|_|t|dddS)Nr_rkversionrL)r unittestTestCaser"r#r:r'count)rrZtestcase_attrsr$rrrtest_dir_from_specs   zMockTest.test_dir_from_speccCs^ttdd}|z8ttt}ttt}|t||W|n |0dS)NZ FILTER_DIRF) rrcrstartr"r#r r:stop)rZpatcherr$r%rrrtest_filter_dirs zMockTest.test_filter_dircCs6t}d|j_|dt||`|dt|dS)NrLr~)r r~r=rWr#rArGrrr,test_dir_does_not_include_deleted_attributess z5MockTest.test_dir_does_not_include_deleted_attributescCstdd}||jdtdd}||jdtdtd}tfi|}|t|||jd||jtt}|jfi||t|||jd||jtdS)NrVr!)rPzfoo.bar.return_valuerS) r r:rSr KeyErrorrQrVrZconfigure_mock)rrrhrrrtest_configure_mocks     zMockTest.test_configure_mockcOsR||}||i|Wdn1s.0Yt|j}|||dSr)rQstrrr:)rrmessagefuncrgrhcontextrrrrassertRaisesWithMsgs , zMockTest.assertRaisesWithMsgc Cst}d}d}d}|jt|||f|jddddd|jddddd |jj|jjg}|D]0}d }d }d}|jt|||f|dddddqZ|D]*}d }d }d}|jt|||f|ddq|D],}d }d }d}|t|||f|dddq|D]&}d }d}d}|t|||f|qdS)Nz not called.zmock(1, '2', 3, bar='foo')z0expected call not found. Expected: %s Actual: %srL2rkrS)rVrzfoo(1, '2', 3, foo='foo')zfoo(1, '2', 3, bar='foo')zfoo(bar='foo')z foo(1, 2, 3)rjzfoo())r r7rrvrSr)rractualexpectedr4Z assertersr*rrr'test_assert_called_with_failure_messagesT       z0MockTest.test_assert_called_with_failure_messagec Cst}||jgkdt}|ddifg}||j|||t||j|||jjddifgt}|jdddddd ddifd d tddd fg}||j|||jjjdd tddd fg||jjd d tddd fgt}|j ddifd difddifg}||j|||jtj ttddfD]8}tfi|}t |jddifg}||j|tfi|}| ddifddifg}||j||| jtgtfi|}|ddd||jtddd ||jtdd ||jtd tfi|}|dddj jd||jtdddj jd ||jtddj jd ||jtdj jd tfi|}t |j ddif}||jd|||jtj  ||j jt  ||j j jt qpdS)NTrrLrjrkrrrz().foornrSz ().foo.barz().foo.bar().bazrVrTz foo.__int__r&za()z().foo.bar().baz().__int__)r rrr:rSrrdictr=rVrZ call_listrr&r'r(__int__)rrr:rhZ last_callrrrtest_mock_calls!s            zMockTest.test_mock_callscCsFt}|}|||jttg||jtgdSr)r Zwibbler:rr)rrrrrrtest_child_mock_call_equalos z#MockTest.test_child_mock_call_equalcCsFt}|||jdt||jdtdSNrLr)r rSr3rrrrr:rrrrtest_mock_call_not_equal_leafys z&MockTest.test_mock_call_not_equal_leafcCsFt}|||jdt||jdtdSrCr rSrVrrrrZrrrr!test_mock_call_not_equal_non_leafs z*MockTest.test_mock_call_not_equal_non_leafcCs8t}|jdd||jdtjdddS)NrLrrj)r rSrVr:rrrrrr2test_mock_call_not_equal_non_leaf_params_differentsz;MockTest.test_mock_call_not_equal_non_leaf_params_differentcCs,t}|j||jdtjdSNrrErrrr&test_mock_call_not_equal_non_leaf_attrs z/MockTest.test_mock_call_not_equal_non_leaf_attrcCs.t}|j||jdtdSrH)r rSrVrrrrrrr2test_mock_call_not_equal_non_leaf_call_versus_attrs z;MockTest.test_mock_call_not_equal_non_leaf_call_versus_attrcCs^t}|j|t|jdd|t|jdd|t|jdddS)Nrz call.foo()rLzcall.foo().bar()rjzcall.foo().bar().baz.bob())r rSrVrZrr:rXrrrrrtest_mock_call_reprs zMockTest.test_mock_call_reprcCs0t}||_t||t|ddS)Nz)r rSrXZ assertRegexrrrrtest_mock_call_repr_loops z!MockTest.test_mock_call_repr_loopcCst}|tg|jvdSr)r r8rrrrrrtest_mock_calls_containssz!MockTest.test_mock_calls_containscCshGdddt}|}||j||||Gdddt}|}||j||||dS)Nc@s eZdZdS)+MockTest.test_subclassing..SubclassNr]rrrrSubclasssrOc@seZdZddZdS)rNc[stfi|Sr)r )rrhrrr_get_child_mocksz;MockTest.test_subclassing..Subclass._get_child_mockN)r r!r"rPrrrrrOs)r rrSassertNotIsInstance)rrOrrrrtest_subclassingszMockTest.test_subclassingcsttttg}fdd}|D]z}||t|rb||dd|dd|||||jjddd|dd|||q$dS)Ncs@d}|D]2}t||}|t|t|gqdS)N)r?r@r)rrrrr:)rnamesrUattrrrr assert_attrss    z-MockTest.test_arg_lists..assert_attrsrLrjrkr2) r r r r callablerrSrVrZ)rr[rUrrrrtest_arg_listss&   zMockTest.test_arg_listscCst}|ddd|ddd|t|jd||jjd||jjtdddtddfdtddfg}t||jD]@\}}|t|d||d |d ||d|dq~dS) NrLrkr2rjrr')rjrLr) r r:lenr>rgrhr>zipr?)rrZ expected_listr:r>rrrtest_call_args_two_tuples  z!MockTest.test_call_args_two_tuplecCsttgdd}||||ggd|t|tgdd}||||ggd|t|tdd}||||ggd|t|Gdddt}t|d}|||ttd}|||||ggd|t|dS) NrnrtrZghi)ghic@s eZdZdS)z/MockTest.test_side_effect_iterator..FooNr]rrrrrsrr) r rr:rQrr rcrr)rrrrrrtest_side_effect_iterators"      z"MockTest.test_side_effect_iteratorcCs\ttfD]N}tdtdf}||d}|t|||d|t|||dqdS)Nrkrrt)r r r{r1rQr:)rKlassiterablerrrr$test_side_effect_iterator_exceptions s     z-MockTest.test_side_effect_iterator_exceptionscCst}tgd|_||||ggd|t||j}||ttggd|_||||ggd|t||j}||ttgt}||_|||||ggd|t|| |j|dS)Nrnrr) r rrPr:rQrrrrr)rrrPZ this_iterrrr!test_side_effect_setting_iterators$    z*MockTest.test_side_effect_setting_iteratorcCs4tdd}tdtg|_|||gddgdS)NrjrIrL)r rrrPr:rGrrr!test_side_effect_iterator_default)s z*MockTest.test_side_effect_iterator_defaultc Cst}|dd|dd|dd|dd|ddtddddifd d ddifd d ddifd d ifd d ddifg}|D]}|j|gddq|tddtddtdddfD]}|jt|j|gddqtddtddgtddtddgtddtddgg}|D]}|j|ddq tddtddtddgtddtddgtddtddtddgtddtddtddtddtddgg}|D]}|jt|j|ddqdS)NrLrjrkr2rrrXr&)rkrr)r<rLrjr<rgTZ any_orderr8rSr)r rassert_has_callsrQr)rrkallskallZ kall_listsZ kall_listrrrtest_assert_has_calls_any_order.sD       "*z(MockTest.test_assert_has_calls_any_orderc Cstddddifdtdddd d difg}ttdg}|tjdd |tjtid  dgg}t t fD]F}|dd|dd |dd |dd|ddd| ||fqt }||d|jdd |jtid  dg| ||f|D]j\}}t t|D]R}dD]F}||||}||t|dkr>|t|jtt|q>q6q"dS)NrLrjr&rkrfrrXr<rYr'r2rrrn)rrSrVextendrrZr?Zbamr"rmr r rrangerZrjrQrrreversed) rZkalls1Zkalls2r[rrkr_stepZtheserrrtest_assert_has_callsZs@  "         zMockTest.test_assert_has_callsc CsFGddd}t|}||fD]H}|jddddd|tjdddddg|tddddgq |||fD]l}|t|jtg|ddd|tdtdddg|jtdtddgq||tdt dt dtddddg}|D]}|t|j|gq(dS)Nc@s,eZdZddZdddZGdddZdS) z=MockTest.test_assert_has_calls_nested_spec..SomethingcSsdSrrrrrrrr+zFMockTest.test_assert_has_calls_nested_spec..Something.__init__NcSsdSrrr%rrrr*r+zBMockTest.test_assert_has_calls_nested_spec..Something.methc@seZdZddZddZdS)zAMockTest.test_assert_has_calls_nested_spec..Something.FoocSsdSrrrrrrrr+zJMockTest.test_assert_has_calls_nested_spec..Something.Foo.__init__cSsdSrr)rr&r'rrrmeth1r+zGMockTest.test_assert_has_calls_nested_spec..Something.Foo.meth1N)r r!r"rrsrrrrrsr)N)r r!r"rr*rrrrrr$s r$rLrjrkr)r) rr*rjrrrQrrrsZ non_existent)rr$Z mock_classrZ invalid_callsrlrrr!test_assert_has_calls_nested_specs. "  z*MockTest.test_assert_has_calls_nested_speccCsJt}||t}| |dSr) r rSrVrZrrthreerr?rj)rrcallsrrr)test_assert_has_calls_nested_without_specs z2MockTest.test_assert_has_calls_nested_without_speccCsddd}t|d}|dddd|dd d d d |d dddddifdddd ifdifg}|||j|dd||dd|j|dddd||dd|j|ddddtt|}|t||Wdn1s0Y|j|dd|t"||ddWdn1sH0Y|j|dddd|t"||ddWdn1s0Y|j|dddddS)NcSsdSrrr.rrrrKr+z.fr_rLrjrkrrrrrir(r) )r(r<rn)rrrr))rzr{r|Trhr=)N)r rjrrprQr)rrKrrwrrr(test_assert_has_calls_with_function_specs2      ( 2 2z1MockTest.test_assert_has_calls_with_function_speccCsd dd}t|d}|d|tdtd}|tgWdn1sX0Y||j j |tdtd&}|ttddgWdn1s0Y| |j j t dS) NcSsdSrrrrrrrKr+zAMockTest.test_assert_has_calls_not_matching_spec_error..fr_rLz^{}$z5Calls not found. Expected: [call()] Actual: [call(1)]zError processing expected calls. Errors: [None, TypeError('too many positional arguments')] Expected: [call(), call(1, 2)] Actual: [call(1)]rj)N) r r|rrrrrjrrCrrrrOrrrr-test_assert_has_calls_not_matching_spec_errors.  ,4z6MockTest.test_assert_has_calls_not_matching_spec_errorcCst}|dd|dd|ddd|dd|jdd|jddd|t|j|t|jdd|jt|jdddS)NrLrjrkr2rrXr)r assert_any_callrQrrGrrrtest_assert_any_calls*     zMockTest.test_assert_any_callcCsddd}t|d}|dddd|dd d d d |ddd|jdddd |dd d d |jdd d d d|jt|jdddd|t}|jddWdn1s0Y||jjtdS)NcSsdSrrr.rrrrKr+z;MockTest.test_assert_any_call_with_function_spec..fr_rLrjrkrrrrriryrr.rr)N)r rrQrrrrrOrrrr'test_assert_any_call_with_function_specs    *z0MockTest.test_assert_any_call_with_function_speccCsfdd}t}||_t|t|jg}|D]6}|dd|dd||jtddtddgq*dS)NcSsdSrrrrrrrKr+z3MockTest.test_mock_calls_create_autospec..frLrjrkr)rrKrr:rr)rrKrZfuncsr5rrrtest_mock_calls_create_autospecs  z(MockTest.test_mock_calls_create_autospeccCs$tjtdd}|dt|dS)NZ sweet_funcrT)rrrcrWrXrrrrtest_create_autospec_with_name+sz'MockTest.test_create_autospec_with_namec CstGddd}dD]\}|j|d<tt||}|||t|dWdq1sd0YqdS)Nc@s$eZdZeddZeddZdS)zMMockTest.test_create_autospec_classmethod_and_staticmethod..TestClasscSsdSrr)r,rrr class_method2szZMockTest.test_create_autospec_classmethod_and_staticmethod..TestClass.class_methodcSsdSrrrrrr static_method5sz[MockTest.test_create_autospec_classmethod_and_staticmethod..TestClass.static_methodN)r r!r"r0rr1rrrrr TestClass1s r)rr)rZ extra_arg)ZsubTestrrrrrQrO)rrrZ mock_methodrrr1test_create_autospec_classmethod_and_staticmethod0sz:MockTest.test_create_autospec_classmethod_and_staticmethodcCst}d}|t||Wdn1s40Y|t||Wdn1sh0Ytdd}||dS)Nz1Attributes cannot start with 'assert' or 'assret'T)Zunsafe)r r|rZassert_foo_callZassret_foo_call)rrrrrrtest_mock_unsafe?s&& zMockTest.test_mock_unsafecCsPt}|j||t|jWdn1sB0YdSr)r helloassert_not_calledrQrrrrrtest_assert_not_calledKs   zMockTest.test_assert_not_calledcCs*t}|dd|ttd|jdS)NrLrjzCalls: [call(1, 2)])r r|rrrrrrrrtest_assert_not_called_messageRs  z'MockTest.test_assert_not_called_messagecCsbt}|t|jWdn1s00Y||j||jdSr)r rQrrrrrrrtest_assert_calledYs ( zMockTest.test_assert_calledcCst}|t|jWdn1s00Y||j||t|jWdn1s~0YdSr)r rQrrassert_called_oncerrrrtest_assert_called_oncecs (  z MockTest.test_assert_called_oncecCs2t}|dd|d|ttd|jdS)NrLrjrkzCalls: [call(1, 2), call(3)])r r|rrrrrrrrtest_assert_called_once_messagens z(MockTest.test_assert_called_once_messagecCsNt}|t}|Wdn1s.0Y|dt|jdS)NzCalls:)r rQrrrAr3r)rrrrrr*test_assert_called_once_message_not_calledvs &z3MockTest.test_assert_called_once_message_not_calledcCs0t}|jdddd}|t|jj|dS)NrZhero)rUZdaddyz call(name='hello', daddy='hero'))r rr:rXr>)rrtextrrrtest_ordered_call_signature}sz$MockTest.test_ordered_call_signaturecCsVt}tdd}t}||dd||jd|||jd|dS)NrrrL)rr*rr r:r@)rr(r_rrrrtest_override_tuple_methodss  z$MockTest.test_override_tuple_methodscCs>tdddgd}|jddd||jt||jddS)Nrzrjrkr=rPT)r rrr=r:rPrrrrtest_reset_return_sideeffectsz%MockTest.test_reset_return_sideeffectcCs<tdddgd}|jdd||jt||jddS)NrzrjrkrTrI)r rrr=rrPrrrrtest_reset_returns zMockTest.test_reset_returncCs<tdddgd}|jdd||jd||jddS)NrzrjrkrTrt)r rr:r=rPrrrrtest_reset_sideeffects zMockTest.test_reset_sideeffectcCs@ttddd}||d|jdd||ddS)NrLrIrKT)r r:rKrrrrrrtest_reset_return_with_childrens z(MockTest.test_reset_return_with_childrencCsDttddgdd}||jjd|jdd||jjddS)NrjrkrtrT)r rrKrPrr:rrrr+test_reset_return_with_children_side_effects z4MockTest.test_reset_return_with_children_side_effectc sGdddt}Gdddt}Gdddtttttg}t|D]0}||ffdd ||ffd d qD|D] }ttd d fD]}|}|j|j |j f||fd gd gffD]\}}ttd d fD]}|j |fi||j| t t|d | t t|dd|vr.| t t|dd|j |fi|| t t|d |j | t t|dd|vr| t t|ddqqqqzdS)Nc@seZdZdZdS)z)MockTest.test_mock_add_spec.._OnerLN)r r!r"rrrrr_Onesrc@seZdZdZdS)z)MockTest.test_mock_add_spec.._TworjN)r r!r"rrrrr_Twosrc@seZdZdZZZdS)z-MockTest.test_mock_add_spec..AnythingZfourN)r r!r"rrrvrrrrAnythingsrcs |dS)Nr_rKrrrrr+z-MockTest.test_mock_add_spec..cs |dS)Nrarrrrrrr+Trarrrvrb)rcr r r r rrr>rrrv mock_add_specrQrrsetattr) rrrZklassesrarhrZOneZTworrrtest_mock_add_specsL     zMockTest.test_mock_add_speccs|ttfD]n}|tt|tt|ddj_t| td|tfddqdS)NrSrcsdSrrrrrrrr+z;MockTest.test_mock_add_spec_magic_methods..) r r rrrcrQrOr@r=r:)rrarrr test_mock_add_spec_magic_methodss   z)MockTest.test_mock_add_spec_magic_methodscCstttttfD]}|}t|_|||jtg||j tg|}tdd|_ | ||jg||j g|}t|_ | ||jg||j gqdS)NrUrT) r r r r rrSr:r@rrrVrZrrarrrrtest_adding_child_mocks$  zMockTest.test_adding_child_mockcCs@ttfD]2}|}t|_|||jttgqdSr)r r r=r:rrrrrrtest_adding_return_value_mock s  z&MockTest.test_adding_return_value_mockcCsGdddt}t}t|d}t|d}|}||j|}||j||d||d||| |j t t gdS)Nc@seZdZdZdZdS)z'MockTest.test_manager_mock..FoorrN)r r!r"rrrrrrrsrrr) rcr rr,rr- attach_mockrrr:rr)rrmanagerZp1Zp2Zmock_oneZmock_tworrrtest_manager_mocks      zMockTest.test_manager_mockcCshttfD]Z}|}tdd|_tdd|_t|t|||jttg||j gqdS)NrkrIg@) r r r@ __float__rfloatr:rrr@)rrarrrrtest_magic_methods_mock_calls)s   z&MockTest.test_magic_methods_mock_callscCs<tjdd}|d}|}|d}|}|||dS)NrZ read_dataa-namez another-name)rrreadr:)r mocked_openf1Zf1_dataf2Zf2_datarrr test_mock_open_reuse_issue_217504s  z)MockTest.test_mock_open_reuse_issue_21750cCsVtjdd}|d}dd|D}||dd||dd |t|gdS) NzRemarkable Norwegian BluerrcSsg|]}|qSrrr linerrrr!Ar+z=MockTest.test_mock_open_dunder_iter_issue..rz Remarkable rLzNorwegian Blue)rrr:r)rrrlinesrrr test_mock_open_dunder_iter_issue<s  z)MockTest.test_mock_open_dunder_iter_issuecCstjdd}|d}t|}|}dd|D}||d||d||dd |t|g|tt|Wdn1s0YdS) Nz1st line 2nd line 3rd linerrcSsg|]}|qSrrrrrrr!Kr+z6MockTest.test_mock_open_using_next..z 1st line z 2nd line rz3rd line)rrrr#r:rrQr)rrrZline1Zline2rrrrtest_mock_open_using_nextFs    z"MockTest.test_mock_open_using_nextcCs,tjdd}d|jj_|dt|dS)Nfoo barnrabc)rrr=readliner:r)rmopenrrr3test_mock_open_next_with_readline_with_return_valueSs  z.attempt) rrr rr=rOSErrorrPrQ)rZmock_namedtempZmock_filehandleZ mock_writerrrrtest_mock_open_writeXs zMockTest.test_mock_open_writecCsJtjdd}dd|jj_|}|}|d||d|dS)NrrcWsdS)Nrr)rgrrrrer+z8MockTest.test_mock_open_alter_readline..r)rrr=rrPr:)rrfirstsecondrrrtest_mock_open_alter_readlinecs     z&MockTest.test_mock_open_alter_readlinecCstjdd}|d}||d||d||d||d||g||g|dS)NrSrrVr<)rrrr:r readlines)r_openr^rrrtest_mock_open_after_eofks z!MockTest.test_mock_open_after_eofcCs ttfD]}|}t|}||_||||t|||||||t|||}|j|_| dt|j| dt|j|| dt|j| dt|j|}t|}||_||j_|t|||t||qdS)Nz name='mock.a') r r rXr=rr:rr&r'rW)rrarZ original_reprrrrtest_mock_parentsws, zMockTest.test_mock_parentscCsttttf}|D]}|D]z}|}|dd}||d||j||dt||j d| |j t j dg| |j t j dgqqdS)NrSrTrVzname='mock.bar'rL)r r r r rrrVrWrXrZr:rrr@rclassesraZKlass2rZm2rrrtest_attach_mocks    zMockTest.test_attach_mockcCsttttf}ttfD]h}|D]^}|}|dd}||d||||dt||| |j t  qqdS)NrSrTr=z name='mock()') r r r r rrrWrXrSr:rrr?rrrrtest_attach_mock_return_values    z&MockTest.test_attach_mock_return_valuecCst}tjtddd}||jd||d|dtd|dt dt dt dg}t dt dt dg}||j |||jj ||tj |||j || d t |jj||jd Wdn1s0YdS) N .somethingTZautospecr3r~rLrjrk mock.child) r rrr r:Z_extract_mock_namerr~r3rrrWrX)rrZ mock_funcZ parent_callsZ child_callsrrrtest_attach_mock_patch_autospecs  z(MockTest.test_attach_mock_patch_autospecc Cstjtddd}t}||dt}|jddddd |tj tj ddddd g|jttj ddddd g|ttj ddddd gWdn1s0Ytjtd dd\}t}||d t d|t dgt tdg|tdgWdn1s.0Ytjtd dd}t}||d t}|jddddd |t t jddddd g|jtddddd g|ttjddddd gWdn1s0YdS)Nz.Something.methTr attach_methrLrjrkrrtr attach_funcz .Something attach_obj)rrr r rr$r*rjrrrr3rr)rZmockedrrrrr)test_attach_mock_patch_autospec_signatures2 : 0  z2MockTest.test_attach_mock_patch_autospec_signaturecCsfttttfD]L}|t|d|`|t|d|`|t|d| t t |dqdS)NrrK) r r r r r<hasattrrr8rKrQrrrGrrrtest_attribute_deletions z MockTest.test_attribute_deletioncCsttttfD]t}d|_|t|d||jd|`|t|dd|_|t|d||jd|`|t|dqdS)NrkrSr) r r r r rSr<rr:r8rGrrr7test_mock_does_not_raise_on_repeated_attribute_deletions z@MockTest.test_mock_does_not_raise_on_repeated_attribute_deletionc CsPttttfD]6}|`|t|`Wdq1s@0YqdSr)r r r r rSrQrrGrrr4test_mock_raises_when_deleting_nonexistent_attributes   z=MockTest.test_mock_raises_when_deleting_nonexistent_attributecCs,t}d|_|`||t|ddS)NTr~)r r~rr8rrGrrr/test_reset_mock_does_not_raise_on_attr_deletions z8MockTest.test_reset_mock_does_not_raise_on_attr_deletioncCs:ttfD](}||tt|_||t|jq dSr)r r rQrrrrSrGrrrtest_class_assignables   zMockTest.test_class_assignablecCs8|tj|ttjt|ttjtdSr)assertIsNotNonerrUr:rrrrrrtest_name_attribute_of_call s z$MockTest.test_name_attribute_of_callcCs8|tj|ttjt|ttjtdSr)rrrr:rrrrrrtest_parent_attribute_of_call's z&MockTest.test_parent_attribute_of_callcCsddd}t}t||_|dd|t|jd||jtddg|dt |jj dS)NcSsdSrrrrrrrS1r+zBMockTest.test_parent_propagation_with_create_autospec..foorLrjr) r rr~rQrOr:rrrWrXr)rrSrrrr,test_parent_propagation_with_create_autospec/s  z5MockTest.test_parent_propagation_with_create_autospeccCspdd}t}|t|ddd|dd|t|jd||jjtddg| dt |jj dS) NcSsdSrrrrrrrS=r+zGMockTest.test_parent_propagation_with_autospec_attach_mock..foorVrTr~rLrjr) r rrr~rQrOr:rrrWrXr)rrSrrrr1test_parent_propagation_with_autospec_attach_mock;s z:MockTest.test_parent_propagation_with_autospec_attach_mockc stjj}|dd|tdtjd=fdd|tjttddl m }m }m }m }||||tg}|D]}|td }||tq~Wdn1s0YdS) NcSsttjd|S)Nr)rr(r)rrrrrVr+z9MockTest.test_isinstance_under_settrace..z sys.modulesz unittest.mockcsSrr)frameeventrtracerrr]sz6MockTest.test_isinstance_under_settrace..tracer)r r r r r_)r(rrrr>rmodulessettracegettrace unittest.mockr r r r rr$r) rZ old_patchr r r r r[rrrrrtest_isinstance_under_settraceHs       z'MockTest.test_isinstance_under_settracecCs^Gddd}|}tjjj|dddWdn1s>0Y||jjjddS)Nc@seZdZddZdS)zFMockTest.test_bool_not_called_when_passing_spec_arg..SomethingcSstj|_dSr)r(rr obj_with_bool_funcrrrrrqszOMockTest.test_bool_not_called_when_passing_spec_arg..Something.__init__N)r r!r"rrrrrr$psr$rTrr)r(rrrcr:r__bool__r;)rr$rrrr*test_bool_not_called_when_passing_spec_argos4z3MockTest.test_bool_not_called_when_passing_spec_argN)r r!r"r6rHrJrNrRr\reryrzr}rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrr&r+r.r/r2r7r;rArBrDrFrGrIrJrKrLrMrRrWr\r`rcrdrermrrrurxr}r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4,s  )&          !      8N # ,((    5           'r4__main__)r rrrZ test.supportrr(Zunittest.test.testmock.supportrrrrrrr r r r r rrrrrcrr$r3r)r4r mainrrrrs<   8  ^