%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/unittest/test/testmock/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/unittest/test/testmock/__pycache__/testmock.cpython-38.pyc

U

qax@sddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZGdddeZGdddeZd	d
ZGdddejZed
kredS)N)is_instancemock)callDEFAULTpatchsentinel	MagicMockMockNonCallableMockNonCallableMagicMock	AsyncMock_Call	_CallListcreate_autospecc@s(eZdZddZddZddZeZdS)ItercCstddddg|_dS)Nthisisaniter)rthingselfr;/usr/local/lib/python3.8/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)	SomethingNcCsdSrrrabcdrrrmethzSomething.methcCsdSrr)clsr%r&r'r(rrrcmeth!szSomething.cmethcCsdSrrr%r&r'r(rrrsmeth$szSomething.smeth)N)N)N)rr r!r)classmethodr,staticmethodr.rrrrr#s

r#cCsdSrrr%rrr	something(r*r2c@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZ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;dsdtZ<dudvZ=dwdxZ>dydzZ?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~ddZddZddZddZdS(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
assertFalsecalledassertEqual
call_count
assertTruerreturn_value	call_argscall_args_listmethod_callsassertNotIn__dict__assertIsNone_mock_parent
_mock_methods_mock_childrenrrrrrtest_constructor4s:





zMockTest.test_constructorcCstdd}||jddS)Nr<z(return value in constructor not honoured)r
rBr<rFrrr test_return_value_in_constructorPs
z)MockTest.test_return_value_in_constructorcCs*dd}t|}d|j_||ddS)NcSsdSrrrrrrfWr*z9MockTest.test_change_return_value_via_delegate.<locals>.f)rrr<r9rrJrrrr%test_change_return_value_via_delegateVsz.MockTest.test_change_return_value_via_delegatec	Cs:dd}t|}t|j_|t|W5QRXdS)NcSsdSrrrrrrrJ^r*z8MockTest.test_change_side_effect_via_delegate.<locals>.f)r	TypeErrorrside_effectassertRaisesrLrrr$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
assertInrepridrUrRZbingbaz)rrmocksrTrrr	test_repres

zMockTest.test_reprcCsGdddt}t|d}|dt|t|d}|dt|t|d}|dt|t|d}|dt|t|dd}|dt||d	t|tdd
}|dt|t}|dt|tdgd}|dt|dS)Nc@seZdZdS)z'MockTest.test_repr_with_spec.<locals>.XNrr r!rrrrXvsr]specz
 spec='X' spec_setz spec_set='X' rR)r_rTz name='foo' rSr_)objectr
rVrWr@rr]rrrrtest_repr_with_specus$


zMockTest.test_repr_with_speccst}dd}||_|jt|dddd|jdddddddgfdd}||_||||gdddgdttjd	}||jtjd
dd}t|tjd
}||tjdS)Nc_stddS)NZkablooie)SystemError)argskwargsrrreffectsz)MockTest.test_side_effect.<locals>.effectrKfishcsSrpoprresultsrrrhszside effect not used correctlyrOz#side effect in constructor not usedcSstSrrrrrrrOsz.MockTest.test_side_effect.<locals>.side_effect)rOr<)	r
rOrPreassert_called_withr9r
SideEffectRETURN)rrrhrOrrortest_side_effects$
zMockTest.test_side_effectcsdddgfdd}dd}t|}dddg|_||||gdddgddddgt|}||_||||gdddgd	dS)
NrKrirjcsSrrmrrorrrhsz2MockTest.test_autospec_side_effect.<locals>.effectcSsdSrrrrrrrJr*z-MockTest.test_autospec_side_effect.<locals>.fz1side effect not used correctly in create_autospecz'callable side effect not used correctly)rrOr9)rrhrJrrrortest_autospec_side_effects

z"MockTest.test_autospec_side_effectcCs,dd}t|}td|_|td|dS)NcSsdSrrrrrrrJr*z7MockTest.test_autospec_side_effect_exception.<locals>.fzBazinga!)r
ValueErrorrOassertRaisesRegexrLrrr#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)Nr2child)rTparentr_r2zname 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
rr#Z
SomethingElser2rtrOr<
reset_mockr9
_mock_namerCrDr7r8r:r=r>r?
mock_callsrE)rr|r_rr2r<rrrtest_reset_mocksV





zMockTest.test_reset_mockcCst}||_|dSr)r
r<r~rFrrrtest_reset_mock_recursionsz"MockTest.test_reset_mock_recursioncCst}|dSr)r	mock_openr~rr%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
jtjfd||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 setrKzcall_count incoreectzcall_args not setr6)keyzincorrect return valuerizcall_count incorrectrzcall_args_list not set)r
r;rr<r9r~rArgr8r:r=rfrgr>ZReturnValueZKeyArg)rrresultZret_valrrr	test_callsP



zMockTest.test_callc	Cst}||tj|tjd|tjtjd||jdtjffdtjiftjfdtjifg||jtjfdtjif||jjtjf||jjdtji|	|jdkdS)N)kwrrza long sequence)
r
rrZKwargr9r>r=rfrgr7rFrrrtest_call_args_comparison#s"

z"MockTest.test_call_args_comparisoncCst}|||k|||k||tk||tk||tjk||tjk|tj|k|tj|ktt}ttj}|||k|||k|||k|||kdSr)rr	r;r7ANYr)rZmmZcall1Zcall2rrrtest_calls_equal_with_any9sz"MockTest.test_calls_equal_with_anycCsdt}|||t|jd||t|j|dddddd|jdddddddS)NrKrirjrlZnothingr%r&)r
rsrPAssertionErrorr~rFrrrtest_assert_called_withNsz MockTest.test_assert_called_withcCs t}|t|tjdSr)r	rsrrrmrrrtest_assert_called_with_any]s
z$MockTest.test_assert_called_with_anyc	Csddd}t|d}|dddd|ddd|jdddd|jt|jdddd|t}|jd	d
W5QRX||jjtdS)NcSsdSrrr-rrrrJdr*z9MockTest.test_assert_called_with_function_spec.<locals>.fr^rKrirjr&r'r%r&r'e)N)r
rsrPrassertIsInstance	exception	__cause__rNrrJrcmrrr%test_assert_called_with_function_speccs


z.MockTest.test_assert_called_with_function_speccszfdd}ttjd}||ttjd}||ttjd}||ttjd}||ttjd}||dS)NcsF|dddd|ddd|jddddjt|jdddddS)NrKrirjrr)rsrPrrrrr_checkts
z<MockTest.test_assert_called_with_method_spec.<locals>._checkr^)r
r#r)r,r.)rrrrrr#test_assert_called_with_method_specssz,MockTest.test_assert_called_with_method_specc	Cs\d}|t|dtW5QRX|t|dtddW5QRXdS)Nz"Expected '{0}' to have been calledrZ	test_namerS)ryrformatr

assert_called)rmsgrrr$test_assert_called_exception_messages
z-MockTest.test_assert_called_exception_messagecst|tj|tjddddjdddddddd|tfdddS)NrRrUrirYcsjddddS)NbobrUrirassert_called_once_withrrrr<lambda>r*z7MockTest.test_assert_called_once_with.<locals>.<lambda>)r
rrPrr~rrrrtest_assert_called_once_withs
z%MockTest.test_assert_called_once_withcs6tdd|ttdfdddS)NrKrizCalls: [call(1), call(2)]cs
dS)Nrirrrrrrr*zAMockTest.test_assert_called_once_with_call_list.<locals>.<lambda>)r
ryrreescaperrrr&test_assert_called_once_with_call_lists
z/MockTest.test_assert_called_once_with_call_listc	Csddd}t|d}|dddd|ddd|jdddd|jt|jdddd|t}|jd	d
W5QRX||jjt|ddd
|t|jddd|t|jddd
dS)NcSsdSrrr-rrrrJr*z>MockTest.test_assert_called_once_with_function_spec.<locals>.fr^rKrirjrrrr)N)r
rrPrrrrrNrrrr*test_assert_called_once_with_function_specs0




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 namerjzmethod returned wrong valuez!method didn't record being called)r
r2r;rr9r<r8rrr2rrr#test_attribute_access_returns_mockss

z,MockTest.test_attribute_access_returns_mockscCs0t}|j}||jdd||j|ddS)Nr2z attribute name not set correctlyz"attribute parent not set correctly)r
r2r9rrCrrrr(test_attributes_have_name_and_parent_sets

z1MockTest.test_attributes_have_name_and_parent_setcCstt}|jddd|jjdtjd||jjdddtjifgd||jdd	d
difdddtjifgddS)Nrjrkr)caker2)rrz#method calls not recorded correctly)rjrlzsomething_else.something)r
r2something_elserZCaker9r?rFrrrtest_method_calls_recordeds
z#MockTest.test_method_calls_recordedcCst}|||jdg||jddifgt}|d||jdg||jddifgt}|jdd||jdd	difg||jddd	difgt}|jdd
d||jdddd
ifgdS)
Nr}r2r	different)r2rrrKxrZmore)somer)r
r2r9r?rFrrr test_method_calls_compare_easilys&

z)MockTest.test_method_calls_compare_easilyc	CsDdgdfD]4}dD]*}tf||i}|j|tdt|dqq
dS)Nr2r})r_raz-Mock object has no attribute 'something_else'r)r
r2ryAttributeErrorgetattr)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.<locals>.SomethingrjNcSsdSrrrrrryr*z,MockTest.test_from_spec.<locals>.Something.y)rr 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__)rrrryrrrrrrtest_attributess"z0MockTest.test_from_spec.<locals>.test_attributesr^)rbr
)rr#rrrrtest_from_specszMockTest.test_from_speccCsJt}t|d}|||||dddd|jdddddS)NwrapsrKrirjrk)r
r9r~rsrrealrrrrtest_wraps_calls.s
zMockTest.test_wraps_callscs8Gdddt}|}t|d|tfdddS)Nc@seZdZdS)zFMockTest.test_wraps_prevents_automatic_creation_of_mocks.<locals>.RealNr\rrrrReal;srrcsSr)Znew_attrrrrrrAr*zJMockTest.test_wraps_prevents_automatic_creation_of_mocks.<locals>.<lambda>)rbr
rPr)rrrrrr/test_wraps_prevents_automatic_creation_of_mocks:s
z8MockTest.test_wraps_prevents_automatic_creation_of_mockscCs4t}t|d}d|_||d||jdS)Nrrj)r
r<r9r7r8rrrr,test_wraps_call_with_nondefault_return_valueDs

z5MockTest.test_wraps_call_with_nondefault_return_valuecsGdddt}|}t|d|||tfdd|j|jjjdddd	}|jjjdddd	|||jdS)
Nc@seZdZeZdS)z,MockTest.test_wraps_attributes.<locals>.RealN)rr r!r
	attributerrrrrOsrrcsjSrrkrrrrrVr*z0MockTest.test_wraps_attributes.<locals>.<lambda>rKrirjrk)	rbr
r9rrPrassertNotEqualZfrogrs)rrrrrrrtest_wraps_attributesNs
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.<locals>.RealcSstjSr)rORIGINAL_VALUErrrrmethod`szbMockTest.test_customize_wrapped_object_with_side_effect_iterable_with_default.<locals>.Real.methodNrr r!rrrrrr_srr)rbr
rVALUE1rrrOr9rrP
StopIterationrrrrrrrDtest_customize_wrapped_object_with_side_effect_iterable_with_default^s
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.<locals>.RealcSsdSrrrrrrrnr*zUMockTest.test_customize_wrapped_object_with_side_effect_iterable.<locals>.Real.methodNrrrrrrmsrr)
rbr
rrVALUE2rrOr9rPrrrrr7test_customize_wrapped_object_with_side_effect_iterablels
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.<locals>.RealcSsdSrrrrrrr{r*zVMockTest.test_customize_wrapped_object_with_side_effect_exception.<locals>.Real.methodNrrrrrrzsrr)rbr
RuntimeErrorrrOrPrrrr8test_customize_wrapped_object_with_side_effect_exceptionys

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.<locals>.RealcSsdSrrrrrrrr*zUMockTest.test_customize_wrapped_object_with_side_effect_function.<locals>.Real.methodNrrrrrrsrcSstjSr)rVALUErrrrrOszUMockTest.test_customize_wrapped_object_with_side_effect_function.<locals>.side_effectr)rbr
rrOr9rr)rrrOrrrrr7test_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.<locals>.RealcSsdSrrrrrrrr*zMMockTest.test_customize_wrapped_object_with_return_value.<locals>.Real.methodNrrrrrrsrr)rbr
rrrr<r9rrrr/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.<locals>.RealcSsdSrrrrrrrr*z]MockTest.test_customize_wrapped_object_with_return_value_and_side_effect.<locals>.Real.methodNrrrrrrsrr)rbr
rrrrrOZWRONG_VALUEr<r9rPrrrrr?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.<locals>.RealcSsdSrrrrrrrr*z^MockTest.test_customize_wrapped_object_with_return_value_and_side_effect2.<locals>.Real.methodNrrrrrrsrrcSstSrrrrrrrrr*z[MockTest.test_customize_wrapped_object_with_return_value_and_side_effect2.<locals>.<lambda>)rbr
rrOrrr<r9rrrr@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.<locals>.RealcSsdSrrrrrrrr*zeMockTest.test_customize_wrapped_object_with_return_value_and_side_effect_default.<locals>.Real.methodNrrrrrrsrr)rbr
rrrrrOrur<r9rPrrrrrGtest_customize_wrapped_object_with_return_value_and_side_effect_defaults

zPMockTest.test_customize_wrapped_object_with_return_value_and_side_effect_defaultcCs4ttd}|t|ttdd}|t|dSNrqrR)r
rrPrFrrrtest_exceptional_side_effects
z%MockTest.test_exceptional_side_effectcCs4ttd}|t|ttdd}|t|dSr)r
KeyboardInterruptrPrFrrr test_baseexceptional_side_effects
z)MockTest.test_baseexceptional_side_effectcCst}|td|jdS)Nz
not called)r
ryrrsrFrrrtest_assert_called_with_messagesz(MockTest.test_assert_called_with_messagecCstdd}|td|jdS)NZgeoffreyrSz'Expected 'geoffrey' to be called once\.)r
ryrrrFrrr$test_assert_called_once_with_messages

z-MockTest.test_assert_called_once_with_messagecs2t|tfddd_|jddS)NcsjSr)rrrrrrr*z'MockTest.test__name__.<locals>.<lambda>rR)r
rPrrr9rrrrtest__name__szMockTest.test__name__cCsJGdddt}t|dgd}|d|jd|tt|ddS)Nc@seZdZdS)z-MockTest.test_spec_list_subclass.<locals>.SubNr\rrrrSubsrrRr^rj)listr
appendrsrPrr)rrrrrrtest_spec_list_subclasss

z MockTest.test_spec_list_subclasscCsGdddt}t|d}|||t|d}|||||j||tjjdt|d}|||t|d}|||dS)Nc@seZdZdS)z#MockTest.test_spec_class.<locals>.XNr\rrrrr]sr]r^r
r`)rbr
rassertIs	__class__r9rrcrrrtest_spec_classs

zMockTest.test_spec_classcCsGddd}t|d}|||t|d}|||||j||tjjdt|d}|||t|d}|||dS)Nc@seZdZdS)z2MockTest.test_spec_class_no_object_base.<locals>.XNr\rrrrr]
sr]r^r
r`)r
rrrr9rrcrrrtest_spec_class_no_object_base	s

z'MockTest.test_spec_class_no_object_basecsLGdddt}t|dd_t|dfdd}d_|t|dS)Nc@seZdZdZdS)z8MockTest.test_setting_attribute_with_spec_set.<locals>.XrjN)rr r!rrrrrr]sr]r^rRr`cs
d_dSNrRrrrrrset_attr%sz?MockTest.test_setting_attribute_with_spec_set.<locals>.set_attr)rbr
rrrPr)rr]rrrr$test_setting_attribute_with_spec_sets

z-MockTest.test_setting_attribute_with_spec_setcCs4t}|tj|ttdttdS)NgeA)sysgetrecursionlimit
addCleanupsetrecursionlimitintcopyr
)rcurrentrrr	test_copy,szMockTest.test_copycs\Gdddt}||d|jdfdd}|t|fdd}|t|dS)Nc@s&eZdZddZddZeeeZdS)z8MockTest.test_subclass_with_properties.<locals>.SubClasscSsdSNrjrrrrr_get8sz=MockTest.test_subclass_with_properties.<locals>.SubClass._getcSstddS)Nz
strange error)	NameError)rvaluerrr_set:sz=MockTest.test_subclass_with_properties.<locals>.SubClass._setN)rr r!rrpropertysome_attributerrrrSubClass7srr`rjcs
d_dSr)rrsrrtestAsz4MockTest.test_subclass_with_properties.<locals>.testcs
d_dS)NrUrRrrrrrEs)r
r9rrPrr)rrrrrrtest_subclass_with_properties6s
z&MockTest.test_subclass_with_propertiescCs>t}dd}|t|_|d|d|t|dddS)NcSs||||Sr)Z_increment_mock_callZ
_mock_callrrrr__call__Ls
z,MockTest.test_setting_call.<locals>.__call__onetwo)r
typerrsrPrN)rrrrrrtest_setting_callJs

zMockTest.test_setting_callcCst}tt|}tddttD}|t|||j|jf|dt||dt|d|_|_|dt||dt|dd|_	|d	t|dS)
NcSsg|]}|ds|qS)_)
startswith).0rrrr
<listcomp>Zs
z%MockTest.test_dir.<locals>.<listcomp>r%r&r'r(cSstgSr)rrrrrrjr*z#MockTest.test_dir.<locals>.<lambda>r)
r
setdirr9r%r&rVr'r(r)rrattrs
type_attrsrrrtest_dirWs
zMockTest.test_dircCsXttjd}tttj}tt|}|t||d|_|t|dddS)Nr^rjversionrK)r
unittestTestCaserrr9rcount)rrZtestcase_attrsrrrrtest_dir_from_specnszMockTest.test_dir_from_speccCsVttdd}|z0ttt}ttt}|t||W5|XdS)NZ
FILTER_DIRF)	rrbrstartstoprrr
r9)rZpatcherrrrrrtest_filter_dir{szMockTest.test_filter_dircCs6t}d|j_|dt||`|dt|dS)NrKr{)r
r{r<rVrr@rFrrr,test_dir_does_not_include_deleted_attributess
z5MockTest.test_dir_does_not_include_deleted_attributescCstdd}||jdtdd}||jdtdtd}tf|}|t|||jd||jtt}|jf||t|||jd||jtdS)NrUr	!)rOzfoo.bar.return_valuerR)	r
r9rRr	KeyErrorrPrUrZconfigure_mock)rrrgrrrtest_configure_mocks 


zMockTest.test_configure_mockc	Os:||}|||W5QRXt|j}|||dSr)rPstrrr9)rrmessagefuncrfrgcontextrrrrassertRaisesWithMsgs
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)Nznot called.zmock(1, '2', 3, bar='foo')z0expected call not found.
Expected: %s
Actual: %srK2rjrR)rUr	zfoo(1, '2', 3, foo='foo')zfoo(1, '2', 3, bar='foo')zfoo(bar='foo')zfoo(1, 2, 3)rizfoo())rr)rrsrRr)rractualexpectedr&Z	assertersr)rrr'test_assert_called_with_failure_messagesz




z0MockTest.test_assert_called_with_failure_messagec	Cst}||jgkdt}|ddifg}||j|||t||j|||jjddifgt}|jdddddd	ddifd
dtddd	fg}||j|||jjjddtddd	fg||jjddtddd	fgt}|j	
ddifd
difddifg}||j|||jtj	
ttddfD]$}tf|}t|jddifg}||j|tf|}|
ddifddifg}||j|||
jtgtf|}|ddd||jtddd||jtdd||jtdtf|}|dddj
jd||jtdddj
jd||jtddj
jd||jtdj
jdtf|}t|j	
ddif}||jd|||jtj	
||j	jt
||j	j
jtqpdS)NTrrKrirjrrrz().foorKrirjrRz
().foo.barz().foo.bar().bazrUrSzfoo.__int__r%za()z().foo.bar().baz().__int__)r	rrr9rRrrdictr<rUrY	call_listrr%r&r'__int__)rrr,rgZ	last_callrrrtest_mock_callss











zMockTest.test_mock_callscCsFt}|}|||jttg||jtgdSr)r
Zwibbler9rr)rrrrrrtest_child_mock_call_equal4s
z#MockTest.test_child_mock_call_equalcCsFt}|||jdt||jdtdSNrKr)r
rRr2rrrrr9rrrrtest_mock_call_not_equal_leaf>sz&MockTest.test_mock_call_not_equal_leafcCsFt}|||jdt||jdtdSr6r
rRrUrrrrYrrrr!test_mock_call_not_equal_non_leafEsz*MockTest.test_mock_call_not_equal_non_leafcCs8t}|jdd||jdtjdddS)NrKrri)r
rRrUr9rrrrrr2test_mock_call_not_equal_non_leaf_params_differentLsz;MockTest.test_mock_call_not_equal_non_leaf_params_differentcCs,t}|j||jdtjdSNrr8rrrr&test_mock_call_not_equal_non_leaf_attrSs
z/MockTest.test_mock_call_not_equal_non_leaf_attrcCs.t}|j||jdtdSr;)r
rRrUrrrrrrr2test_mock_call_not_equal_non_leaf_call_versus_attrYs
z;MockTest.test_mock_call_not_equal_non_leaf_call_versus_attrcCs^t}|j|t|jdd|t|jdd|t|jdddS)Nrz
call.foo()rKzcall.foo().bar()rizcall.foo().bar().baz.bob())r
rRrUrYrr9rWrrrrrtest_mock_call_repr_s
zMockTest.test_mock_call_reprcCs0t}||_t||t|ddS)Nz<Mock name='mock\(\)' id='\d+'>)r
rRrWZassertRegexrrrrtest_mock_call_repr_loopgsz!MockTest.test_mock_call_repr_loopcCst}|tg|jkdSr)r
r7rrrrrrtest_mock_calls_containsnsz!MockTest.test_mock_calls_containscCshGdddt}|}||j||||Gdddt}|}||j||||dS)Nc@seZdZdS)+MockTest.test_subclassing.<locals>.SubclassNr\rrrrSubclasstsrBc@seZdZddZdS)rAc[s
tf|Sr)r
)rrgrrr_get_child_mock|sz;MockTest.test_subclassing.<locals>.Subclass._get_child_mockN)rr r!rCrrrrrB{s)r
rrRassertNotIsInstance)rrBrrrrtest_subclassingsszMockTest.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)rrrrr9)rnamesrTattrrrrassert_attrss
z-MockTest.test_arg_lists.<locals>.assert_attrsrKrirjr1)	r
r	rrcallabler~rRrUrY)rrZrHrrrrtest_arg_listss&

zMockTest.test_arg_listscCst}|ddd|ddd|t|jd||jjd||jjtdddtddfdtddfg}t||jD]@\}}|t|d||d	|d	||d|dq~dS)
NrKrjr1rirr&)rirKr)	r
r9lenr=rfrgr1zipr>)rrZ
expected_listr,r=rrrtest_call_args_two_tuplesz!MockTest.test_call_args_two_tuplecCsttdddgd}||||gdddg|t|tdddgd}||||gdddg|t|tdd}||||gd	d
dg|t|Gdd
d
t}t|d}|||ttd}|||||gddddg|t|dS)NrKrirjrqr%r&r'Zghighic@seZdZdS)z/MockTest.test_side_effect_iterator.<locals>.FooNr\rrrrFoosrSrrrr)	r
rr9rPrr	rbrr)rrrSrrrtest_side_effect_iterators"


z"MockTest.test_side_effect_iteratorcCs\ttfD]N}tdtdf}||d}|t|||d|t|||dqdS)Nrjrrq)r
r	rxr#rPr9)rKlassiterablerrrr$test_side_effect_iterator_exceptionss
z-MockTest.test_side_effect_iterator_exceptionscCst}tdddg|_||||gdddg|t||j}||ttgdddg|_||||gdddg|t||j}||ttgt}||_|||||gddd	d
g|t||	|j|dS)NrKrirjr%r&r'rrrr)
r
rrOr9rPrrrrr)rrrOZ	this_iterrrr!test_side_effect_setting_iterators$
z*MockTest.test_side_effect_setting_iteratorcCs4tdd}tdtg|_|||gddgdS)NrirHrK)r
rrrOr9rFrrr!test_side_effect_iterator_defaults
z*MockTest.test_side_effect_iterator_defaultcCst}|dd|dd|dd|dd|ddtddddifd	d
ddifddddifdd
ifdd
ddifg}|D]}|j|gddq|tddtddtdddfD]}|jt|j|gddqtddtddgtddtddgtddtddgg}|D]}|j|ddq
tddtddtddgtddtddgtddtddtddgtddtddtddtddtddgg}|D]}|jt|j|ddqdS)NrKrirjr1rrrKr%)rjrr)r.rKrir.r[TZ	any_orderr*rRr)r
rassert_has_callsrPr)rrkallskallZ
kall_listsZ	kall_listrrrtest_assert_has_calls_any_ordersT






"*z(MockTest.test_assert_has_calls_any_orderc	
Cstddddifdtdddd	d
difg}ttdg}|tjdd|tjtid	dgg}t
tfD]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)NrKrir%rjrZrrKr.rLr&r1r	rr/)rrRrUextendZspamrYr2Zbamrrlr
r	rrangerMr^rPrrreversed)	rZkalls1Zkalls2rZrr_rRstepZtheserrrtest_assert_has_callssD"






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.<locals>.SomethingcSsdSrrrrrrrJr*zFMockTest.test_assert_has_calls_nested_spec.<locals>.Something.__init__NcSsdSrrr$rrrr)Kr*zBMockTest.test_assert_has_calls_nested_spec.<locals>.Something.methc@seZdZddZddZdS)zAMockTest.test_assert_has_calls_nested_spec.<locals>.Something.FoocSsdSrrrrrrrOr*zJMockTest.test_assert_has_calls_nested_spec.<locals>.Something.Foo.__init__cSsdSrr)rr%r&rrrmeth1Pr*zGMockTest.test_assert_has_calls_nested_spec.<locals>.Something.Foo.meth1N)rr r!rrgrrrrrSMsrS)N)rr r!rr)rSrrrrr#Hs
r#rKrirjr(r)
rr)r^rr~rPrrSrgZnon_existent)rr#Z
mock_classrZ
invalid_callsr`rrr!test_assert_has_calls_nested_specGs.
" z*MockTest.test_assert_has_calls_nested_speccCsJt}||t}|	|dSr)
r	rRrUrYrr
threerr2r^)rrcallsrrr)test_assert_has_calls_nested_without_specos
z2MockTest.test_assert_has_calls_nested_without_specc	Csddd}t|d}|dddd|dd	d
dd|d
dddddifddddifdifg}|||j|dd||dd|j|dddd||dd|j|ddddtt|}|t||W5QRX|j|dd|t||ddW5QRX|j|dddd|t||ddW5QRX|j|dddddS)NcSsdSrrr-rrrrJxr*z<MockTest.test_assert_has_calls_with_function_spec.<locals>.fr^rKrirjrrrrr]r'r(
)r'r.r/)rrrr()rnrorpTr\r0)N)r
r^rrdrPr)rrJrrkrrr(test_assert_has_calls_with_function_specws2


z1MockTest.test_assert_has_calls_with_function_specc	Csd	dd}t|d}|d|tdtd}|tgW5QRX||j	j
|tdtd}|ttddgW5QRX||j	j
tdS)
NcSsdSrrrrrrrJr*zAMockTest.test_assert_has_calls_not_matching_spec_error.<locals>.fr^rKz^{}$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)]ri)N)
r
ryrrrrr^rrBrrrrNrrrr-test_assert_has_calls_not_matching_spec_errors.

 z6MockTest.test_assert_has_calls_not_matching_spec_errorcCst}|dd|dd|ddd|dd|jdd|jddd|t|j|t|jdd|jt|jdddS)NrKrirjr1rrKr)r
assert_any_callrPrrFrrrtest_assert_any_calls,

zMockTest.test_assert_any_callc	Csddd}t|d}|dddd|dd	d
dd|ddd|jdddd
|dd	d
d|jdd	d
dd|jt|jdddd|t}|jddW5QRX||jjtdS)NcSsdSrrr-rrrrJr*z;MockTest.test_assert_any_call_with_function_spec.<locals>.fr^rKrirjrrrrr]rmrr-rr)N)r
rsrPrrrrrNrrrr'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)NcSsdSrrrrrrrJr*z3MockTest.test_mock_calls_create_autospec.<locals>.frKrirjr)rrJrr9rr)rrJobjZfuncsr'rrrtest_mock_calls_create_autospecs

z(MockTest.test_mock_calls_create_autospeccCs$tjtdd}|dt|dS)NZ
sweet_funcrS)rrrbrVrWrrrrtest_create_autospec_with_namesz'MockTest.test_create_autospec_with_namec
Cs`Gddd}dD]H}|j|d2tt||}|||t|dW5QRXqdS)Nc@s$eZdZeddZeddZdS)zMMockTest.test_create_autospec_classmethod_and_staticmethod.<locals>.TestClasscSsdSrr)r+rrrclass_methodszZMockTest.test_create_autospec_classmethod_and_staticmethod.<locals>.TestClass.class_methodcSsdSrrrrrr
static_methodsz[MockTest.test_create_autospec_classmethod_and_staticmethod.<locals>.TestClass.static_methodN)rr r!r/ryr0rzrrrr	TestClasss
r{)ryrz)rZ	extra_arg)ZsubTestrrrrrPrN)rr{rZmock_methodrrr1test_create_autospec_classmethod_and_staticmethodsz:MockTest.test_create_autospec_classmethod_and_staticmethodc	Csht}d}|t||W5QRX|t||W5QRXtdd}||dS)Nz1Attributes cannot start with 'assert' or 'assret'T)Zunsafe)r
ryrZassert_foo_callZassret_foo_call)rrrrrrtest_mock_unsafes
zMockTest.test_mock_unsafec	Cs<t}|j||t|jW5QRXdSr)r
helloassert_not_calledrPrrrrrtest_assert_not_calleds

zMockTest.test_assert_not_calledcCs*t}|dd|ttd|jdS)NrKrizCalls: [call(1, 2)])r
ryrrrrrrrrtest_assert_not_called_messages
z'MockTest.test_assert_not_called_messagec	CsNt}|t|jW5QRX||j||jdSr)r
rPrr~rrrrrtest_assert_calleds
zMockTest.test_assert_calledc	Csdt}|t|jW5QRX||j||t|jW5QRXdSr)r
rPrr~assert_called_oncerrrrtest_assert_called_once(s
z MockTest.test_assert_called_oncecCs2t}|dd|d|ttd|jdS)NrKrirjzCalls: [call(1, 2), call(3)])r
ryrrrrrrrrtest_assert_called_once_message3s
z(MockTest.test_assert_called_once_messagec	Cs:t}|t}|W5QRX|dt|jdS)NzCalls:)r
rPrrr@r%r)rrrrrr*test_assert_called_once_message_not_called;sz3MockTest.test_assert_called_once_message_not_calledcCs0t}|jdddd}|t|jj|dS)Nr~Zhero)rTZdaddyz call(name='hello', daddy='hero'))r
r~r9rWr=)rrtextrrrtest_ordered_call_signatureBsz$MockTest.test_ordered_call_signaturecCsVt}tdd}t}||dd||jd|||jd|dS)Nr~rrK)rrindexr
r9r?)rr'rRrrrrtest_override_tuple_methodsIsz$MockTest.test_override_tuple_methodscCs>tdddgd}|jddd||jt||jddS)Nrnrirjr<rOT)r
r~rr<r9rOrrrrtest_reset_return_sideeffectRsz%MockTest.test_reset_return_sideeffectcCs<tdddgd}|jdd||jt||jddS)NrnrirjrTrH)r
r~rr<rrOrrrrtest_reset_returnXszMockTest.test_reset_returncCs<tdddgd}|jdd||jd||jddS)NrnrirjrTrq)r
r~r9r<rOrrrrtest_reset_sideeffect^szMockTest.test_reset_sideeffectc	sGdddt}Gdddt}Gdddtttttg}t|D]0}||ffdd	||ffd	d	qD|D]}ttd
dfD]}|}|j|j	|j
f||fdgd
gffD]\}}ttd
dfD]}|j|f||j|t
t|d
|t
t|dd|kr*|t
t|dd|j|f||t
t|d|j	|t
t|dd|kr|t
t|ddqqqqzdS)Nc@seZdZdZdS)z)MockTest.test_mock_add_spec.<locals>._OnerKN)rr r!rrrrr_Oneesrc@seZdZdZdS)z)MockTest.test_mock_add_spec.<locals>._TworiN)rr r!r
rrrr_Twogsrc@seZdZdZZZdS)z-MockTest.test_mock_add_spec.<locals>.AnythingZfourN)rr r!rr
rjrrrrAnythingisrcs
|dS)Nr^rKrrrrpr*z-MockTest.test_mock_add_spec.<locals>.<lambda>cs
|dS)Nr`rrrrrrqr*Tr`rr
rjra)rbr
r	rrrrr1rr
rj
mock_add_specrPrrsetattr)	rrrZklassesrUrgrZOneZTworrrtest_mock_add_specdsz

zMockTest.test_mock_add_speccs|ttfD]n}|tt|tt|ddj_t|	td|tfddqdS)NrRrcsdSrrrrrrrr*z;MockTest.test_mock_add_spec_magic_methods.<locals>.<lambda>)
r	rrrrbrPrNr3r<r9)rrUrrr 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)NrTrS)rr
r	rr
rRr9r?rrrUrYrrUrrrrtest_adding_child_mocks$
zMockTest.test_adding_child_mockcCs@ttfD]2}|}t|_|||jttgqdSr)r
r	r<r9rrrrrrtest_adding_return_value_mocks
z&MockTest.test_adding_return_value_mockcCsGdddt}t}t|d}t|d}|}||j|}||j||d||d|||	|j
ttgdS)Nc@seZdZdZdZdS)z'MockTest.test_manager_mock.<locals>.Foorr
N)rr r!rr
rrrrrSsrSrr
)rbr
rrrrattach_mockr
rr9rr)rrSmanagerZp1Zp2Zmock_oneZmock_tworrrtest_manager_mockszMockTest.test_manager_mockcCshttfD]Z}|}tdd|_tdd|_t|t|||jttg||j	gqdS)NrjrHg@)
r
r	r3	__float__rfloatr9rrr?)rrUrrrrtest_magic_methods_mock_callssz&MockTest.test_magic_methods_mock_callscCs<tjdd}|d}|}|d}|}|||dS)NdataZ	read_dataa-namezanother-name)rrreadr9)rmocked_openf1Zf1_dataf2Zf2_datarrr test_mock_open_reuse_issue_21750sz)MockTest.test_mock_open_reuse_issue_21750cCsVtjdd}|d}dd|D}||dd||dd	|t|gdS)
NzRemarkable
Norwegian BluerrcSsg|]}|qSrrrlinerrrrsz=MockTest.test_mock_open_dunder_iter_issue.<locals>.<listcomp>rzRemarkable
rKzNorwegian Blue)rrr9r)rrrlinesrrr test_mock_open_dunder_iter_issuesz)MockTest.test_mock_open_dunder_iter_issuec	Cstjdd}|d}t|}|}dd|D}||d||d||dd	|t|g|tt|W5QRXdS)
Nz1st line
2nd line
3rd linerrcSsg|]}|qSrrrrrrrsz6MockTest.test_mock_open_using_next.<locals>.<listcomp>z	1st line
z	2nd line
rz3rd line)rrrr"r9rrPr)rrrZline1Zline2rrrrtest_mock_open_using_nextsz"MockTest.test_mock_open_using_nextc	CsXttjdd}td|0|j}|j}td|_dd}|t|W5QRXdS)NZJLVrSztempfile.NamedTemporaryFilezTest 2 ErrorcSstddS)NZasd)tempfileNamedTemporaryFilewriterrrrattemptsz.MockTest.test_mock_open_write.<locals>.attempt)	rrr	rr<rOSErrorrOrP)rZmock_namedtempZmock_filehandleZ
mock_writerrrrtest_mock_open_writes
zMockTest.test_mock_open_writecCsJtjdd}dd|jj_|}|}|d||d|dS)Nzfoo
barnrcWsdS)Nabcr)rfrrrrr*z8MockTest.test_mock_open_alter_readline.<locals>.<lambda>r)rrr<readlinerOr9)rZmopenfirstsecondrrrtest_mock_open_alter_readlines

z&MockTest.test_mock_open_alter_readlinecCstjdd}|d}||d||d||d||d||g||g|dS)NrRrrUr.)rrrr9r	readlines)r_openrQrrrtest_mock_open_after_eofs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	rWr<rr9r~r%r&rV)rrUrZ
original_reprrrrtest_mock_parents+s,zMockTest.test_mock_parentscCsttttf}|D]}|D]z}|}|dd}||d||j||dt||j	d|
|jtj	dg|
|j
tj	dgqqdS)NrRrSrUzname='mock.bar'rK)r
r	rrrrrUrVrWrYr9rrr?rclassesrUZKlass2rZm2rrrtest_attach_mockHs
zMockTest.test_attach_mockcCsttttf}ttfD]h}|D]^}|}|dd}||d||||dt|||	|j
tqqdS)NrRrSr<z
name='mock()')
r
r	rrrrrVrWrRr9rrr2rrrrtest_attach_mock_return_valueYs
z&MockTest.test_attach_mock_return_valuec	Cst}tjtddd}||jd||d|dtd|dt	dt	dt	dg}t	dt	dt	dg}||j
|||jj
||tj
|||j
||d	t|jj||jd	W5QRXdS)
N
.somethingTZautospecr2r{rKrirj
mock.child)
r
rrrr9Z_extract_mock_namerr{r2rrrVrW)rr|Z	mock_funcZparent_callsZchild_callsrrrtest_attach_mock_patch_autospecis
z(MockTest.test_attach_mock_patch_autospecc
Cstjtddd}t}||dt}|jddddd	|tj	tj
ddddd	g|jttj
ddddd	g|ttj
ddddd	gW5QRXtjtd
ddR}t}||dtd|tdgttdg|tdgW5QRXtjtddd}t}||d
t}|jddddd	|t
t
jddddd	g|jtddddd	g|ttjddddd	gW5QRXdS)Nz.Something.methTrattach_methrKrirjrrhrattach_funcz
.Something
attach_obj)rrrr
rr#r)r^rrrr2rr)rZmockedrrvrrr)test_attach_mock_patch_autospec_signature}s2&
z2MockTest.test_attach_mock_patch_autospec_signaturecCsfttttfD]L}|t|d|`|t|d|`|t|d|	t
t|dqdS)NrrJ)r
r	rrr;hasattrrr7rJrPrrrFrrrtest_attribute_deletionsz MockTest.test_attribute_deletioncCsttttfD]t}d|_|t|d||jd|`|t|dd|_|t|d||jd|`|t|dqdS)NrjrRr)	r
r	rrrRr;rr9r7rFrrr7test_mock_does_not_raise_on_repeated_attribute_deletionsz@MockTest.test_mock_does_not_raise_on_repeated_attribute_deletionc
Cs<ttttfD]"}|`|t
|`W5QRXqdSr)r
r	rrrRrPrrFrrr4test_mock_raises_when_deleting_nonexistent_attributesz=MockTest.test_mock_raises_when_deleting_nonexistent_attributecCs,t}d|_|`||t|ddS)NTr{)r
r{r~r7rrFrrr/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	rDrrrrRrFrrrtest_class_assignables
zMockTest.test_class_assignablecCs8|tj|ttjt|ttjtdSr)assertIsNotNonerrTr9rrrrrrtest_name_attribute_of_callsz$MockTest.test_name_attribute_of_callcCs8|tj|ttjt|ttjtdSr)rrr|r9rrrrrrtest_parent_attribute_of_callsz&MockTest.test_parent_attribute_of_callcCsddd}t}t||_|dd|t|jd||jtddg|dt	|jj
dS)NcSsdSrrrrrrrRr*zBMockTest.test_parent_propagation_with_create_autospec.<locals>.foorKrir)r
rr{rPrNr9rrrVrWr)rrRrrrr,test_parent_propagation_with_create_autospecs
z5MockTest.test_parent_propagation_with_create_autospeccCspdd}t}|t|ddd|dd|t|jd||jjtddg|	dt
|jjdS)	NcSsdSrrrrrrrRr*zGMockTest.test_parent_propagation_with_autospec_attach_mock.<locals>.foorUrSr{rKrir)r
rrr{rPrNr9rrrVrWr)rrRr|rrr1test_parent_propagation_with_autospec_attach_mocksz:MockTest.test_parent_propagation_with_autospec_attach_mockc		stjj}|dd|td|tjd=fdd|tjttddl	m
}m}m}m
}||||tg}|D]}|td	}||tq~W5QRXdS)
NcSsttjd|S)Nr)rrr)rrrrr
r*z9MockTest.test_isinstance_under_settrace.<locals>.<lambda>zsys.modulesz
unittest.mockcsSrr)frameeventrtracerrrsz6MockTest.test_isinstance_under_settrace.<locals>.tracer)r
r	rrr^)rrrrr1rmodulessettracegettrace
unittest.mockr
r	rrr
r#r)	rZ	old_patchr
r	rrrZrrvrrrtest_isinstance_under_settraces&	


z'MockTest.test_isinstance_under_settraceN)rr r!r5rGrIrMrQr[rdrvrwrzrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
rrrr r!r$r)r-r4r5r7r9r:r<r=r>r?r@rErJrOrTrWrXrYrarfrirlrqrrrtrurwrxr|r}rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3+s	)&	










	8N
#
,((
	5	




r3__main__)rrrrrZunittest.test.testmock.supportrrrrrrrr	r
rrr
rrrrbrr#r2rr3rmainrrrr<module>s:8

	

Zerion Mini Shell 1.0