eKFSrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ r SSK r SSK J r J r Jr SSKJr SSKJrJr SSK Jr "SS \5r\"\5Vs1sHoR1S 5(aMUiM snrS r\rS rS rSrSr Sr!Sr"S~Sjr#Sr$Sr%Sr&Sr'S~Sjr(SSjr)Sr*Sr+Sr,"SS\-5r."SS \-5r/\/"5r0\0Rbr1\0Rdr3\0Rhr51S!kr6S"r7"S#S$\85r9S%r:"S&S'\-5r;"S(S)\-5r<"S*S+\<5r=\>"\"\=5Vs1sH,nUR1S,5(dMURS,5iM. sn5r@"S-S.\85rAS/rB"S0S1\<5rC"S2S3\C\=5rDS4rE"S5S6\-5rFS7rG\1SSSSS4SS8.S9jjrHSS:jrI\1SSSSS4SS8.S;jjrJ"S<S=\-5rKS>rLS?rM\H\Jl-\K\JlN\I\JlO\M\JlPS@\JlQSArRSBrSSCRSD\SR555rVSCRSE\SR555rW1SFkrXSGrYSCR\R\S\V\W/5R5Vs1sHnSHU-iM snrZ1SIkr[SJ1r\\[\\-r]\Z\X-r^\^\]-r_1SKkr`SLSMSNSOSP.ra\b\b\b\bSQSSSSRSSS SQSST. rcSUrdSVreSWrfSXrg\d\e\f\gSY.rhSZri"S[S\\<5rj"S]S^\j\=5rk"S_S`\j5rl"SaSb\j\D5rm"ScSd\<5rn\R"\"\ RS55rq\"\ 5rr"SeSf\<5rt"SgSh\t\l\D5ru"SiSj\-5rv\v"5rwSkrx"SlSm\y5rz\z"SSn9r{SSS8.Sojjr|Spr}"SqSr\-5r~\"\|5\"\wGR54rSqSqSsrSStjr"SuSv\D5r\0GRr"SwSx\<5r"SySz\\j\D5rS{r"S|S}5rgs snfs snfs snf!\sa SrqNf=f))Mock MagicMockpatchsentinelDEFAULTANYcallcreate_autospec AsyncMock ThreadingMock FILTER_DIRNonCallableMockNonCallableMagicMock mock_open PropertyMocksealN)iscoroutinefunction)CodeType ModuleType MethodType) safe_repr)wrapspartial)RLockc\rSrSrSrSrg)InvalidSpecError+z8Indicates that an invalid value was used as a mock spec.N__name__ __module__ __qualname____firstlineno____doc____static_attributes__r3/opt/imh/python3.13/lib/python3.13/unittest/mock.pyrr+sBr&r_Tc[U5(a[U[5(dg[US5(a [ US5n[ U5=(d [ R"U5$)NF__func__)_is_instance_mock isinstancer hasattrgetattrrinspect isawaitableobjs r' _is_async_objr37sPji&@&@sJc:& s # ?w':':3'??r&c>[USS5(a [U5$g)N__code__F)r.r)funcs r'_is_async_funcr7?stZ&&"4((r&c4[[U5[5$N) issubclasstyper r1s r'r+r+Fs d3i 11r&c~[U[5=(d' [U[5=(a [U[5$r9)r, BaseExceptionr;r:r1s r' _is_exceptionr>Ls-3 & A3@*S-"@r&cj[U[5(a[US5(a UR$U$Nmock)r, FunctionTypesr-rAr1s r' _extract_mockrCSs+#}%%'#v*>*>xx r&c[U[5(aU(dURnSnOa[U[[45(a$[U[5(aSnUR nO"[U[ 5(d URnU(a [US5nOUnU[R"U54$![a gf=f![a gf=f)z Given an arbitrary, possibly callable object, try to create a suitable signature object. Return a (reduced func, signature) tuple, or None. TN) r,r;__init__ classmethod staticmethodr*rB__call__AttributeErrorrr/ signature ValueError)r6 as_instanceeat_selfsig_funcs r'_get_signature_objectrO\s $k}} D; 5 6 6 dK ( (H}} m , , ==D4&W&&x000   s$ B<$C < C C  CCFc^[XU5mTcgTunmU4Sjn[X5 U[U5lT[U5lg)Nc*>TR"U0UD6 gr9bind)selfargskwargssigs r'checksig"_check_signature..checksig $!&!r&)rO_copy_func_detailsr;_mock_check_sig __signature__)r6rA skipfirstinstancerXrWs @r'_check_signaturer`sE  :C {ID#"t&!)DJ"DJr&c dSHn[X[X55 M g![a M+f=f)N)r r$__text_signature__r! __defaults____kwdefaults__)setattrr.rI)r6funcopy attributes r'r[r[s6   G(@ A     s ! //c[U[5(ag[U[[[45(a[ UR 5$[USS5bgg)NTrHF)r,r;rGrFr _callabler*r.r1s r'ririsJ#t# k:>??&&sJ%1 r&c2[U5[[4;$r9)r;listtupler1s r'_is_listrms 9u %%r&c[U[5(d[USS5SL$U4UR-H!nURR S5cM! g g)zpGiven an object, return True if the object is callable. For classes, return True if instances would be callable.rHNTF)r,r;r.__mro____dict__get)r2bases r'_instance_callablerssY c4 sJ-T99$ ==  Z ( 4% r&c^ [U[5n[XU5nUcU$Uunm U 4Sjn[XV5 URnUR 5(dSnX`S.nSU-n [ X5 Xn [XT 5 U $)Nc*>TR"U0UD6 gr9rRrUrVrWs r'rX _set_signature..checksigrZr&rf _checksig_rAzYdef %s(*args, **kwargs): _checksig_(*args, **kwargs) return mock(*args, **kwargs))r,r;rOr[r isidentifierexec _setup_func) rAoriginalr_r^resultr6rXnamecontextsrcrfrWs @r'_set_signaturers 8T*I "8y AF ~ ID#"t&   D     %4G $&* +C #mGs# Nr&c^ [U[5n[XU5unm U 4Sjn[XV5 URnX`S.nSU-n [ X5 Xn [ XT 5 [U 5 U $)Nc*>TR"U0UD6 gr9rRrvs r'rX&_set_async_signature..checksigrZr&rxzeasync def %s(*args, **kwargs): _checksig_(*args, **kwargs) return await mock(*args, **kwargs))r,r;rOr[r r{r|_setup_async_mock) rAr}r_ is_async_mockr^r6rXrrrrfrWs @r'_set_async_signaturersx 8T*I%h)DID#"t&   D%4G *,0 1C #mGs#g Nr&c^^TTlU4SjnU4SjnU4SjnU4SjnU4SjnU4SjnU4Sjn UU4Sjn S TlS TlSTl[ 5Tl[ 5Tl[ 5TlTRTlTRTl TRTl UTl UTl UTl U TlU TlUTlUTlUTlUTlTTlg) Nc(>TR"U0UD6$r9)assert_called_withrUrVrAs r'r'_setup_func..assert_called_with&&777r&c(>TR"U0UD6$r9) assert_calledrs r'r"_setup_func..assert_calleds!!42622r&c(>TR"U0UD6$r9)assert_not_calledrs r'r&_setup_func..assert_not_calleds%%t6v66r&c(>TR"U0UD6$r9)assert_called_oncers r'r'_setup_func..assert_called_oncerr&c(>TR"U0UD6$r9)assert_called_once_withrs r'r,_setup_func..assert_called_once_withs++TTR"U0UD6$r9)assert_has_callsrs r'r%_setup_func..assert_has_callss$$d5f55r&c(>TR"U0UD6$r9)assert_any_callrs r'r$_setup_func..assert_any_calls##T4V44r&c>[5Tl[5TlTR5 TRn[ U5(aUTLaUR5 gggr9) _CallList method_calls mock_calls reset_mock return_valuer+)retrfrAs r'r_setup_func..reset_mocksO({&[ "" S ! !#+ NN +6 !r&Fr)rAcalled call_count call_argsrcall_args_listrrr side_effect_mock_childrenrrrrrrrrr]_mock_delegate) rfrArWrrrrrrrrs `` r'r|r|sGL8378=65GNGG&[G$;G"G,,G**G!00G!3G&=G#/G-G#G)G 1G!3GG!Dr&c ^[RRTlSTlSTl[ 5TlU4SjnSHn[TU[X55 M g)Nrc<>[TRU5"U0UD6$r9)r.rA)attrrUrVrAs r'wrapper"_setup_async_mock..wrapper"styy$'888r&)assert_awaitedassert_awaited_onceassert_awaited_withassert_awaited_once_withassert_any_awaitassert_has_awaitsassert_not_awaited) asyncio coroutines _is_coroutine await_count await_argsrawait_args_listrer)rArrgs` r'rrsT ++99DDDO$;D 9,  i!<=,r&cSUSS-U:H$)N__%s__rrs r' _is_magicr4s d1Rj D ((r&c*\rSrSrSrSrSrSrSrg)_SentinelObjecti8z!A unique, named, sentinel object.cXlgr9rrTrs r'rE_SentinelObject.__init__:s r&c SUR-$Nz sentinel.%srrTs r'__repr___SentinelObject.__repr__=tyy((r&c SUR-$rrrs r' __reduce___SentinelObject.__reduce__@rr&rN) r r!r"r#r$rErrr%rr&r'rr8s'))r&rc*\rSrSrSrSrSrSrSrg) _SentineliDzAAccess attributes to return a named object, usable as a sentinel.c0Ulgr9 _sentinelsrs r'rE_Sentinel.__init__Fs r&cdUS:Xa[eURRU[U55$)N __bases__)rIr setdefaultrrs r' __getattr___Sentinel.__getattr__Is, ;  ))$0EFFr&cg)Nrrrs r'r_Sentinel.__reduce__Osr&rN) r r!r"r#r$rErrr%rr&r'rrDsKG r&r> _mock_namer _mock_parentr_mock_new_name_mock_new_parent_mock_side_effect_mock_return_valuecd[RU5 SU-nX4SjnX4Sjn[X#5$)N_mock_cLURnUc [X5$[X15$r9)rr.)rTr _the_namerWs r'_get"_delegating_property.._getds(!! ;4+ +s!!r&cXURnUcXRU'g[XBU5 gr9)rrpre)rTvaluerrrWs r'_set"_delegating_property.._setis(!! ;',MM) $ Cu %r&)_allowed_namesaddproperty)rrrrs r'_delegating_propertyras8t4I" $& D r&c \rSrSrSrSrSrg)ritc[U[5(d[RX5$[U5n[U5nX#:ag[ SX2- S-5HnXXB-nXQ:XdM g g)NFrT)r,rk __contains__lenrange)rTr len_valuelen_selfisub_lists r'r_CallList.__contains__vsn%&&$$T1 1J t9  q(.23Aak*H 4r&c@[R"[U55$r9)pprintpformatrkrs r'r_CallList.__repr__s~~d4j))r&rN)r r!r"r#rrr%rr&r'rrts  *r&rc8[U5n[U5(dgUR(d+UR(dURc UR bgUnUbXALagUR nUbMU(a XlX1lU(a XlX!lg)NFT)rCr+rrrr)parentrrnew_name_parents r'_check_and_set_parentr s % E U # #   U11    '    +G    **  !'' # r&c \rSrSrSrSrSrg) _MockIteric$[U5Ulgr9)iterr2)rTr2s r'rE_MockIter.__init__s 9r&c,[UR5$r9)nextr2rs r'__next___MockIter.__next__sDHH~r&r1N)r r!r"r#rErr%rr&r'r r s r&r c"\rSrSr\rSrSrSrg)BaseiNcgr9rrTrUrVs r'rE Base.__init__s r&r) r r!r"r#rrrrEr%rr&r'rrs  r&rc\rSrSrSr\"5rS.SjrS.SjrSr S/Sjr S0S jr S r S r S r\"\ \ \5r\S 5r\"S5r\"S5r\"S5r\"S5r\"S5rSrSr\"\\5rS1SSS.S\S\4SjjjrSrSrSrSr Sr!Sr"Sr#S r$S2S!jr%S"r&S#r'S$r(S%r)S&r*S'r+S(r,S/S)jr-S*r.S+r/S,r0S-r1g)3r iz A non-callable version of `Mock`NFc  U4n [U[5(d&U=(d UnUb[U5(a[U4n [URU SUR 05n[ [U5RU5nU$)Nr$) r:AsyncMockMixinr3r;r r$ _safe_superr __new__)clsspecrrspec_setr _spec_state _new_name _new_parent_spec_as_instance _eat_selfunsaferVbasesspec_argnewr_s r'rNonCallableMock.__new__ss#~..'4H# h(?(?'-3<<CKK(@A4<d..6&& D'C!$  r&cfURbXRlgXl[XSS5 g)NrR)rrrr )rTrs r'__set_return_value"NonCallableMock.__set_return_valueHs,    */4   ,&+ # !$tT :r&z1The value to be returned when the mock is called.cJURc [U5$UR$r9)rCr;rs r' __class__NonCallableMock.__class__Ts$    #: r&rrrrrcURnUc UR$URnUbF[U5(d6[ U[ 5(d![ U5(d[ U5nX!lU$r9)rrrcallabler,r r>)rT delegatedsfs r'__get_side_effect!NonCallableMock.__get_side_effectasb''  )) )  " " N8B<<"2y11-:K:K2B$& ! r&cR[U5nURnUcXlgXlgr9) _try_iterrrr)rTrr_s r'__set_side_effect!NonCallableMock.__set_side_effectls)% ''  %* "$) !r&rrrrc.Uc/n[U5U;agUR[U55 SUlSUlSUl[ 5Ul[ 5Ul[ 5UlU(a [Ul U(aSUl URR5H3n[U[5(d U[ LaM#UR#XUS9 M5 URn[%U5(aXPLaUR#U5 ggg)z-Restore the mock object to its initial state.NFrrg)idrKrrrrrrrrrrrvaluesr, _SpecState_deletedrr+)rTvisitedrrchildrs r'rNonCallableMock.reset_mockws ?G d8w  r$x  #+'k%K &-D # %)D "((//1E%,,0A   W[  Y2 %% S ! !co NN7 #'6 !r&c [UR5SS9HHup#URS5nUR5nUnUHn[ Xg5nM [ XeU5 MJ g)a2Set attributes on the mock through keyword arguments. Attributes plus return values and side effects can be set on child mocks using standard dot notation and unpacking a dictionary in the method call: >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock.configure_mock(**attrs)c*USRS5$)Nr.)count)entrys r'0NonCallableMock.configure_mock..sq1Dr&)keyrrN)sorteditemssplitpopr.re)rTrVargvalrUfinalr2rts r'r5NonCallableMock.configure_mocksbv||~$E FHC 99S>DHHJECc) C $Fr&c 6US;a [U5eURb(XR;d U[;a[SU-5eO[U5(a [U5eUR(dSUR(aXR;a3UR S5(d U[ ;a[U<SU<S35e[R URRU5nU[La [U5eUcESnURb[URU5nURXX1US9nX RU'Oe[U[ 5(aP[#UR$UR&UR(UR*UR,5nX RU'SSS5 U$![.a? UR0S=(d Un[/SU<S U<S U<S UR$<S 3 5ef=f!,(df  W$=f) N>r3rFzMock object has no attribute %r)assertassretasertaseertassrtz6 is not a valid assertion. Use a spec for the mock if z is meant to be an attribute.)rrrr"r#rCannot autospec attr from target , as it has already been mocked out. [target=, attr=rB)rIrF _all_magicsrr3 startswith_ATTRIB_DENY_LISTr _lockrrqrlr-r.rTr,rkr rr r_rrrrp)rTrr~r target_names r'rNonCallableMock.__getattr__s 4 4 & &    +---1D$%F%MNN2E t__ & &  $*<*<L^L^@^OPPTX\mTm$h''+h.KMNN " "((,,T2F!$T**##/$D$4$4d;E--% $..4##D)FJ// D, V__foo v{{F.4##D);#> (D"&-- "="EK*/x}&/*##'('&++CDDD/# "> s'B H $AF=%H =A HH  HcUR/nURnUnSnUS/:XaSnUbEUnURURU-5 SnURS:XaSnURnUbME[[ U55nUR =(d Sn[ U5S:aUSS;aUS- nXQS'SRU5$)NrrrRr8rAr)rRz().r)rrrKrkreversedrrjoin)rT _name_listr lastdot_firsts r'_extract_mock_name"NonCallableMock._extract_mock_names))* '' $ C!D   g44s: ;C%%-..G!(:./ *F z?Q !}M1# 1 wwz""r&cUR5nSnUS;aSU-nSnURb-SnUR(aSnX0RR-nS[ U5R<U<U<S[ U5<S3$) Nr8)rAzmock.z name=%rz spec=%rz spec_set=%r)rrCrDr r;ri)rTr name_string spec_strings r'rNonCallableMock.__repr__s&&( ( ($t+K    '$K~~, %(8(8(A(AAK J     tH   r&cL[(d[RU5$UR=(d /n[ [ U55n[ UR5nURR5VVs/sHupEU[LdMUPM nnnUVs/sHowRS5(aMUPM nnUVs/sH,owRS5(a[U5(dM*UPM. nn[[X-U-U-55$s snnfs snfs snf)z8Filter the output of `dir(mock)` to only useful members.r()r object__dir__rFrHr;rkrprryrlrrrxset)rTextras from_type from_dictm_namem_valuefrom_child_mockses r'rNonCallableMock.__dir__ sz>>$' '##)rT O ' *.*=*=*C*C*E(*Evh& *E (!*C 1c1BQ C )# 1c1B1Bq\ #c&,y8;KKLMM(D#s$<DDD9D)D!2D!c^^U[;a[RTX5$TR(a;TRb.UTR;aUTR ;a[ SU-5eU[;aSU-n[ U5eU[;aTRbUTR;a[ SU-5e[U5(d)[[T5U[X55 UmUU4SjnOb[TUSU5 [[T5X5 UTRU'O/US:XaUTlg[TX!U5(aUTRU'TR (a4[#TU5(d#TR%5SU3n[ SU35e['U[(5(aUTR U'g[RTX5$)Nz!Mock object has no attribute '%s'z.Attempting to set unsupported magic method %r.c>T"T/UQ70UD6$r9r)rUkwr}rTs r'ru-NonCallableMock.__setattr__..1sHT,GD,GB,Gr&r[rrz Cannot set )rr __setattr__rDrFrprI_unsupported_magicsrr+rer; _get_methodr rrCr,r-rr,r)rTrrmsg mock_namer}s` @r'rNonCallableMock.__setattr__s > !%%dD8 8nn!3!3!? ** *  % !Dt!KL L ( (BTIC % % [ !!-$d>P>P2P$%H4%OPP$U++T D+d*BC G&dE4>T D0,1##D) [ $D  $T5==,1##D)   WT4%8%82245Qtf=I ;yk!:; ; e\ * *"'DMM$  !!$44r&cU[;a>U[U5R;a%[[U5U5 XR;agURR U[ 5nXR;a [[U5RU5 OU[La [U5eU[ La URU [URU'gr9) rr;rpdelattrrrq_missingrr __delattr__rlrI)rTrr2s r'rNonCallableMock.__delattr__Is ; 44:+>+>#> DJ %==(!!%%dH5 ==  . : :4 @ H_ & & h ##D)$,D!r&cDUR=(d Sn[X1U5$r@)r_format_call_signaturerTrUrVrs r'_format_mock_call_signature+NonCallableMock._format_mock_call_signature[s(&%d&99r&cjSnURX5nURnUR"U6nXCXW4-$)Nz0expected %s not found. Expected: %s Actual: %s)rr)rTrUrVactionmessageexpected_stringr actual_strings r'_format_mock_failure_message,NonCallableMock._format_mock_failure_message`s>F::4HNN 88)D /AAAr&c:U(d UR$SnURSS5RS5nURnUHRnUR U5nUb[ U[ 5(a U$[U5nURnURnMT U$)a * If call objects are asserted against a method/function like obj.meth1 then there could be no name for the call object to lookup. Hence just return the spec_signature of the method/function being asserted against. * If the name is not empty then remove () and split by '.' to get list of names to iterate through the children until a potential match is found. A child mock is created only during attribute access so if we get a _SpecState then no attributes of the spec were accessed and can be safely exited. NrRr8rr)rEreplacerzrrqr,rkrC)rTrrWnameschildrenrns r'_get_call_signature_from_name-NonCallableMock._get_call_signature_from_namehs'' ' T2&,,S1&&DLL&E} 5* = = &e, //++ r&c[U[5(a$[U5S:aURUS5nO URnUbN[U5S:XaSnUupEOUup4nUR "U0UD6n[ X6RUR5$U$![anURS5sSnA$SnAff=f)z Given a call (or simply an (args, kwargs) tuple), return a comparison key suitable for matching with other calls. This is a best effort method which relies on the spec's signature, if available, or falls back on the arguments themselves. rrNr8) r,rlrrrErSrrUrV TypeErrorwith_traceback)rT_callrWrrUrV bound_callrs r' _call_matcherNonCallableMock._call_matchers eU # #E Q44U1X>C&&C ?5zQ$ f%*"F . XXt6v6 D//:3D3DEEL .''-- .s%1B B>#B93B>9B>cURS:waDSUR=(d S<SUR<SUR5<3n[U5eg)z/assert that the mock was never called. r Expected 'rAz"' to not have been called. Called  times.Nrr _calls_reprAssertionErrorrTrs r'r!NonCallableMock.assert_not_calledsK ??a oo//oo&&(*C!% % r&cjURS:Xa#SUR=(d S-n[U5eg)z6assert that the mock was called at least once rz"Expected '%s' to have been called.rAN)rrrrs r'rNonCallableMock.assert_calleds6 ??a 7OO-v/C % % r&cURS:XdDSUR=(d S<SUR<SUR5<3n[U5eg)z3assert that the mock was called only once. rrrAz#' to have been called once. Called rNrrs r'r"NonCallableMock.assert_called_oncesK!#oo//oo&&(*C!% % $r&cP^^^TRc)TRTT5nSnSU<SU<3n[U5eUUU4SjnTR[ TT4SS95nTRTR5nXC:wa*[ U[ 5(aUOSn[U"55Ueg)zassert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.Nz not called.z#expected call not found. Expected: Actual: c,>TRTT5nU$r9rrrUrVrTs r'_error_message:NonCallableMock.assert_called_with.._error_messages33D&ACJr&Ttwo)rrrr_Callr, Exception)rTrUrVexpectedactual error_messagercauses``` r'r"NonCallableMock.assert_called_withs >> !77fEH"F)M / / %%eT6N&EF##DNN3   *8Y ? ?HTE !12 = r&cURS:XdDSUR=(d S<SUR<SUR5<3n[U5eUR"U0UD6$)zaassert that the mock was called exactly once and that that call was with the specified arguments.rrrAz' to be called once. Called r)rrrrrrTrUrVrs r'r'NonCallableMock.assert_called_once_withs\!#oo//oo&&(*C!% %&&777r&c ^UVs/sHnTRU5PM nn[SU5S5n[U4SjTR55nU(duXF;aoUcSnO9SR UVs/sHn[ U[ 5(aUOSPM sn5n[US[U5S[TR535Ueg[U5n/n UHn URU 5 M U (a4[TR=(d S<S [U 5<S U<S 35Uegs snfs snf![a U RU 5 M}f=f) aWassert the mock has been called with the specified calls. The `mock_calls` list is checked for the calls. If `any_order` is False (the default) then the calls must be sequential. There can be extra calls before or after the specified calls. If `any_order` is True then the calls can be in any order, but they must all appear in `mock_calls`.c3T# UHn[U[5(dMUv M g7fr9r,r.0rs r' 3NonCallableMock.assert_has_calls..FAZ9-Eaa( (Nc3F># UHnTRU5v M g7fr9rrcrTs r'rrsM_d0033_!zCalls not found.z+Error processing expected calls. Errors: {} Expected: rrAz does not contain all of z in its call list, found z instead)rrrrformatr,rrrrkremoverKrKrrl) rTcalls any_orderrrr all_callsproblemr not_foundkalls ` r'r NonCallableMock.assert_has_callsss4995aD&&q)59FFMMT__MM (=0G ,-3V-5$7-5*4Ay)A)AAt$K-5$7.8%i !!*5!1 23!!*4??!; <>  O  D '  &  &*oo&?&?&+I&6 C   7:$7 '  & 'sD56#D:$D??EEc4UR[X4SS95n[U[5(aUOSnURVs/sHoPRU5PM nnU(dU[ U5;a UR X5n[SU-5Uegs snf)zassert the mock has been called with the specified arguments. The assert passes if the mock has *ever* been called, unlike `assert_called_with` and `assert_called_once_with` that only pass if the call is the most recent one.TrNz%s call not found)rrr,rr _AnyComparerrrrTrUrVrrrrrs r'rNonCallableMock.assert_any_calls %%eTN&EF&x;;151D1DE1DA$$Q'1DE HL$88">>tLO #o5 9FBc UR(a.SU;aSUS3OSnUR5U-n[U5eURS5nX@RS;a [ S0UD6$[ U5n[U[5(aU[;a[ nO[U[5(a8U[;d UR(aX@R;a[nOc[ nO\[U[5(d8[U[5(a[nO+[U[5(a[ nOUR"SnW"S0UD6$)a(Create the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made. For non-callable mocks the callable variant will be used (rather than any custom subclass).rrrrRr"rGrr)r,rrIrqrpr r;r:r_async_method_magicsr_all_sync_magicsrF CallableMixinrr rro)rTrrgrr"_typeklasss r'rTNonCallableMock._get_child_mocks   ,2bL!BvJ<(dI//1I=I + +FF;'  n5 5?r? "T  eY ' 'I9M,ME ~ . .--&&98J8J+J!!E=11%!566!E?33MM!$E{r{r&cXUR(dgS[UR5S3$)zRenders self.mock_calls as a string. Example: " Calls: [call(1), call(2)]." If self.mock_calls is empty, an empty string is returned. The output will be truncated if very long. r8z Calls: rr)rrrs r'rNonCallableMock._calls_reprEs'9T__56a88r&) rrrCrrrrrrr) NNNNNNr8NFNFFFFr9)r)2r r!r"r#r$rrrrEr:r?r4"_NonCallableMock__get_return_value"_NonCallableMock__set_return_value"_NonCallableMock__return_value_docrrr[rrrrrr!_NonCallableMock__get_side_effect!_NonCallableMock__set_side_effectrboolrr5rrrrrrrrrrrrrrrrrrTrr%rr&r'r r s`* GE=AEIBEI, 8*Z  #L 9r&r assert_c\rSrSrSrSrSrg)r iZzA list which checks if it contains a call which may have an argument of ANY, flipping the components of item and self from their traditional locations so that ANY is guaranteed to be on the left.c UHOn[U5[U5:Xde[[X5VVs/sH up4X4:HPM snn5(dMO g gs snnf)NTF)rallzip)rTitemrrrs r'r_AnyComparer.__contains___sdEt9E * **(+D(8(8$H"(8  sA rN)r r!r"r#r$rr%rr&r'r r Zs r&r cUcU$[U5(aU$[U5(aU$[U5$![a Us$f=fr9)r>rirrr1s r'rdrdjsO { S ~~ Cy  s 6 AAc P\rSrSrSS\SSSSSSS4 SjrSrSrSrSr S r S r g) riyNr8c vX0RS'[[U5R"XXVUXU 40U D6 X lg)Nr)rprrrEr) rTrrrrrr rr!r"r#rVs r'rECallableMixin.__init__{sB/; *+M4(11  K 39 'r&cgr9rrs r'r\CallableMixin._mock_check_sigs r&cnUR"U0UD6 UR"U0UD6 UR"U0UD6$r9)r\_increment_mock_call _mock_callrs r'rHCallableMixin.__call__s> d-f- !!4262///r&c&UR"U0UD6$r9)_execute_mock_callrs r'r.CallableMixin._mock_calls&&777r&cSUlU=RS- sl[X4SS9nX0lURR U5 UR SLnURnURnUS:HnURR [SX455 URnUbU(aMURR [XQU455 UR SLnU(aURS-U-n[XaU45n URR U 5 UR(a-U(aSn OSn URS:HnURU -U-nURnUbMgg)NTrrrRr8rr) rrrrrrKrrrrrr) rTrUrVrdo_method_callsmethod_call_namemock_call_name is_a_callr#this_mock_callrs r'r-"CallableMixin._increment_mock_callse  1 tn$/ ""5)++47??,,"d*  ub$%789++ %((//7Gv6V0WX"-":":$"F"'2'='='CFV'V$#N&#ABN  " " ) ). 9))CC'66$> !,!;!;c!AN!R&66K-%r&cURnUbS[U5(aUe[U5(d[U5n[U5(aUeOU"U0UD6nU[LaU$UR [La UR $UR(a)URR [La UR $URbUR"U0UD6$UR $r9) rr>rirrrrrr-)rTrUrVeffectr~s r'r1 CallableMixin._execute_mock_calls!!  V$$ v&&f (( L) 00W$  " "' 1$$ $   4#6#6#C#C7#R$$ $    '##T4V4 4   r&)rrr) r r!r"r#rrEr\rHr.r-r1r%rr&r'rrys8 d$d!RT ' 08,7\!r&rc\rSrSrSrSrg)ria Create a new `Mock` object. `Mock` takes several optional arguments that specify the behaviour of the Mock object: * `spec`: This can be either a list of strings or an existing object (a class or instance) that acts as the specification for the mock object. If you pass in an object then a list of strings is formed by calling dir on the object (excluding unsupported magic attributes and methods). Accessing any attribute not in this list will raise an `AttributeError`. If `spec` is an object (rather than a list of strings) then `mock.__class__` returns the class of the spec object. This allows mocks to pass `isinstance` tests. * `spec_set`: A stricter variant of `spec`. If used, attempting to *set* or get an attribute on the mock that isn't on the object passed as `spec_set` will raise an `AttributeError`. * `side_effect`: A function to be called whenever the Mock is called. See the `side_effect` attribute. Useful for raising exceptions or dynamically changing return values. The function is called with the same arguments as the mock, and unless it returns `DEFAULT`, the return value of this function is used as the return value. If `side_effect` is an iterable then each call to the mock will return the next value from the iterable. If any of the members of the iterable are exceptions they will be raised instead of returned. * `return_value`: The value returned when the mock is called. By default this is a new Mock (created on first access). See the `return_value` attribute. * `unsafe`: By default, accessing any attribute whose name starts with *assert*, *assret*, *asert*, *aseert*, or *assrt* raises an AttributeError. Additionally, an AttributeError is raised when accessing attributes that match the name of an assertion method without the prefix `assert_`, e.g. accessing `called_once` instead of `assert_called_once`. Passing `unsafe=True` will allow access to these attributes. * `wraps`: Item for the mock object to wrap. If `wraps` is not None then calling the Mock will pass the call through to the wrapped object (returning the real result). Attribute access on the mock will return a Mock object that wraps the corresponding attribute of the wrapped object (so attempting to access an attribute that doesn't exist will raise an `AttributeError`). If the mock has an explicit `return_value` set then calls are not passed to the wrapped object and the `return_value` is returned instead. * `name`: If the mock has a name then it will be used in the repr of the mock. This can be useful for debugging. The name is propagated to child mocks. Mocks can also be called with arbitrary keyword arguments. These will be used to set attributes on the mock after it is created. rNrrr&r'rrs7r&rcBSnUHnX ;dM [U<S35e g)N) autospect auto_specset_specz5 might be a typo; use unsafe=True if this is intended) RuntimeError)kwargs_to_checktypostypos r'_check_spec_arg_typosrF!s/ 2E  "(OP r&c\rSrSrSr/rSS.SjrSrSrSr \ RS 5r S r S rS rS rSrSrSrSrg)_patchi*NFr&c Ub"U[La [S5eUb [S5eU (d [U 5 [U5(a[ SU<SU<S35e[U5(a[ SU<SU<S35eXlX lX0lXlX@l XPl SUl X`l Xpl Xl/UlSUlg)Nz,Cannot use 'new' and 'new_callable' togetherz1Cannot use 'autospec' and 'new_callable' togetherzCannot spec attr z0 as the spec has already been mocked out. [spec=rBz? as the spec_set target has already been mocked out. [spec_set=F)rrKrFr+rgetterrgr) new_callablercreate has_localr autospecrVadditional_patchers is_started) rTrKrgr)rrMr rOrLrVr&s r'rE_patch.__init__/s  #'! B# G !& ) T " ""#I=166:XQ@A A X & &"#I=1AAI AOP P "(     #% r&c j[URURURURUR UR URURUR5 nURUl URVs/sHo"R5PM snUl U$s snfr9) rHrKrgr)rrMr rOrLrVattribute_namerPcopy)rTpatcherps r'rU _patch.copyUs KK499 KK MM4,,dkk  "&!4!4"66' 6FFH6' #' s B0c[U[5(aURU5$[R"U5(aUR U5$UR U5$r9r,r;decorate_classr/rdecorate_async_callabledecorate_callable)rTr6s r'rH_patch.__call__bsS dD ! !&&t, ,  & &t , ,//5 5%%d++r&c[U5HinUR[R5(dM)[ X5n[ US5(dMGUR 5n[XU"U55 Mk U$NrH)rHrr TEST_PREFIXr.r-rUre)rTrr attr_valuerVs r'r[_patch.decorate_classjscJD??5#4#455 -J:z22iikG E!4 5 r&c#h# /n[R"5nURHZnURU5nURbUR U5 M4UR [LdMIURU5 M\ U[U5- nX#4v SSS5 g!,(df  g=f7fr9) contextlib ExitStack patchings enter_contextrTupdater)rrKrl)rTpatchedrUkeywargs extra_args exit_stackpatchingr|s r'decoration_helper_patch.decoration_helperxs  ! ! #z#-- ..x8**6OOC(\\W,%%c* . E*% %D" "$ # #s#B2AB!0(B! B2! B/+B2c^^^[TS5(aTRRT5 T$[T5UUU4Sj5mT/TlT$)Nrgct>TRTUU5up#T"U0UD6sSSS5 $!,(df  g=fr9rorUrknewargs newkeywargsr6rjrTs r'rj)_patch.decorate_callable..patcheds;''(,(025KgW4 4222s ) 7r-rgrKrrTr6rjs``@r'r]_patch.decorate_callablesN 4 % % NN ! !$ 'K t 5  5 "Fr&c^^^[TS5(aTRRT5 T$[T5UUU4Sj5mT/TlT$)Nrgc># TRTUU5up#T"U0UD6IShvN sSSS5 $N !,(df  g=f7fr9rsrts r'rj/_patch.decorate_async_callable..patchedsJ''(,(025Kg!7:k::22;22s$A535 A5 AArxrys``@r'r\_patch.decorate_async_callablesN 4 % % NN ! !$ 'K t ;  ; "Fr&cdUR5nURn[nSnURUnSnU[;a[U[5(aSUl UR(dU[La[ U<SU<35eX44$![[ 4a [ X[5nNwf=f)NFTz does not have the attribute ) rKrgrrprIKeyErrorr. _builtinsr,rrM)rTtargetrr}locals r' get_original_patch.get_originals~~ t,HE 9 FJ!?!?DK{{x72 7=tD ) 6vW5H 6sB B/.B/c J UR(a [S5eURURURp2nUR UR pTURnUR5Ul USLaSnUSLaSnUSLaSnUbUb [S5eUcUbUS;a [S5eUR5upxU[LGaUGcSn USLa UnUSLaUnSnOUb USLaUnSnOUSLaUnUcUb+U[La [S5e[U[5(aSn UbUn OUc[U5(a[ n OeUcUbYUn UbUn [#U 5(aS U ;n O[%U 5(+n [U 5(a[ n OU (a[&n O [(n O[(n 0n UbX-S 'UbX=S '[U [5(a5[+U [,5(a UR.(aUR.U S 'U R1U5 U "S0U D6nU (a^[3U5(aNUn UbUn [#U 5(d[5U 5(d[&n U R7S 5 U "SUS S.U D6UlGOUbU[La [S5eU[La [S5e[;U5nUSLaUn[3UR5(a,[=SUR.<SUR<SU<S35e[3U5(aQ[?URSUR5n[=SUR.<SU<SUR<SU<S3 5e[AU4UUR.S.UD6nOU(a [S5eUnXpl!Xl"[FRH"5Ul%SUl[MURUR.U5 URNbz0nUR[LaUUURN'URPHDnURJRSU5nUR[LdM3UR1U5 MF U$U$! URT"[VRX"56(deg=f)zPerform the patch.zPatch is already startedFNzCan't specify spec and autospec)TNz6Can't provide explicit spec_set *and* spec or autospecTz!Can't use 'spec' with create=TruerHrr rrRrSzBautospec creates the mock for you. Can't specify autospec and new.z%Can't use 'autospec' with create=Truerz: as the patch target has already been mocked out. [target=rrBr rr)r _namez.Can't pass kwargs to a mock we aren't creatingr)-rQrBr)rr rOrVrLrKrrrrr,r;r3r rmr^rrr:r rgrir+rsr{rrrr.r temp_originalis_localrerf _exit_stackrerTrPrh__exit__sysexc_info)rTr)rr rOrVrLr}rinheritKlass this_spec not_callable_kwargsrnew_attrrlrnr|s r' __enter___patch.__enter__s ??9: :"hh 4==8==$++&(( kkm  5=D u H u H   4=> >  !5 L (TU U++- '>h.Gt|t#'HD!t##HDT!#8#7w&#$GHHh--"G'$-"9"9!!X%9 ' (II&&#-Y#>L'/ ':#:L ++%E!0E%E!G"&#&. #5$''5/22t~~"&.. NN6 ""'"C,S11! ' (I ++&y110E F##($4SD$4+2$4  !'!(7" GHHH~H4# --&+DNN+=>#{{oWXLCDD!**%dkk:t{{K &+DNN+=]"o&#{{oWXLCDD "(BX(,B:@BC LM M% %//1  DKK :"". 88w&7:Jt223 $ 8 8H**88BC||w."))#.!9"!J ==#,,.12s B Q6Q64Q66*R"c<UR(dgUR(a?UR[La,[ UR UR UR5 O[UR UR 5 UR(d`[UR UR 5(aUR S;a+[ UR UR UR5 U?U?U?URnU? SUlUR"U6$)zUndo the patch.N)r$r!rc__annotations__rdF) rQrrrrerrgrrMr-rr)rTrrms r'r_patch.__exit__[s  ==T//w> DKK1C1C D DKK 0;; T^^(L(L+== T^^T5G5GH   M K%%  ""H--r&c\UR5nURRU5 U$z-Activate a patch, returning any created mock.)r_active_patchesrKrTr~s r'start _patch.startts'! ##D) r&cURRU5 URSSS5$![a gf=fzStop an active patch.N)rrrKrrs r'stop _patch.stop{sD   ' ' - }}T4..   s 0 ==)rrPrgrOrMrKrNrrQrVr)rLrr rr)r r!r"r#rTrrErUrHr[recontextmanagerror]r\rrrrrr%rr&r'rHrH*sgNOAF# L ,  # #""0Xt.2/r&rHcURSS5up[ [ R U5U4$![[[4a [SU<35ef=f)Nrrrz,Need a valid target to patch. You supplied: )rsplitrrKrIrpkgutil resolve_name)rrgs r' _get_targetrshG"MM#q1 7'' 0) ;; z> 2G:6* EG GGs 2%ArIc n^[T5[La[T<S35eU4Sjn [XX#UXVXyUS9 $)a patch the named member (`attribute`) on an object (`target`) with a mock object. `patch.object` can be used as a decorator, class decorator or a context manager. Arguments `new`, `spec`, `create`, `spec_set`, `autospec` and `new_callable` have the same meaning as for `patch`. Like `patch`, `patch.object` takes arbitrary keyword arguments for configuring the mock object it creates. When used as a class decorator `patch.object` honours `patch.TEST_PREFIX` for choosing which methods to wrap. z3 must be the actual object to be patched, not a strc>T$r9rrsr'ru_patch_object..sVr&rI)r;strrrH) rrgr)rrMr rOrLr&rVrKs ` r' _patch_objectrsK$ F|sjK L  F 3fL r&c x^[T5[La[[RT5nOU4SjnU(d [ S5e[ UR55nUSup[XyXX#XE05 n Xl USSH5up[XyXX#XE05 n Xl U RRU 5 M7 U $)aPerform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches:: with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'): ... Use `DEFAULT` as the value if you want `patch.multiple` to create mocks for you. In this case the created mocks are passed into a decorated function by keyword, and a dictionary is returned when `patch.multiple` is used as a context manager. `patch.multiple` can be used as a decorator, class decorator or a context manager. The arguments `spec`, `spec_set`, `create`, `autospec` and `new_callable` have the same meaning as for `patch`. These arguments will be applied to *all* patches done by `patch.multiple`. When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX` for choosing which methods to wrap. c>T$r9rrsr'ru!_patch_multiple..sr&z=Must supply at least one keyword argument with patch.multiplerrN) r;rrrrrKrkryrHrTrPrK) rrrMr rOrLrVrKryrgr)rV this_patchers ` r'_patch_multiplers, F|s--v6  K    E1XNI3fG')  s& B '0###**<8 $ Nr&c 8[U5up[XXUXEXhUS9 $)aV `patch` acts as a function decorator, class decorator or a context manager. Inside the body of the function or with statement, the `target` is patched with a `new` object. When the function/with statement exits the patch is undone. If `new` is omitted, then the target is replaced with an `AsyncMock if the patched object is an async function or a `MagicMock` otherwise. If `patch` is used as a decorator and `new` is omitted, the created mock is passed in as an extra argument to the decorated function. If `patch` is used as a context manager the created mock is returned by the context manager. `target` should be a string in the form `'package.module.ClassName'`. The `target` is imported and the specified object replaced with the `new` object, so the `target` must be importable from the environment you are calling `patch` from. The target is imported when the decorated function is executed, not at decoration time. The `spec` and `spec_set` keyword arguments are passed to the `MagicMock` if patch is creating one for you. In addition you can pass `spec=True` or `spec_set=True`, which causes patch to pass in the object being mocked as the spec/spec_set object. `new_callable` allows you to specify a different class, or callable object, that will be called to create the `new` object. By default `AsyncMock` is used for async functions and `MagicMock` for the rest. A more powerful form of `spec` is `autospec`. If you set `autospec=True` then the mock will be created with a spec from the object being replaced. All attributes of the mock will also have the spec of the corresponding attribute of the object being replaced. Methods and functions being mocked will have their arguments checked and will raise a `TypeError` if they are called with the wrong signature. For mocks replacing a class, their return value (the 'instance') will have the same spec as the class. Instead of `autospec=True` you can pass `autospec=some_object` to use an arbitrary object as the spec instead of the one being replaced. By default `patch` will fail to replace attributes that don't exist. If you pass in `create=True`, and the attribute doesn't exist, patch will create the attribute for you when the patched function is called, and delete it again afterwards. This is useful for writing tests against attributes that your production code creates at runtime. It is off by default because it can be dangerous. With it switched on you can write passing tests against APIs that don't actually exist! Patch can be used as a `TestCase` class decorator. It works by decorating each test method in the class. This reduces the boilerplate code when your test methods share a common patchings set. `patch` finds tests by looking for method names that start with `patch.TEST_PREFIX`. By default this is `test`, which matches the way `unittest` finds tests. You can specify an alternative prefix by setting `patch.TEST_PREFIX`. Patch can be used as a context manager, with the with statement. Here the patching applies to the indented block after the with statement. If you use "as" then the patched object will be bound to the name after the "as"; very useful if `patch` is creating a mock object for you. Patch will raise a `RuntimeError` if passed some common misspellings of the arguments autospec and spec_set. Pass the argument `unsafe` with the value True to disable that check. `patch` takes arbitrary keyword arguments. These will be passed to `AsyncMock` if the patched object is asynchronous, to `MagicMock` otherwise or to `new_callable` if specified. `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are available for alternate use-cases. rI)rrH) rr)rrMr rOrLr&rVrKrgs r'rrs-V$F+F 3fL r&c^\rSrSrSrSSjrSrSrSrSr Sr S r S r S r S rS rSrg) _patch_dicti0a Patch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test. `in_dict` can be a dictionary or a mapping like container. If it is a mapping then it must at least support getting, setting and deleting items plus iterating over keys. `in_dict` can also be a string specifying the name of the dictionary, which will then be fetched by importing it. `values` can be a dictionary of values to set in the dictionary. `values` can also be an iterable of `(key, value)` pairs. If `clear` is True then the dictionary will be cleared before the new values are set. `patch.dict` can also be called with arbitrary keyword arguments to set values in the dictionary:: with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()): ... `patch.dict` can be used as a context manager, decorator or class decorator. When used as a class decorator `patch.dict` honours `patch.TEST_PREFIX` for choosing which methods to wrap. c Xl[U5UlURRU5 X0lSUlgr9)in_dictdictrjriclear _original)rTrrjrrVs r'rE_patch_dict.__init__Ms0 6l  6" r&c[U[5(aURU5$[R"U5(aUR U5$UR U5$r9rZ)rTfs r'rH_patch_dict.__call__VsS a  &&q) )  & &q ) )//2 2%%a((r&c4^^[T5UU4Sj5nU$)Nc>TR5 T"U0UD6TR5 $!TR5 f=fr9r _unpatch_dictrUrrrTs r'_inner-_patch_dict.decorate_callable.._inner_s8     %$~"~""$""$s+=rrTrrs`` r'r]_patch_dict.decorate_callable^ q %  % r&c4^^[T5UU4Sj5nU$)Nc># TR5 T"U0UD6IShvN TR5 $N!TR5 f=f7fr9rrs r'r3_patch_dict.decorate_async_callable.._innerksC     %^^+""$,""$s%A  757A 7A  A rrs`` r'r\#_patch_dict.decorate_async_callablejrr&c0[U5Hn[X5nUR[R5(dM4[ US5(dMG[ URURUR5nU"U5n[XU5 M U$r`) rHr.rrrar-rrrjrre)rTrrrb decorator decorateds r'r[_patch_dict.decorate_classvsqJD -J 1 122Z00' dkk4::N %j1 Y/  r&c:UR5 UR$)zPatch the dict.)rrrs r'r_patch_dict.__enter__s ||r&cURn[UR[5(a%[R "UR5UlURnUR nUR5nX@l U(a [U5 URU5 g![a 0nUH nX%XE'M NHf=f![a UH nXX%'M gf=fr9) rjr,rrrrrrUrIr _clear_dictri)rTrjrrr}rws r'r_patch_dict._patch_dicts dllC ( ("// =DL,,  -||~H"    + NN6 " -H '    - +%{  +s$*B%C%CCC"!C"cURnURn[U5 URU5 g![a UH nX#X'M gf=fr9)rrrrirI)rTrr}rws r'r_patch_dict._unpatch_dictsO,,>>G - NN8 $ -'}   -s7AAc>URbUR5 g)zUnpatch the dict.F)rr)rTrUs r'r_patch_dict.__exit__s >> %    r&cdUR5n[RRU5 U$r)rrHrrKrs r'r_patch_dict.starts'!%%d+ r&c[RRU5 UR SSS5$![a gf=fr)rHrrrKrrs r'r_patch_dict.stopsD   " " ) )$ / }}T4..   s4 AA)rrrrjN)rF)r r!r"r#r$rErHr]r\r[rrrrrrr%rr&r'rr0s>8)   +8 -/r&rcrUR5 g![a [U5nUHnX M gf=fr9)rrIrk)rkeysrws r'rrs7  G}C s  66cd[[R5HnUR5 M g)z7Stop all active patches. LIFO to unroll nested patches.N)rrHrr)rs r'_patch_stopallrs &001 2r&testzlt le gt ge eq ne getitem setitem delitem len contains iter hash str sizeof enter exit divmod rdivmod neg pos abs invert complex int float index round trunc floor ceil bool next fspath aiter zDadd sub mul matmul truediv floordiv mod lshift rshift and xor or pow c#,# UH nSU-v M g7f)zi%sNrrns r'rrs7&6519&6c#,# UH nSU-v M g7f)zr%sNrrs r'rrs5$4q$4r>r__get____set__r __delete__ __format__r __missing__ __getstate__ __reversed__ __setstate__ __getformat__ __reduce_ex____getnewargs____subclasses____getinitargs____getnewargs_ex__c ^U4SjnXlU$)z:Turns a callable object (like a mock) into a real functionc>T"U/UQ70UD6$r9r)rTrUrr6s r'method_get_method..methodsD&4&2&&r&)r )rr6rs ` r'rrs'O Mr&r> __aexit__ __anext__ __aenter__ __aiter__>__del__rrEr __prepare__r__instancecheck____subclasscheck__c,[RU5$r9)r__hash__rs r'rurus V__T2r&c,[RU5$r9)r__str__rs r'ruru s FNN40r&c,[RU5$r9)r __sizeof__rs r'ruru!sv006r&cj[U5RSUR5S[U53$)N/)r;r rrirs r'ruru"s3$t*"5"5!6a8O8O8Q7RRSTVW[T\S]^r&)rrr  __fspath__ry?g?) __lt____gt____le____ge____int__r__len__r __complex__ __float____bool__ __index__rc^U4SjnU$)Nc^>TRRnU[LaU$TULag[$NT)__eq__rrNotImplemented)otherret_valrTs r'r_get_eq..__eq__7s/++00 ' !N 5=r&r)rTrs` r'_get_eqr 6s Mr&c^U4SjnU$)Ncb>TRR[La[$TULag[$NF)__ne__rrr)rrTs r'r$_get_ne..__ne__As* ;; ) ) 8N 5=r&r)rTr$s` r'_get_ner&@s Mr&c^U4SjnU$)Ncn>TRRnU[La [/5$[U5$r9)__iter__rrrrrTs r'r)_get_iter..__iter__Js/--22 g 8OG}r&r)rTr)s` r' _get_iterr,Is Or&c^U4SjnU$)Nc>TRRnU[La[[ /55$[[ U55$r9)rrr_AsyncIteratorrr*s r'r"_get_async_iter..__aiter__Ts8..33 g !$r(+ +d7m,,r&r)rTrs` r'_get_async_iterr1Ss- r&)rr$r)rc[RU[5nU[LaX1lg[RU5nUbU"U5nXQlg[ RU5nUbU"U5Ulggr9)_return_valuesrqrr_calculate_return_value_side_effect_methodsr)rArrfixedreturn_calculatorr side_effectors r'_set_return_valuer9dsw   tW -E G#/33D9$(. *(,,T2M *40!r&c \rSrSrSrSrSrg) MagicMixinivcUR5 [[U5R"U0UD6 UR5 gr9)_mock_set_magicsrr;rE)rTrUrs r'rEMagicMixin.__init__ws4 J%..;; r&c [[-nUn[USS5bXURUR5n[ 5nX- nUH)nU[ U5R;dM[X5 M+ U[ [ U5R5- n[ U5nUHn[XT[X@55 M g)NrF) _magicsrr. intersectionrFrr;rprre MagicProxy)rT orig_magics these_magics remove_magicsrtrs r'r=MagicMixin._mock_set_magics}s 44 " 4$ / ;&33D4F4FGLEM'6M&DJ///D(' $c$t**=*=&>> T !E E*U"9 :"r&rN)r r!r"r#rEr=r%rr&r'r;r;vs  ;r&r;c"\rSrSrSrSSjrSrg)riz-A version of `MagicMock` that isn't callable.cFURX5 UR5 gr=r4r=r>s r'r?"NonCallableMagicMock.mock_add_spec D+ r&rNr)r r!r"r#r$r?r%rr&r'rrs 7 r&rc\rSrSrSrg)AsyncMagicMixinirN)r r!r"r#r%rr&r'rMrMsr&rMcF^\rSrSrSrS SjrSS.S\4U4SjjjrSrU=r $) riah MagicMock is a subclass of Mock with default implementations of most of the magic methods. You can use MagicMock without having to configure the magic methods yourself. If you use the `spec` or `spec_set` arguments then *only* magic methods that exist in the spec will be created. Attributes and the return value of a `MagicMock` will also be `MagicMocks`. FcFURX5 UR5 gr=rIr>s r'r?MagicMock.mock_add_specrKr&)rrc>U(a-UR(a[UR5(aSn[5R"USU0UD6 g)NFr)rrsuperr)rTrrUrVr[s r'rMagicMock.reset_mocks= $//** !L DF|FvFr&rr) r r!r"r#r$r?rrr% __classcell__r[s@r'rrs&  9> G G Gr&rc*\rSrSrSrSrSSjrSrg)rBicXlX lgr9rr)rTrrs r'rEMagicProxy.__init__s   r&cURnURnURXUS9n[X!U5 [ X#U5 U$)N)rr"r#)rrrTrer9)rTrtrms r' create_mockMagicProxy.create_mocksG   " "/5 # 7q!&U+r&Nc"UR5$r9)r\)rTr2rs r'rMagicProxy.__get__s!!r&rXr9)r r!r"r#rEr\rr%rr&r'rBrBs"r&rBc^\rSrSr\"S5r\"S5r\"S5rU4SjrSr Sr Sr S r S r S rSS jrS rU4SjrSrU=r$)rirrrc>[5R"U0UD6 [RRUR S'SUR S'SUR S'[ 5UR S'[(a4[[S9n[UR S'[UR S'O [[S9n[R[R-[R-UlSUlS UlSUlSUlX0R S 'S UR S '[)5UR S '0UR S'SUR S'g)Nrr_mock_await_count_mock_await_args_mock_await_args_listr rCrE)rUrVr5r r rcrdr)rRrErrrrpr _CODE_SIGr _CODE_ATTRSrr/ CO_COROUTINE CO_VARARGSCO_VARKEYWORDSco_flags co_argcount co_varnamesco_posonlyargcountco_kwonlyargcountrl)rTrUrV code_mockr[s r'rEAsyncMockMixin.__init__s4 $)&)*1););)I)I o&-. )*,0 ()1: -. 9'=I08I  } -4=I  0 1':I     !$$ %  !"  2 '( $&' #$- j!$/ j!(- n%*, &'+/ '(r&c# [X4SS9nU=RS- slX0lURR U5 UR nUbu[ U5(aUe[U5(d[U5n[ U5(aUeO)[U5(aU"U0UD6IShvN nOU"U0UD6nU[LaU$UR[La UR$URbF[UR5(aUR"U0UD6IShvN $UR"U0UD6$UR$![a [ef=fNN87f)NTrr)rrrrrKrr>rir StopIterationStopAsyncIterationrrrrr-)rTrUrVrr;r~s r'r1!AsyncMockMixin._execute_mock_call s^tn$/ A ##E*!!  V$$ v&&-!&\F !(( L)$V,,%t6v6600W$  " "' 1$$ $    '"4#3#344!--t>v>>>##T4V4 4   -%--,-7?s=A3E6 E.E/E0A3E#E$"EEEEclURS:Xa$SUR=(d SS3n[U5eg)z1 Assert that the mock was awaited at least once. r Expected rAz to have been awaited.Nrrrrs r'rAsyncMockMixin.assert_awaited- s;   q doo788NOC % % !r&cURS:Xd1SUR=(d SSURS3n[U5eg)z0 Assert that the mock was awaited exactly once. rrwrA$ to have been awaited once. Awaited rNrxrs r'r"AsyncMockMixin.assert_awaited_once5 sM1$t8&9:#//09C % %%r&c@^^^TRc!TRTT5n[SUS35eUUU4SjnTR[ TT4SS95nTRTR5nXS:wa*[ U[ 5(aUOSn[U"55Ueg)z> Assert that the last await was with the specified arguments. NzExpected await: z Not awaitedc*>TRTTSS9nU$)Nawait)rrrs r'r:AsyncMockMixin.assert_awaited_with.._error_messageF s33D&3QCJr&Tr)rrrrrr,r)rTrUrVrrrrs``` r'r"AsyncMockMixin.assert_awaited_with> s ?? "77fEH #3H:]!KL L %%eT6N&EF##DOO4   *8Y ? ?HTE !12 = r&cURS:Xd1SUR=(d SSURS3n[U5eUR"U0UD6$)zQ Assert that the mock was awaited exactly once and with the specified arguments. rrwrAr{r)rrrrrs r'r'AsyncMockMixin.assert_awaited_once_withP s^ 1$t8&9:#//09C % %''888r&c4UR[X4SS95n[U[5(aUOSnURVs/sHoPRU5PM nnU(dU[ U5;a UR X5n[SU-5Uegs snf)zE Assert the mock has ever been awaited with the specified arguments. TrNz%s await not found)rrr,rrr rrr s r'rAsyncMockMixin.assert_any_await[ s%%eTN&EF&x;;151E1EF1EA$$Q'1EF HL$88">>tLO $6 9Gr c z^UVs/sHnTRU5PM nn[SU5S5n[U4SjTR55nU(dlXF;afUcSnO9SR UVs/sHn[ U[ 5(aUOSPM sn5n[US[U5STR35Ueg[U5n/n UHn URU 5 M U (a[[U 5<S35Uegs snfs snf![a U RU 5 Mbf=f) at Assert the mock has been awaited with the specified calls. The :attr:`await_args_list` list is checked for the awaits. If `any_order` is False (the default) then the awaits must be sequential. There can be extra calls before or after the specified awaits. If `any_order` is True then the awaits can be in any order, but they must all appear in :attr:`await_args_list`. c3T# UHn[U[5(dMUv M g7fr9rrs r'r3AsyncMockMixin.assert_has_awaits..u rrNc3F># UHnTRU5v M g7fr9rrs r'rrv s!S>Rt11!44>RrzAwaits not found.z,Error processing expected awaits. Errors: {}rz Actual: z not all found in await list) rrrrrr,rrrkrrKrKrl) rTrrrrr all_awaitsrrrrs ` r'r AsyncMockMixin.assert_has_awaitsh s]4995aD&&q)59FFMSd>R>RSS )=1G ,-3V-5$7-5*4Ay)A)AAt$K-5$7.8%i !!*5!1 23#3346  *%  D '!!$'  49)4DF  7:$7 '  & 'sD6#DDD:9D:cURS:wa1SUR=(d SSURS3n[U5eg)z) Assert that the mock was never awaited. rrwrAz# to not have been awaited. Awaited rNrxrs r'r!AsyncMockMixin.assert_not_awaited sM   q t8&9:#//09C % % !r&ct>[5R"U0UD6 SUlSUl[ 5Ulg) See :func:`.Mock.reset_mock()` rN)rRrrrrrrTrUrVr[s r'rAsyncMockMixin.reset_mock s3 D+F+({r&)rrrr)r r!r"r#rrrrrEr1rrrrrrrrr%rTrUs@r'rrs\&}5K%l3J*+<=O0B&!P&&>$ 9 *X&++r&rc\rSrSrSrSrg)r i a Enhance :class:`Mock` with features allowing to mock an async function. The :class:`AsyncMock` object will behave so the object is recognized as an async function, and the result of a call is an awaitable: >>> mock = AsyncMock() >>> iscoroutinefunction(mock) True >>> inspect.isawaitable(mock()) True The result of ``mock()`` is an async function which will have the outcome of ``side_effect`` or ``return_value``: - if ``side_effect`` is a function, the async function will return the result of that function, - if ``side_effect`` is an exception, the async function will raise the exception, - if ``side_effect`` is an iterable, the async function will return the next value of the iterable, however, if the sequence of result is exhausted, ``StopIteration`` is raised immediately, - if ``side_effect`` is not defined, the async function will return the value defined by ``return_value``, hence, by default, the async function returns a new :class:`AsyncMock` object. If the outcome of ``side_effect`` or ``return_value`` is an async function, the mock async function obtained when the mock object is called will be this async function itself (and not an async function returning an async function). The test author can also specify a wrapped object with ``wraps``. In this case, the :class:`Mock` object behavior is the same as with an :class:`.Mock` object: the wrapped object may have methods defined as async function functions. Based on Martin Richard's asynctest project. rNrrr&r'r r s'r&r c*\rSrSrSrSrSrSrSrg)_ANYi z2A helper object that compares equal to everything.cgrrrTrs r'r _ANY.__eq__ sr&cgr#rrs r'r$ _ANY.__ne__ sr&cg)Nzrrs r'r _ANY.__repr__ sr&rN) r r!r"r#r$rr$rr%rr&r'rr s8r&rc :SU-nSnSRUVs/sHn[U5PM sn5nSRUR5VVs/sHupxU<SU<3PM snn5n U(aUnU (aU(aUS- nXI- nX4-$s snfs snnf)Nz%s(%%s)r8z, =)rreprry) rrUrVrformatted_argsr| args_stringrwr kwargs_strings r'rr s$GN))$7$3T#Y$78KII171?:33M$  d "N'  ##8s BB c\rSrSrSrSSjrSSjrSr\Rr Sr Sr S r S r \S 5r\S 5rS rSrSrg)ri as A tuple for holding the results of a call to a mock, either in the form `(args, kwargs)` or `(name, args, kwargs)`. If args or kwargs are empty then a call tuple will compare equal to a tuple without those values. This makes comparisons less verbose:: _Call(('name', (), {})) == ('name',) _Call(('name', (1,), {})) == ('name', (1,)) _Call(((), {'a': 'b'})) == ({'a': 'b'},) The `_Call` object provides a useful shortcut for comparing with call:: _Call(((1, 2), {'a': 3})) == call(1, 2, a=3) _Call(('foo', (1, 2), {'a': 3})) == call.foo(1, 2, a=3) If the _Call has no name then it will match any name. NcSn0n[U5nUS:XaUup&nO{US:Xa9Uup[U [5(aU n[U [5(aU nOBU nO?XpvOUun [ U [ 5(aU n0nOb[ U [5(aU nS0pOGSnU nOBUS:Xa;Uup[ U [5(aU n[ U [ 5(aU 0pOSU pOXpOgU(aXc:wagXx4XE4:H$![a [s$f=f) Nr8rrFrrrr)rrrr.rr,rlr) rTr len_other self_name self_args self_kwargs other_name other_args other_kwargsrrrs r'r _Call.__eq__. sP "E I t9>%) "I{04 -I+ D.$ / /GE>SW4X4X%%););; >')2 !^38 0JL !^FE%''" ! E3''" +-rL $ !^!ME%%%" fe,,/5r /16 +0L 0)i-EEE_ "! ! "s DD,+D,c~URc [SX4SS9$URS-n[URX4X0S9$)Nr8rRrrXrrrs r'rH_Call.__call__f sB ?? ""d+$7 7%doot44MMr&cjURc [USS9$UR<SU<3n[X SS9$)NF)rrrr)rrrr)rTrrs r'r_Call.__getattr__n s4 ?? "de4 4//40$u==r&c`U[R;a[e[RX5$r9)rlrprI__getattribute__)rTrs r'r_Call.__getattribute__u s% 5>> ! %%d11r&c>[U5S:XaUupX4$Uup1nX4$)Nr)rrs r'_get_call_arguments_Call._get_call_arguments{ s2 t9>LD|"& D|r&c(UR5S$Nrrrs r'rU _Call.args '')!,,r&c(UR5S$)Nrrrs r'rV _Call.kwargs rr&c,UR(d2UR=(d SnURS5(aSU-nU$[U5S:XaSnUup#O0UupnU(dSnO!URS5(dSU-nOSU-n[ XU5$)NrrRzcall%srzcall.%s)rrrrr)rTrrUrVs r'r_Call.__repr__ s##??,fDt$$$K t9>DLD&!% D__T** 4'$%d&99r&c/nUnUb3UR(aURU5 URnUbM3[[ U55$)zFor a call object that represents multiple calls, `call_list` returns a list of all the intermediate calls as well as the final call.)rrKrrr)rTvalsthings r' call_list_Call.call_list sM$$ E"&&E$((r&)rrr)rr8NFT)rNNFT)r r!r"r#r$rrErrr$rHrrrrrUrVrrr%rr&r'rr s|$:?8@>C)2Fj]]FN>2 ----:* )r&r)rc [U5(a [U5n[U[5n[U5(a[ SU<S35e[ U5nSU0n U(aSU0n OUc0n U (a U(aSU S'U(d [ U5 URSU5nUn UcS n U RU5 [n [R"U5(a0n O[U(aU(a [S 5e[n O;[U5(d[n O$U(aU(a[!U5(d[n U "SX3U US .U D6n [U["5(aU(a [%X5n O['X5n O [)X Xr5 UbU(dXR*U'URS S5n U(aU(dS U;a[-XSSU U S9U l[1U5GH0n[3U5(aM[5X5nSU0nU (a[9X5(aURUS9 U(aSU0n[U["5(d[;XXU5nUU R*U'OU n[U["5(a U R<n[?XU5nUUS'[AU5(a[nO[nU"SUXUS.UD6nUU R*U'U"5Ul[)UUUS9 [U["5(dGM$[CXU5 GM3 [U 5(aU(aU RD"S0UD6 U $![6a GMnf=f)aCreate a mock object using another object as a spec. Attributes on the mock will use the corresponding attribute on the `spec` object as their spec. Functions or methods being mocked will have their arguments checked to check that they are called with the correct signature. If `spec_set` is True then attempting to set attributes that don't exist on the spec object will raise an `AttributeError`. If a class is used as a spec then the return value of the mock (the instance of the class) will have the same spec. You can use a class as the spec for an instance object by passing `instance=True`. The returned mock will only be callable if instances of the mock are callable. `create_autospec` will raise a `RuntimeError` if passed some common misspellings of the arguments autospec and spec_set. Pass the argument `unsafe` with the value True to disable that check. `create_autospec` also takes arbitrary keyword arguments that are passed to the constructor of the created mock.z'Cannot autospec a Mock object. [object=rBrr NTr$rr8zJInstance can not be True when create_autospec is mocking an async function)rr#r"rrrrR)r_rr rrr%)rrr"r#)r^r)#rmr;r,r+rr7rFr{rirr/isdatadescriptorrBr rirrsrBrrr`rr rrHrr.rIr-rkrA _must_skiprrer5)rr r_r rr&rVis_type is_async_funcrr"rrAwrappedrtr} child_kwargsr)rr^ child_klasss r'r r s(.~~Dzt$G"**. 45 5"4(MtnGt$ 8'+#$ f% JJvu %EI  NN6 E%%   >? ? t__$ X&8&>&>$  (  (& (D$ && '3D!$-DW78(,u%jj$'GxN&$@+DT2629;T U    t+H) ww..   h  / &1L(M22XhGC),D   &F$ .."48I(1L %"8,,' ' BV%*0B4@BC),D   &*}C  Xsi @ c= ) ) D %gn6 %f% KU   s8 M MMcT[U[5(dU[US05;agURnURHdnUR R U[5nU[LaM.[U[[45(a g[U[5(aUs $ g U$)zO Return whether we should skip the first argument on spec's `entry` attribute. rpF) r,r;r.r[rorprqrrGrFrB)rrtrrr~s r'rrG s dD ! ! GD*b1 1~~##E73 W   f|[9 : :  . .N Nr&c"\rSrSrSSjrSrg)rkic NcLXlXPlX lX0lX`lX@lgr9)ridsr rr_r)rTrr rrrr_s r'rE_SpecState.__init__e s      r&)rr_rrrr )FNNNF)r r!r"r#rEr%rr&r'rkrkc s 48/4r&rkc[U[5(a[R"U5$[R"U5$r9)r,bytesioBytesIOStringIO) read_datas r' _to_streamr{ s-)U##zz)$${{9%%r&c ^^ ^ ^ ^ [T5nUS/m U U 4SjnU U 4SjnU U 4Sjm U U 4Sjm U U 4SjnU 4Sjn[cVSSKn[[ [ UR 55R[ [ UR5555q[c+SSKn[[ [ UR555q Uc[S [S 9n[[S 9m T T Rl ST Rl ST Rl ST R l ST R"l UT RlT "5T S 'T S T R lUT R"lT T R&lUT R(lUT R*lU U U U4S jnXlT Ul U$)a A helper function to create a mock to replace the use of `open`. It works for `open` called directly or used as a context manager. The `mock` argument is the mock object to configure. If `None` (the default) then a `MagicMock` will be created for you, with the API limited to methods or attributes available on standard file handles. `read_data` is a string for the `read`, `readline` and `readlines` of the file handle to return. This is an empty string by default. Nc>TRRbTRR$TSR"U0UD6$r) readlinesrrUrV_statehandles r'_readlines_side_effect)mock_open.._readlines_side_effect sA    ( ( 4##00 0ay""D3F33r&c>TRRbTRR$TSR"U0UD6$r)readrrs r'_read_side_effect$mock_open.._read_side_effect s; ;; # # /;;++ +ay~~t.v..r&c?b># T"5ShvN TSR"U0UD6v MN7fr)readline)rUrV_iter_side_effectrs r'_readline_side_effect(mock_open.._readline_side_effect s9$&&&)$$d5f5 5 's /-/c3># TRRbTRRv MTSHnUv M g7fr)rr)linerrs r'r$mock_open.._iter_side_effect sA ?? ' ' 3oo2221IDJsAAcz>TRRbTRR$[TS5$r)rrr)rrsr'_next_side_effect$mock_open.._next_side_effect s1 ?? ' ' 3??// /F1Ir&c&>TR5 gr9)close)exctypeexcinstexctbrs r'_exit_side_effect$mock_open.._exit_side_effect s  r&ropen)rr)rrc>[T5TS'TRRTS:XaT"5TS'TSTRl[$)Nrr)rrrr)rUrVrrrrs r' reset_datamock_open..reset_data sHy)q ?? & &&) 3-/F1I*0)FOO 'r&)r file_spec_iorkrrH TextIOWrapperunionr open_specrrrrwriterrrrr)rr) rAr _read_datarrrrrrrrrrs ` @@@@r'rr skI&J$ F4 / 6  S!2!234::3s3;;?O;PQR S]+,  |f95 I &F$*F! $FLL#FKK#'FOO $(F!/FKK%'F1I"()FOO#9F "3FOO"3FOO"3FOO"D Kr&c.\rSrSrSrSrSSjrSrSrg) ri a? A mock intended to be used as a property, or other descriptor, on a class. `PropertyMock` provides `__get__` and `__set__` methods so you can specify a return value when it is fetched. Fetching a `PropertyMock` instance from an object calls the mock, with no args. Setting it calls the mock with the value being set. c [S0UD6$)Nr)r)rTrVs r'rTPropertyMock._get_child_mock s"6""r&NcU"5$r9r)rTr2obj_types r'rPropertyMock.__get__ s v r&cU"U5 gr9r)rTr2r}s r'rPropertyMock.__set__ s  S r&rr9) r r!r"r#r$rTrrr%rr&r'rr s#r&rcr^\rSrSrSrU4Sjr\S.U4SjjrU4SjrSr U4Sjr \S.S jr S r S r U=r$) ThreadingMixini Nc >[URS5[5(aUSRUS'O6[URS5[5(aUSRUS'[ 5R "S0UD6$)Nrtimeoutr#r)r,rqr_mock_wait_timeoutrRrT)rTrr[s r'rTThreadingMixin._get_child_mock sl bffX& 7 7xL;;ByM }-~ > >}-@@ByMw&&,,,r&rc&>[5R"U0UD6 U[La URn[R "5UR S'/UR S'[R"5UR S'XR S'g)N _mock_event_mock_calls_events_mock_calls_events_lockr)rRrE_timeout_unsetDEFAULT_TIMEOUT threadingEventrpLock)rTrrUrVr[s r'rEThreadingMixin.__init__ sr $)&) n $**G'0'8 m$.0 *+3<>>3C /0.5 *+r&c>[5R"U0UD6 [R"5URS'/URS'g)rrrN)rRrr!r"rprs r'rThreadingMixin.reset_mock s> D+F+'0'8 m$.0 *+r&cUR URHup4nX44X4:XdMUs sSSS5 $ [R"5nURR XU45 SSS5 U$!,(df  W$=fr9)rrr!r"rK)rT expected_argsexpected_kwargsrUrVevent new_events r' __get_eventThreadingMixin.__get_event s}  ) )'+'>'>#e>m%EE L* )'>")I  # # * *MI+V W *  * ) sA5A54A55 Bc>[5R"U0UD6nURX5nUR5 URR5 U$r9)rRr._ThreadingMixin__get_eventrr)rTrUrV ret_value call_eventr[s r'r.ThreadingMixin._mock_call sLG&&77 %%d3  r&cU[La URnURRUS9(d&UR=(d SSUS3n[ U5eg)zWait until the mock object is called. `timeout` - time to wait for in seconds, waits forever otherwise. Defaults to the constructor provided timeout. Use None to block undefinetively. rrAz was not called before timeout(z).N)rrrwaitrr)rTrrs r'wait_until_called ThreadingMixin.wait_until_called s` n $--G$$W$5oo/01&ir+C % %6r&cURX5nURURS9(dURX5n[ US35eg)zuWait until the mock object is called with given args. Waits for the timeout in seconds provided in the constructor. rz call not foundN)r/r4rrr)rTrUrVr*rs r'wait_until_any_call_with'ThreadingMixin.wait_until_any_call_with) sP   .zz$"9"9z:">>tLO O#4O!DE E;r&r)r r!r"r#r rTrrErr/r.r5r8r%rTrUs@r'rr sAO-'5661,: &FFr&rc\rSrSrSrSrg)r i4 ae A mock that can be used to wait until on calls happening in a different thread. The constructor can take a `timeout` argument which controls the timeout in seconds for all `wait` calls of the mock. You can change the default timeout of all instances via the `ThreadingMock.DEFAULT_TIMEOUT` attribute. If no timeout is set, it will block undefinetively. rNrrr&r'r r 4 s   r&r c6SUl[U5Hrn[X5n[ U[ 5(dM&[ UR RU5[5(aMVURULdMg[U5 Mt g![a Mf=f)aDisable the automatic generation of child mocks. Given an input Mock, seals it to ensure no further mocks will be generated when accessing an attribute that was not already defined. The operation recursively seals the mock passed in, meaning that the mock itself, any mocks generated by accessing one of its attributes, and all assigned mocks without a name or spec will be sealed. TN) r,rHr.rIr,r rrqrkrr)rArr[s r'rrD sDD  #A!_--  a&&**40* = =    % G   s B  BBc$\rSrSrSrSrSrSrg)r/i\ z0 Wraps an iterator in an asynchronous iterator. cpXl[[S9n[RUlX R S'g)Nrer5)iteratorr rr/CO_ITERABLE_COROUTINErkrp)rTr>rps r'rE_AsyncIterator.__init__` s+ #X6 $:: $- j!r&c`# [UR5$![a [ef=f7fr9)rr>rsrtrs r'r_AsyncIterator.__anext__f s0  & &     s.. +.+.)r>N)r r!r"r#r$rErr%rr&r'r/r/\ s. !r&r/rr)NFNNN)FFNN)Nr8)__all__rrerr/rrbuiltinsrrr!typesrrr unittest.utilr functoolsrrrrrrHrrr rRrr3r7r+r>rCrOr`r[rirmrsrrr|rrrrrrrMISSINGrDELETEDrlrrrkrr r rr frozenset removeprefixrr rdrrrFrHrrrrrrrrmultiplestopallra magic_methodsnumericsrrzinplaceright _non_defaultsrr@r_sync_async_magics _async_magicsrrrr4rr3r r&r,r1r5r9r;rrMrrBrJrErfrgrKrr rrrrlrrr rrkr;rrBrr rrr TIMEOUT_UNSETrrr rr/)rrs00r'rVsJ (  '22#$CyC"(m Hmd??33GTm H   @2  F # & 4.."b>6) )f )   ;          &**(6  6 ^ 9d^ 9DO$$ y!!Di $ 4  g!Dg!V8=/8zY/VY/z < 'Ttd&+:?C04.d$u4OCHOdV/&V/r       "K  ((7hnn&67 7 5HNN$455  HHmXw 67==? ?!Hv?  @!]$'99 ]*. 306^ " 1$;;>  :   j G DGB""$!!'(*;*;T"BCIh-K E+TE+P((V 6  f$$v)Ev)r uCGT*/Tn8        &Sl4$''EFTEFP  NJ  0!![a IH!l dIs0 P=PP !P P+PP P