%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__/testasync.cpython-38.pyc

U

qaב@svddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
ddZGdddZGdddZd	d
ZddZd
dZGdddeZedZedZGdddejZGdddejZGdddejZGdddejZGdddejZGdddejZGdd d ej Z!Gd!d"d"ejZ"Gd#d$d$ejZ#Gd%d&d&ejZ$Gd'd(d(ejZ%dS))N)	ANYcall	AsyncMockpatch	MagicMockMockcreate_autospecsentinel	_CallListcCstddSN)asyncioZset_event_loop_policyr
r
</usr/local/lib/python3.8/unittest/test/testmock/testasync.pytearDownModule
src@s<eZdZddZddZddZeddZed	d
Z	dS)
AsyncClasscCsdSrr
selfr
r
r__init__szAsyncClass.__init__csdSrr
rr
r
rasync_methodszAsyncClass.async_methodcCsdSrr
rr
r
r
normal_methodszAsyncClass.normal_methodcsdSrr
)clsr
r
rasync_class_methodszAsyncClass.async_class_methodcsdSrr
r
r
r
rasync_static_methodszAsyncClass.async_static_methodN)
__name__
__module____qualname__rrrclassmethodrstaticmethodrr
r
r
rrs
rc@seZdZddZdS)AwaitableClassccs
dVdSrr
rr
r
r	__await__ szAwaitableClass.__await__N)rrrrr
r
r
rrsrcsdSrr
r
r
r
r
async_func#sr csdSrr
)abcr
r
rasync_func_args&sr$cCsdSrr
r
r
r
rnormal_func)sr%c@seZdZddZdS)NormalClasscCsdSrr
rr
r
rr!-sz
NormalClass.aN)rrrr!r
r
r
rr&,sr&z.AsyncClassz.NormalClassc@s<eZdZddZddZddZddZd	d
ZddZd
S)AsyncPatchDecoratorTestcs"ttdfdd}|dS)Nrcst|dSr)
assertTrueriscoroutinefunctionmock_methodrr
r
test_async7szLAsyncPatchDecoratorTest.test_is_coroutine_function_patch.<locals>.test_asyncrobjectrrr,r
rr test_is_coroutine_function_patch6s
z8AsyncPatchDecoratorTest.test_is_coroutine_function_patchcsBttdfdd}ttdfdd}||dS)Nrcs$|}t|t|dSrr(inspectisawaitablerrunr+mrr
rr,=sz?AsyncPatchDecoratorTest.test_is_async_patch.<locals>.test_asyncz
.async_methodcs$|}t|t|dSrr1r5rr
rtest_no_parent_attributeCszMAsyncPatchDecoratorTest.test_is_async_patch.<locals>.test_no_parent_attribute)rr.rasync_foo_name)rr,r7r
rrtest_is_async_patch<s
z+AsyncPatchDecoratorTest.test_is_async_patchcs"ttdfdd}|dS)Nrcs|tdSrassertIsInstancerr*rr
rr,MszCAsyncPatchDecoratorTest.test_is_AsyncMock_patch.<locals>.test_asyncr-r/r
rrtest_is_AsyncMock_patchLs
z/AsyncPatchDecoratorTest.test_is_AsyncMock_patchcs"ttdfdd}|dS)Nrcs|tdSrr:r*rr
rr,TszPAsyncPatchDecoratorTest.test_is_AsyncMock_patch_staticmethod.<locals>.test_asyncr-r/r
rr$test_is_AsyncMock_patch_staticmethodSs
z<AsyncPatchDecoratorTest.test_is_AsyncMock_patch_staticmethodcs"ttdfdd}|dS)Nrcs|tdSrr:r*rr
rr,[szOAsyncPatchDecoratorTest.test_is_AsyncMock_patch_classmethod.<locals>.test_asyncr-r/r
rr#test_is_AsyncMock_patch_classmethodZs
z;AsyncPatchDecoratorTest.test_is_AsyncMock_patch_classmethodcsPttdddttdddfdd}t|ttdS)N.async_funcreturn_value.async_func_argscsh|jd|jdtttttIdHdtddddIdHddS)Nr$r r@rDr#)assertEqualZ
_mock_namer;r rr$)Zfunc_args_mockZ	func_mockrr
rr,bsz@AsyncPatchDecoratorTest.test_async_def_patch.<locals>.test_async)rrrr4r(r2r)r r/r
rrtest_async_def_patchas

z,AsyncPatchDecoratorTest.test_async_def_patchN)	rrrr0r9r<r=r>rHr
r
r
rr'5sr'c@s,eZdZddZddZddZddZd	S)
AsyncPatchCMTestcsfdd}|dS)Nc	s,ttd}t|W5QRXdSNr)rr.rr(rr)r*rr
rr,tsz>AsyncPatchCMTest.test_is_async_function_cm.<locals>.test_asyncr
r/r
rrtest_is_async_function_cmssz*AsyncPatchCMTest.test_is_async_function_cmcsfdd}|dS)Nc	s<ttd&}|}t|t|W5QRXdSrJ)rr.rr(r2r3rr4r5rr
rr,{sz5AsyncPatchCMTest.test_is_async_cm.<locals>.test_asyncr
r/r
rrtest_is_async_cmzsz!AsyncPatchCMTest.test_is_async_cmcsfdd}|dS)Nc	s(ttd}|tW5QRXdSrJ)rr.rr;rr*rr
rr,sz9AsyncPatchCMTest.test_is_AsyncMock_cm.<locals>.test_asyncr
r/r
rrtest_is_AsyncMock_cmsz%AsyncPatchCMTest.test_is_AsyncMock_cmcsfdd}t|dS)Nc	s>ttdtttW5QRXttdS)Nr?)rrrr;r r(r2r)r
rr
rr,sz6AsyncPatchCMTest.test_async_def_cm.<locals>.test_asyncrr4r/r
rrtest_async_def_cmsz"AsyncPatchCMTest.test_async_def_cmN)rrrrKrLrMrOr
r
r
rrIrs	rIc@s4eZdZddZddZddZddZd	d
ZdS)
AsyncMockTestcCst}|t|dSr)rr(rr)rmockr
r
r test_iscoroutinefunction_defaultsz.AsyncMockTest.test_iscoroutinefunction_defaultcCs4dd}t|}|t||t|dS)NcsdSrr
r
r
r
rfooz<AsyncMockTest.test_iscoroutinefunction_function.<locals>.foorr(rr)r2rrTrRr
r
r!test_iscoroutinefunction_functionsz/AsyncMockTest.test_iscoroutinefunction_functioncCs:t}|}|t|t||dt|dS)Nassert_awaited)rr(r2r3rr4ZassertIndirrrRr6r
r
rtest_isawaitables

zAsyncMockTest.test_isawaitablecCs4dd}t|}|t||t|dS)NcSsdSrr
r
r
r
rrTrUzCAsyncMockTest.test_iscoroutinefunction_normal_function.<locals>.foorVrWr
r
r(test_iscoroutinefunction_normal_functionsz6AsyncMockTest.test_iscoroutinefunction_normal_functioncCsDt}t|t}||t|}||tjdSr)rZnew_event_loopZset_event_loopFuturestopcloserr;)rZloopfutrRr
r
rtest_future_isfutures
z"AsyncMockTest.test_future_isfutureN)rrrrSrXr\r]rbr
r
r
rrPs
rPc@s4eZdZddZddZddZddZd	d
ZdS)AsyncAutospecTestcs@ttddfdd}ttddfdd}||dS)NTZautospeccs|jt|tdSrr;rrrr*rr
rr,sz=AsyncAutospecTest.test_is_AsyncMock_patch.<locals>.test_asynccs|jtdSr)r;rrr*rr
rtest_normal_methodszEAsyncAutospecTest.test_is_AsyncMock_patch.<locals>.test_normal_methodrr8)rr,rfr
rrr<s

z)AsyncAutospecTest.test_is_AsyncMock_patchc	Cs&|tttddW5QRXdS)NT)instance)assertRaisesRuntimeErrorrr rr
r
rtest_create_autospec_instancesz/AsyncAutospecTest.test_create_autospec_instancecCs ttd}|t|tdSNspec)rrr;r)rZawaitable_mockr
r
r$test_create_autospec_awaitable_classsz6AsyncAutospecTest.test_create_autospec_awaitable_classcstt}|ddddfdd}||jd||j||jg|t	||
t||
t||jd||jt
dddd||jt
ddddg||jdddd|jdddd|dS)Nr@rDrErFcsIdHdSrr
r
	awaitabler
rmainsz4AsyncAutospecTest.test_create_autospec.<locals>.mainr)rr$rGawait_countassertIsNone
await_argsawait_args_listassert_not_awaitedrr4r(r)iscoroutinerassert_awaited_onceassert_awaited_once_withassert_awaited_withrY)rrnrrr
rprtest_create_autospecs"z&AsyncAutospecTest.test_create_autospeccsfdd}t|dS)Nc	sHttddd}|dddd}|jtt|t|t	
||jd|j
g|j||IdHW5QRX|jd|jtdddd|j
tddddg||jdddd|jdddd|||jd|j|j
gdS)	NrCTrdr@rDrErFr)rrr;rRrr(rr)rxr2r3rGrsrvrtrurwrryrzr{rY
reset_mock)r+rqrr
rr,s,z>AsyncAutospecTest.test_patch_with_autospec.<locals>.test_asyncrNr/r
rrtest_patch_with_autospecsz*AsyncAutospecTest.test_patch_with_autospecN)rrrr<rkror|r~r
r
r
rrcs

rcc@sdeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
dS)
AsyncSpecTestc
sBfdd}ttfD](}d|||W5QRXqdS)Ncs(|t}|jt|jtdSr)rr;rrrr)	mock_typerRrr
r
inner_testszCAsyncSpecTest.test_spec_normal_methods_on_class.<locals>.inner_testztest method types with rrsubTestrrrr
rr!test_spec_normal_methods_on_classsz/AsyncSpecTest.test_spec_normal_methods_on_classcCs(tt}||jt||jtdSr)rrr;rrrrQr
r
r+test_spec_normal_methods_on_class_with_mocksz9AsyncSpecTest.test_spec_normal_methods_on_class_with_mockc
sDfdd}tttfD](}d|||W5QRXqdS)Nc	sX|td}||tt|W5QRX|td}||dSrlr r;assertWarnsRuntimeWarningr(r2r3r%r
async_mockZ	sync_mockrr
rrs

z8AsyncSpecTest.test_spec_mock_type_kw.<locals>.inner_testztest spec kwarg with rrrrrr
rrtest_spec_mock_type_kws
z$AsyncSpecTest.test_spec_mock_type_kwc
sDfdd}tttfD](}d|||W5QRXqdS)Nc	sT|t}||tt|W5QRX|t}||dSrrrrr
rr%sz@AsyncSpecTest.test_spec_mock_type_positional.<locals>.inner_testztest spec positional with rrr
rrtest_spec_mock_type_positional$s
z,AsyncSpecTest.test_spec_mock_type_positionalcCs:ttd}||t|}|t|t|dSrlrr%r;r(r2r3rr4r[r
r
r test_spec_as_normal_kw_AsyncMock3s

z.AsyncSpecTest.test_spec_as_normal_kw_AsyncMockcCs8tt}||t|}|t|t|dSrrr[r
r
r(test_spec_as_normal_positional_AsyncMock:s
z6AsyncSpecTest.test_spec_as_normal_positional_AsyncMockcs&tjtdddfdd}|dS)NrTrmcs|tdSrr:r*rr
rr,Bsz6AsyncSpecTest.test_spec_async_mock.<locals>.test_asyncr-r/r
rrtest_spec_async_mockAsz"AsyncSpecTest.test_spec_async_mockcs"ttddfdd}|dS)NTrmcs|t|jtdSr)r;rrrr*rr
rr,IszIAsyncSpecTest.test_spec_parent_not_async_attribute_is.<locals>.test_asyncrgr/r
rr'test_spec_parent_not_async_attribute_isHs
z5AsyncSpecTest.test_spec_parent_not_async_attribute_iscs(tjtdtjdfdd}|dS)Nrrmcs0|tt|t|dSr)r;rassertFalser2rxr3r*rr
rtest_async_attributeQszFAsyncSpecTest.test_target_async_spec_not.<locals>.test_async_attribute)rr.rr&r!)rrr
rrtest_target_async_spec_notPsz(AsyncSpecTest.test_target_async_spec_notcs&tjtdtdfdd}|dS)Nr!rmcs|tdSrr:)Zmock_async_funcrr
r test_attribute_not_async_spec_isZszUAsyncSpecTest.test_target_not_async_spec_is.<locals>.test_attribute_not_async_spec_is)rr.r&r )rrr
rrtest_target_not_async_spec_isYsz+AsyncSpecTest.test_target_not_async_spec_iscs"tttdfdd}|dS)Nrmcs|jt|tdSrre)ZMockNormalClassrr
r test_async_attributes_coroutines`szRAsyncSpecTest.test_spec_async_attributes.<locals>.test_async_attributes_coroutines)rnormal_foo_namer)rrr
rrtest_spec_async_attributes_s
z(AsyncSpecTest.test_spec_async_attributesN)rrrrrrrrrrrrrrr
r
r
rrs
	rc@s,eZdZddZddZddZddZd	S)
AsyncSpecSetTestcs tjtdddfdd}dS)NrTZspec_setcs|tdSrr:)rrr
rr,jsz<AsyncSpecSetTest.test_is_AsyncMock_patch.<locals>.test_asyncr-r/r
rrr<isz(AsyncSpecSetTest.test_is_AsyncMock_patchcCs,ttjd}|t|||tdSNr)rrrr(rr)r;rQr
r
rtest_is_async_AsyncMocknsz(AsyncSpecSetTest.test_is_async_AsyncMockcCsZttd}|t|j|t|j||jt	||jt||tdSr)
rrr(rr)rrrr;rrQr
r
rtest_is_child_AsyncMockss
z(AsyncSpecSetTest.test_is_child_AsyncMockc	Cs>t}tddd|_t|d}||tW5QRXdS)NcSs|Srr
xr
r
r<lambda>}rUz=AsyncSpecSetTest.test_magicmock_lambda_spec.<locals>.<lambda>rm	mock_func)rrrr.r;)rZmock_objcmr
r
rtest_magicmock_lambda_spec{sz+AsyncSpecSetTest.test_magicmock_lambda_specN)rrrr<rrrr
r
r
rrhsrc@steZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZdS)AsyncArgumentscs2dd}t|dd}|dIdH}||ddS)Ncs|dSNr@r
)rvarr
r
radditionsz6AsyncArguments.test_add_return_value.<locals>.addition
rArrG)rrrRoutputr
r
rtest_add_return_valuesz$AsyncArguments.test_add_return_valuec	s@dd}t|tdd}|t|dIdHW5QRXdS)Ncs|dSrr
rr
r
rrsz?AsyncArguments.test_add_side_effect_exception.<locals>.additionerrZside_effectr)r	Exceptionri)rrrRr
r
rtest_add_side_effect_exceptionsz-AsyncArguments.test_add_side_effect_exceptioncs0dd}t|d}|dIdH}||ddS)Ncs|dSrr
rr
r
rrsz?AsyncArguments.test_add_side_effect_coroutine.<locals>.additionrrrrrrRresultr
r
rtest_add_side_effect_coroutines
z-AsyncArguments.test_add_side_effect_coroutinecs0dd}t|d}|dIdH}||ddS)NcSs|dSrr
rr
r
rrszEAsyncArguments.test_add_side_effect_normal_function.<locals>.additionrrrrrr
r
r$test_add_side_effect_normal_functions
z3AsyncArguments.test_add_side_effect_normal_functionc	sXdddg}t|d}|D]}||IdH|q|t}|IdHW5QRXdS)Nr@rDrEr)rrGriStopAsyncIteration)rvalsrRitemer
r
rtest_add_side_effect_iterables

z,AsyncArguments.test_add_side_effect_iterablec	s`Gdddt}d|dg}t|d}||IdHd||}|IdHW5QRXdS)Nc@seZdZdS)zOAsyncArguments.test_add_side_effect_exception_iterable.<locals>.SampleExceptionN)rrrr
r
r
rSampleExceptionsrr@rTr)rrrGri)rrrrRrr
r
r'test_add_side_effect_exception_iterables
z6AsyncArguments.test_add_side_effect_exception_iterablecs0tdd}t|d}|IdH}|||dS)NrrA)rassertIs)rvaluerRrr
r
rtest_return_value_AsyncMocks

z*AsyncArguments.test_return_value_AsyncMockcs:t}|dt|d}|IdH}||tjdS)NrA)rr^
set_resultrr;rrarRrr
r
rtest_return_value_awaitables


z*AsyncArguments.test_return_value_awaitablec	s^t}|dt|gd}|IdH}||tj|t|IdHW5QRXdS)Nr)rr^rrr;rirrr
r
r!test_side_effect_awaitable_valuess
z0AsyncArguments.test_side_effect_awaitable_valuescs0tdd}t|d}|IdH}||ddS)NrrArr)rZeffectrRrr
r
rtest_side_effect_is_AsyncMocks

z,AsyncArguments.test_side_effect_is_AsyncMockcsRtdfdd}t|d}|IdH}||||dS)NFcsdSNTr
r
Zranrr
rinnersz2AsyncArguments.test_wraps_coroutine.<locals>.innerwraps)rr^rrGrYr(rrrRrr
rrtest_wraps_coroutines
z#AsyncArguments.test_wraps_coroutinecsNddfdd}t|d}|IdH}||||dS)Nr@FcsdSrr
r
rr
rrsz8AsyncArguments.test_wraps_normal_function.<locals>.innerr)rrGrYr(rr
rrtest_wraps_normal_functions
z)AsyncArguments.test_wraps_normal_functioncsxt}|d}|d}|IdH|IdH|tdtdg||jtdtdg||jtdtdgdS)NrDr@)rassert_has_awaitsrrGrvcall_args_list)rrZmock2Zmock1r
r
rtest_await_args_list_orders

z)AsyncArguments.test_await_args_list_orderN)rrrrrrrrrrrrrrrrr
r
r
rrs		rc@s4eZdZddZddZddZddZd	d
ZdS)AsyncMagicMethodscCsBt}||jt||jt||jt||jtdSr)rr;
__aenter__r	__aexit__	__anext__	__aiter__rZm_mockr
r
r+test_async_magic_methods_return_async_mockss
z=AsyncMagicMethods.test_async_magic_methods_return_async_mockscCsBt}||jt||jt||jt||jtdSr)rr;	__enter__r__exit____next____len__ra_mockr
r
r*test_sync_magic_methods_return_magic_mockss
z<AsyncMagicMethods.test_sync_magic_methods_return_magic_mockscCs:t}|t|d|t|d|t|ddS)Nrrr)rr(hasattrrr
r
r&test_magicmock_has_async_magic_methodssz8AsyncMagicMethods.test_magicmock_has_async_magic_methodscCsJt}|t|d|t|d|t|d|t|ddS)Nrrrr)rr(rrr
r
r%test_asyncmock_has_sync_magic_methodss
z7AsyncMagicMethods.test_asyncmock_has_sync_magic_methodscCsJt}||jt||jt|t|j|t|jdSr)rr;rrrr(rr)rr
r
r&test_magic_methods_are_async_functionss
z8AsyncMagicMethods.test_magic_methods_are_async_functionsN)rrrrrrrrr
r
r
rrs
	rc@s^eZdZGdddZGdddZGdddZddZd	d
ZddZd
dZ	ddZ
dS)AsyncContextManagerTestc@seZdZddZddZdS)z/AsyncContextManagerTest.WithAsyncContextManagercs
d|_|Sr)Zenteredrargskwargsr
r
rr&sz:AsyncContextManagerTest.WithAsyncContextManager.__aenter__cs
d|_dSr)Zexitedrr
r
rr*sz9AsyncContextManagerTest.WithAsyncContextManager.__aexit__N)rrrrrr
r
r
rWithAsyncContextManager%src@seZdZddZddZdS)z.AsyncContextManagerTest.WithSyncContextManagercOs|Srr
rr
r
rr.sz8AsyncContextManagerTest.WithSyncContextManager.__enter__cOsdSrr
rr
r
rr1sz7AsyncContextManagerTest.WithSyncContextManager.__exit__N)rrrrrr
r
r
rWithSyncContextManager-src@seZdZddZddZdS)z&AsyncContextManagerTest.ProductionCodecCs
d|_dSr)sessionrr
r
rr6sz/AsyncContextManagerTest.ProductionCode.__init__csJ|jd4IdH&}|IdH}|W5QIdHRSQIdHRXdS)Nzhttps://python.org)rpostjson)rresponsevalr
r
rrr9sz+AsyncContextManagerTest.ProductionCode.mainN)rrrrrrr
r
r
rProductionCode4src
sBfdd}ttfD](}d|||W5QRXqdS)Ncsl}tdd|_|dd}tdd}tddid|_||j_||jj_t	|
}|ddidS)NZsessionmocknameZmagic_cmrr{rA)rrrrrrrBrrr4rrrG)rZpcrrrrr
rr?s


zKAsyncContextManagerTest.test_set_return_value_of_aenter.<locals>.inner_testz%test set return value of aenter with rrr
rrtest_set_return_value_of_aenter>sz7AsyncContextManagerTest.test_set_return_value_of_aenterc
sBfdd}ttfD](}d|||W5QRXqdS)Ncsxd}||fdd}t|}jjjjjj|dS)NFc
s&4IdH
}dW5QIdHRX|Srr
rcalledZcm_mockr
ruse_context_managerTszqAsyncContextManagerTest.test_mock_supports_async_context_manager.<locals>.inner_test.<locals>.use_context_manager)	rrr4r(rrrrYZassertIsNot)rrrZ	cm_resultrrrrOs


zTAsyncContextManagerTest.test_mock_supports_async_context_manager.<locals>.inner_testz!test context manager magics with rrr
rr(test_mock_supports_async_context_managerNsz@AsyncContextManagerTest.test_mock_supports_async_context_managercsB|}t|t}|j_fdd}|t||dS)Ncs44IdH}|W5QIdHRSQIdHRXdSrr
r
mock_instancer
rrnsz^AsyncContextManagerTest.test_mock_customize_async_context_manager.<locals>.use_context_manager)rrr.rrBrrr4)rrhZexpected_resultrr
rr)test_mock_customize_async_context_managergszAAsyncContextManagerTest.test_mock_customize_async_context_managercslddfdd}fdd}|}t||_|_fdd}t|||dS)NFcsddSrr
r)enter_calledr
renter_coroutinexsziAsyncContextManagerTest.test_mock_customize_async_context_manager_with_coroutine.<locals>.enter_coroutinecsddSrr
r)exit_calledr
rexit_coroutine|szhAsyncContextManagerTest.test_mock_customize_async_context_manager_with_coroutine.<locals>.exit_coroutinec
s"4IdHW5QIdHRXdSrr
r
rr
rrszmAsyncContextManagerTest.test_mock_customize_async_context_manager_with_coroutine.<locals>.use_context_manager)rrrrrr4r()rrrrhrr
)rrrr8test_mock_customize_async_context_manager_with_coroutinets
zPAsyncContextManagerTest.test_mock_customize_async_context_manager_with_coroutinec	Cs@dd}|}t|}|tt||W5QRXdS)Nc
s(|4IdHtW5QIdHRXdSr)	TypeError)Zcontext_managerr
r
rraise_inszYAsyncContextManagerTest.test_context_manager_raise_exception_by_default.<locals>.raise_in)rrrirrr4)rrrhrr
r
r/test_context_manager_raise_exception_by_defaults
zGAsyncContextManagerTest.test_context_manager_raise_exception_by_defaultN)rrrrrrrrrrrr
r
r
rr$s

rc@s4eZdZGdddeZddZddZddZd	S)
AsyncIteratorTestc@s$eZdZddZddZddZdS)z#AsyncIteratorTest.WithAsyncIteratorcCsdddg|_dS)NrTZ	NormalFoobaz)itemsrr
r
rrsz,AsyncIteratorTest.WithAsyncIterator.__init__cCs|Srr
rr
r
rrsz-AsyncIteratorTest.WithAsyncIterator.__aiter__cs*z|jWStk
r YnXtdSr)r	pop
IndexErrorrrr
r
rrs
z-AsyncIteratorTest.WithAsyncIterator.__anext__N)rrrrrrr
r
r
rWithAsyncIteratorsrcsFtdddddgj_fdd}t|}||dddgdS)NZtesterrr@rDrEcsdd2IdHS)Ncsg|z3dHW}|q6Srr
).0ir
r
r
<listcomp>szOAsyncIteratorTest.test_aiter_set_return_value.<locals>.main.<locals>.<listcomp>r
r
Z	mock_iterr
rrrsz;AsyncIteratorTest.test_aiter_set_return_value.<locals>.main)rrrBrr4rG)rrrrr
rrtest_aiter_set_return_values

z-AsyncIteratorTest.test_aiter_set_return_valuec
sBfdd}ttfD](}d|||W5QRXqdS)Ncs\}||}t|jt|jt|jt|jdSr)rrrr)rr(r)rrhrrr
rrszIAsyncIteratorTest.test_mock_aiter_and_anext_asyncmock.<locals>.inner_testz%test aiter and anext corourtine with rrr
rr#test_mock_aiter_and_anext_asyncmocksz5AsyncIteratorTest.test_mock_aiter_and_anext_asyncmockc
sdddddgfdd}fdd	}fd
d}ttfD]p}d|||W5QRXd
|||W5QRXd|||W5QRXqHdS)Ncs&g}|2z3dHW}||q6|Sr)append)iteratorZaccumulatorrr
r
riteratesz6AsyncIteratorTest.test_mock_async_for.<locals>.iterateZFOOZBARZBAZcs&|}t|gdSr)rrGrr4rr)rrr
rtest_defaultsz;AsyncIteratorTest.test_mock_async_for.<locals>.test_defaultcs6|}dd|j_t|dSr)rrrBrGrr4rZexpectedrrr
rtest_set_return_valueszDAsyncIteratorTest.test_mock_async_for.<locals>.test_set_return_valuecs:|}tdd|j_t|dSr)riterrrBrGrr4rrr
rtest_set_return_value_iterszIAsyncIteratorTest.test_mock_async_for.<locals>.test_set_return_value_iterzdefault value with zset return_value with zset return_value iterator with r)rrrrrr
rrtest_mock_async_fors
z%AsyncIteratorTest.test_mock_async_forN)rrrr.rrrrr
r
r
rrsrc@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/S)0AsyncMockAssertcCst|_dSr)rrRrr
r
rsetUpszAsyncMockAssert.setUpcs|j||IdHdSr)rRrr
r
r_runnable_testszAsyncMockAssert._runnable_testcs
|IdHSrr
)r	coroutiner
r
r_await_coroutinesz AsyncMockAssert._await_coroutinec	Cstt}|t|W5QRX|t|j|j|j	|j
|t|
W5QRX|t|j
W5QRXdSr)rrrrrr(rr)
assert_calledassert_called_onceassert_called_once_withriAssertionErrorrYrQr
r
r"test_assert_called_but_not_awaiteds


z2AsyncMockAssert.test_assert_called_but_not_awaitedc	Cstt}|}|j|j|j|t|jW5QRXt	
|||j|j|j|j
dSr)rrrr"r#r$rir%rYrr4r!ryrz)rrRZmock_coroutiner
r
rtest_assert_called_then_awaiteds





z/AsyncMockAssert.test_assert_called_then_awaitedc	Csf|t|jW5QRX|t|jW5QRXt||j|j	dSr)
rir%rRrYr"rr4rr#ryrr
r
r+test_assert_called_and_awaited_at_same_time
s
z;AsyncMockAssert.test_assert_called_and_awaited_at_same_timec	Cstt}|}|t|W5QRX|t|jW5QRX|jt	
|||j|jdSr)
rrrrrrir%rYr"rr4r!ryrrRr r
r
r)test_assert_called_twice_and_awaited_onces

z9AsyncMockAssert.test_assert_called_twice_and_awaited_oncec	Cs^tt}|}|jt|||tt||W5QRX|j	dSr)
rrrr#rr4r!rirjrYr)r
r
r)test_assert_called_once_and_awaited_twice&s
z9AsyncMockAssert.test_assert_called_once_and_awaited_twicec	Cs|t|jW5QRX|t|jW5QRX|tt||jW5QRX|t|jW5QRX|t|jW5QRXdSr)	rir%rRrYr"rrr4r!rr
r
r"test_assert_awaited_but_not_called0sz2AsyncMockAssert.test_assert_awaited_but_not_calledc	Cs\tdg}|t|dW5QRX|j||t|j|W5QRXdSNrT)rrrrRZassert_has_callsrir%r)rZkallsr
r
r test_assert_has_calls_not_awaits>s
z0AsyncMockAssert.test_assert_has_calls_not_awaitsc	Cs|t|W5QRXddifg}||jj||t|d|dW5QRXttdtdg}||jj|dS)Nr
rTr)rrrRrG
mock_callsr)rkalls_empty
mock_kallsr
r
r0test_assert_has_mock_calls_on_async_mock_no_specGs
z@AsyncMockAssert.test_assert_has_mock_calls_on_async_mock_no_specc	Cstt}|t|W5QRXddifg}||jj|||jtg|t|jddddddW5QRXttddddddg}ttjddddddg}||jj|||j|dS)	Nr/r
r@rDrEr)r!r")rrrrrrGr0r)rZa_class_mockr1Zmethod_kallsr2r
r
r2test_assert_has_mock_calls_on_async_mock_with_specUszBAsyncMockAssert.test_assert_has_mock_calls_on_async_mock_with_specc	Cs|t*|jjddd|jjjdtjdW5QRX||jjddddifdd	d
tjifgd||jjjdd	d
tjifgddS)NrE)fishr)cake	something)rEr6zsomething_else.something)rr7z#method calls not recorded correctly)	rrrRr8Zsomething_elser	ZCakerGmethod_callsrr
r
r test_async_method_calls_recordedfs
z0AsyncMockAssert.test_async_method_calls_recordedc	sfdd}|jt&ddjddW5QRXj|jtt}t||jdddW5QRX|||dS)Ncs@d}|D]2}t||}|t|t|gqdS)N)rr9r0)getattrr;r
listrG)rRnamesrattrrr
rassert_attrsvs
z:AsyncMockAssert.test_async_arg_lists.<locals>.assert_attrsr@rDrE)r!)rRrrr}rrr)rr?rr
rrtest_async_arg_listsus


z$AsyncMockAssert.test_async_arg_listsc	Cs<|t|jW5QRXt||jdSr)rir%rRrYrr4rrr
r
rtest_assert_awaitedsz#AsyncMockAssert.test_assert_awaitedc	Csj|t|jW5QRXt||jt||t|jW5QRXdSr)rir%rRryrr4rrr
r
rtest_assert_awaited_onces
z(AsyncMockAssert.test_assert_awaited_oncec	Csd}|t||jdW5QRXt|d}|t||jdW5QRXt|d|jdt|d|t|jdW5QRXdS)NzNot awaitedrTzexpected await not found
SomethingElse)assertRaisesRegexr%rRr{rr4rri)rmsgr
r
rtest_assert_awaited_withsz(AsyncMockAssert.test_assert_awaited_withc	Cst|t|jdW5QRXt|d|jdt|d|t|jdW5QRXdSr-)rir%rRrzrr4rrr
r
rtest_assert_awaited_once_withsz-AsyncMockAssert.test_assert_awaited_once_withc	Cs|t|jdW5QRXt|d|t|jdW5QRXt|d|jdt|d|jddS)NrTrrC)rir%rRZassert_any_awaitrr4rrr
r
rtest_assert_any_waitsz$AsyncMockAssert.test_assert_any_waitc	Cstdtdg}|t}|j|W5QRX|t|jjdt	
|d|t|j|W5QRXt	
|d|t|j|W5QRXt	
|d|j|t	
|d|j|dS)NrTrr@rC)rrir%rRrrGlen	exceptionrrr4r)rcallsrr
r
rtest_assert_has_awaits_no_ordersz/AsyncMockAssert.test_assert_has_awaits_no_orderc	Cstdtdg}|t|jj|ddW5QRXt|d|t|jj|ddW5QRXt|d|t|jj|ddW5QRXt|d|jj|ddt|d|jj|dddS)NrTrT)Z	any_orderZbamfZqux)rrir%rRrrr4r)rrKr
r
rtest_assert_has_awaits_orderedsz.AsyncMockAssert.test_assert_has_awaits_orderedc	Cs<|jt||t|jW5QRXdSr)rRrwrr4rrir%rr
r
rtest_assert_not_awaiteds
z'AsyncMockAssert.test_assert_not_awaitedc	Csd	dd}t|d|_t|d|tdt	d}|j
tgW5QRX||j
j|tdt	d}|j
ttddgW5QRX||j
jtdS)
NcsdSrr
rr
r
rfrUzIAsyncMockAssert.test_assert_has_awaits_not_matching_spec_error.<locals>.frmr@z^{}$z6Awaits not found.
Expected: [call()]
Actual: [call(1)]zError processing expected awaits.
Errors: [None, TypeError('too many positional arguments')]
Expected: [call(), call(1, 2)]
Actual: [call(1)]rD)N)rrRrr4rrDr%formatreescaperrrtrJ	__cause__r;r)rrOrr
r
r.test_assert_has_awaits_not_matching_spec_errors.
"z>AsyncMockAssert.test_assert_has_awaits_not_matching_spec_errorN)rrrrrr!r&r'r(r*r+r,r.r3r5r:r@rArBrFrGrHrLrMrNrTr
r
r
rrs.
	r)&rr2rQZunittestZ
unittest.mockrrrrrrrr	r
rrrr r$r%r.r&rr8rZTestCaser'rIrPrcrrZIsolatedAsyncioTestCaserrrrrr
r
r
r<module>s0,

=!"Pc{&uL

Zerion Mini Shell 1.0