Ë ‚Ö¦iMŸãó®—dZddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z ddlmZddlmZmZddlmZGd„d e«Zee«D�chc]}|j1d «rŒ|’Œc}Zd ZeZd „Zd „Zd„Zd„Z d„Z!d„Z"dyd„Z#d„Z$d„Z%d„Z&d„Z'dyd„Z(d„Z)d„Z*d„Z+Gd„de,«Z-Gd„de,«Z.e.«Z/e/j`Z0e/jbZ2e/jfZ4hd £Z5d!„Z6Gd"„d#e7«Z8d$„Z9Gd%„d&e,«Z:Gd'„d(e,«Z;Gd)„d*e;«Z<e=ee<«D�chc]$}|j1d+«r|j}d+«’Œ&c}«Z?Gd,„d-e7«Z@d.„ZAGd/„d0e;«ZBGd1„d2eBe<«ZCd3„ZDGd4„d5e,«ZEd6„ZFe0dddddfdd7œd8„ZG dzd9„ZHe0dddddfdd7œd:„ZIGd;„d„ZLeGeI_,eJeI_MeHeI_NeLeI_Od?eI_Pd@ZQdAZRdBj§dC„eRj©«D««ZUdBj§dD„eRj©«D««ZVhdE£ZWdF„ZXdBj§eQeReUeVg«j©«D�chc]}dG|z’Œ c}ZYhdH£ZZdIhZ[eZe[zZ\eYeWzZ]e]e\zZ^hdJ£Z_dK„dL„dM„dN„dOœZ`eaeaeaeadPddddQdRd dPddSœ ZbdT„ZcdU„ZddV„ZedW„ZfecedeeefdXœZgdY„ZhGdZ„d[e;«ZiGd\„d]eie<«ZjGd^„d_ei«ZkGd`„daeieC«ZlGdb„dce;«Zm ejÜee jÞd««Zpee «ZqGdd„dee;«ZsGdf„dgesekeC«ZtGdh„die,«Zueu«Zvdj„ZwGdk„dlex«Zyeyd¬m«Zz d{dd7œdn„Z{do„Z|Gdp„dqe,«Z}e~e{«e~evjþ«fZ€da�da‚dr„Zƒd|ds„Z„Gdt„dueC«Z…dv„Z†Gdw„dx«Z‡ycc}wcc}wcc}w#er$rdZpYŒ®wxYw)})ÚMockÚ MagicMockÚpatchÚsentinelÚDEFAULTÚANYÚcallÚcreate_autospecÚ AsyncMockÚ FILTER_DIRÚNonCallableMockÚNonCallableMagicMockÚ mock_openÚ PropertyMockÚsealéN)Úiscoroutinefunction)ÚCodeTypeÚ ModuleTypeÚ MethodType)Ú safe_repr)ÚwrapsÚpartial)ÚRLockcó—eZdZdZy)ÚInvalidSpecErrorz8Indicates that an invalid value was used as a mock spec.N©Ú__name__Ú __module__Ú __qualname__Ú__doc__©óú&/usr/lib64/python3.12/unittest/mock.pyrr)s„ÚBr"rÚ_Tcó®—t|«rt|t«syt|d«r t |d«}t |«xst j|«S)NFÚ__func__)Ú_is_instance_mockÚ isinstancer ÚhasattrÚgetattrrÚinspectÚ isawaitable©Úobjs r#Ú _is_async_objr/5sG€Ü˜Ô¤j°´iÔ&@ØÜˆs�JÔÜ�c˜:Ó&ˆÜ ˜sÓ #Ò ?¤w×':Ñ':¸3Ó'?Ð?r"có4—t|dd«r t|«Sy)NÚ__code__F)r*r)Úfuncs r#Ú_is_async_funcr3=s€Üˆt�Z Ô&Ü" 4Ó(Ð(àr"có4—tt|«t«S©N)Ú issubclassÚtyper r-s r#r'r'Ds€ô ”d˜3“i¤Ó 1Ð1r"cój—t|t«xs"t|t«xrt|t«Sr5)r(Ú BaseExceptionr7r6r-s r#Ú _is_exceptionr:Js-€ä�3œ Ó&ò AÜ�3œÓÒ@¤*¨S´-Ó"@ðr"cóV—t|t«rt|d«r |jS|S©NÚmock)r(Ú FunctionTypesr)r=r-s r#Ú _extract_mockr?Qs%€ô�#”}Ô%¬'°#°vÔ*>Ø�x‰xˆàˆ r"cóv—t|t«r|s|j}d}nRt|ttf«rt|t«rd}|j }nt|t «s |j}|r t|d«}n|} |tj|«fS#t$rYywxYw#t$rYywxYw)z� Given an arbitrary, possibly callable object, try to create a suitable signature object. Return a (reduced func, signature) tuple, or None. TN) r(r7Ú__init__Ú classmethodÚ staticmethodr&r>Ú__call__ÚAttributeErrorrr+Ú signatureÚ ValueError)r2Ú as_instanceÚeat_selfÚsig_funcs r#Ú_get_signature_objectrKZsµ€ô �$œÔ¡kà�}‰}ˆà‰Ü �Dœ;¬ Ð5Ô 6Ü �dœKÔ (àˆHà�}‰}‰Ü ˜œmÔ ,ð Ø—=‘=ˆDñܘ4 Ó&‰àˆðØ”W×&Ñ& xÓ0Ð0Ð0øôò Ùð ûô òáðús$Á( BÂB, B)Â(B)Â, B8Â7B8Fcó’‡—t|||«Š‰€y‰\}Šˆfd„}t||«|t|«_‰t|«_y)Ncó*•—‰j|i|¤Žyr5©Úbind)ÚselfÚargsÚkwargsÚsigs €r#Úchecksigz"_check_signature..checksig‚󸀨ˆ�‰�$Ð!˜&Ó!r")rKÚ_copy_func_detailsr7Ú_mock_check_sigÚ __signature__)r2r=Ú skipfirstÚinstancerTrSs @r#Ú_check_signaturer[}sIø€Ü   h° Ó :€CØ €{ØØ�I€Dˆ#ô"ä�t˜XÔ&Ø!)„DˆƒJÔØ"„DˆƒJÕr"c ó`—dD]} t||t||««Œy#t$rYŒ)wxYw)N)rr Ú__text_signature__rÚ __defaults__Ú__kwdefaults__)Úsetattrr*rE)r2ÚfuncopyÚ attributes r#rVrV‰s:€óˆ ð Ü �G˜Y¬°°iÓ(@Õ Añ øô ò Ù ð ús ‡!¡ -¬-có¢—t|t«ryt|tttf«rt |j «St|dd«�yy)NTrDF)r(r7rCrBrÚ _callabler&r*r-s r#rdrd–sD€Ü�#”tÔØÜ�#œ ¤k´:Ð>Ô?ܘŸ™Ó&Ð&܈s�J Ó%Ð1ØØ r"có0—t|«ttfvSr5)r7ÚlistÚtupler-s r#Ú_is_listrh s€ô �‹9œœu˜ Ð %Ð%r"có¦—t|t«st|dd«duS|f|jzD]}|jj d«€Œyy)ztGiven an object, return True if the object is callable. For classes, return True if instances would be callable.rDNTF)r(r7r*Ú__mro__Ú__dict__Úget)r.Úbases r#Ú_instance_callablern¦sV€ô �cœ4Ô ä�s˜J¨Ó-°TÐ9Ð9ð�˜Ÿ™Ô$ˆØ �=‰=× Ñ ˜ZÓ (Ñ 4Ùð%ð r"có‡ —t|t«}t|||«}|€|S|\}Š ˆ fd„}t||«|j}|j «sd}||dœ}d|z} t | |«||} t| |‰ «| S)Ncó*•—‰j|i|¤Žyr5rN)rQrRrSs €r#rTz _set_signature..checksig¿rUr"ra)Ú _checksig_r=zYdef %s(*args, **kwargs): _checksig_(*args, **kwargs) return mock(*args, **kwargs))r(r7rKrVrÚ isidentifierÚexecÚ _setup_func) r=ÚoriginalrZrYÚresultr2rTÚnameÚcontextÚsrcrarSs @r#Ú_set_signaturerzµsœø€ô ˜8¤TÓ*€IÜ " 8¨X°yÓ A€FØ €~؈ Ø�I€Dˆ#ô"ä�t˜XÔ&à × Ñ €DØ × Ñ Ô ØˆØ%¨tÑ4€Gð $à&*ñ +€Cô ˆ#ˆwÔØ�d‰m€GÜ�˜˜sÔ#Ø €Nr"cóÞ‡‡—‰‰_ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„} ˆˆfd„} d ‰_d ‰_d‰_t «‰_t «‰_t «‰_‰j‰_‰j‰_ ‰j‰_ |‰_ |‰_ |‰_ | ‰_| ‰_|‰_|‰_|‰_|‰_‰‰_y) Ncó(•—‰j|i|¤ŽSr5)Úassert_called_with©rQrRr=s €r#r}z'_setup_func..assert_called_withÓ󸀨&ˆt×&Ñ&¨Ð7°Ñ7Ð7r"có(•—‰j|i|¤ŽSr5)Ú assert_calledr~s €r#r�z"_setup_func..assert_calledÕsø€Ø!ˆt×!Ñ! 4Ð2¨6Ñ2Ð2r"có(•—‰j|i|¤ŽSr5)Úassert_not_calledr~s €r#rƒz&_setup_func..assert_not_called×sø€Ø%ˆt×%Ñ% tÐ6¨vÑ6Ð6r"có(•—‰j|i|¤ŽSr5)Úassert_called_oncer~s €r#r…z'_setup_func..assert_called_onceÙrr"có(•—‰j|i|¤ŽSr5)Úassert_called_once_withr~s €r#r‡z,_setup_func..assert_called_once_withÛsø€Ø+ˆt×+Ñ+¨TÐ<°VÑ<Ð.assert_has_callsÝsø€Ø$ˆt×$Ñ$ dÐ5¨fÑ5Ð5r"có(•—‰j|i|¤ŽSr5)Úassert_any_callr~s €r#r‹z$_setup_func..assert_any_callßsø€Ø#ˆt×#Ñ# TÐ4¨VÑ4Ð4r"c󼕗t«‰_t«‰_‰j«‰j}t |«r|‰ur|j«yyyr5)Ú _CallListÚ method_callsÚ mock_callsÚ reset_mockÚ return_valuer')Úretrar=s €€r#r�z_setup_func..reset_mockásLø€Ü(›{ˆÔÜ&›[ˆÔØ �‰ÔØ×"Ñ"ˆÜ ˜SÔ !¨#°©+Ø �N‰NÕ ð+6Ð !r"Fr)r=ÚcalledÚ call_countÚ call_argsr�Úcall_args_listrŽr�r‘Ú side_effectÚ_mock_childrenr}r‡r‰r‹r�r�rƒr…rXÚ_mock_delegate) rar=rSr}r�rƒr…r‡r‰r‹r�s `` r#rtrtÐsãù€Ø€G„Lô8ô3ô7ô8ô=ô6ô5õð€G„NØ€GÔØ€GÔÜ&›[€GÔÜ$›;€GÔÜ"›€GÔà×,Ñ,€GÔØ×*Ñ*€GÔØ!×0Ñ0€GÔà!3€GÔØ&=€GÔ#Ø/€GÔØ-€GÔØ#€GÔØ)€GÔØ 1€GÔØ!3€GÔØ€GÔà!€DÕr"c óć—tjj‰_d‰_d‰_t «‰_ˆfd„}dD]}t‰|t||««Œy)Nrcó<•—t‰j|«|i|¤ŽSr5)r*r=)ÚattrrQrRr=s €r#Úwrapperz"_setup_async_mock..wrapper s ø€Ø'Œw�t—y‘y $Ó'¨Ð8°Ñ8Ð8r")Úassert_awaitedÚassert_awaited_onceÚassert_awaited_withÚassert_awaited_once_withÚassert_any_awaitÚassert_has_awaitsÚassert_not_awaited) ÚasyncioÚ coroutinesÚ _is_coroutineÚ await_countÚ await_argsr�Úawait_args_listr`r)r=r�rbs` r#Ú_setup_async_mockr«sVø€Ü ×+Ñ+×9Ñ9€DÔØ€DÔØ€D„OÜ$›;€DÔô 9ó,ˆ ô ��i¤¨°)Ó!<Õ=ñ,r"có—d|ddz|k(S)Nú__%s__ééþÿÿÿr!©rws r#Ú _is_magicr±s€Ø �d˜1˜R�jÑ  DÑ (Ð(r"có"—eZdZdZd„Zd„Zd„Zy)Ú_SentinelObjectz!A unique, named, sentinel object.có—||_yr5r°©rPrws r#rAz_SentinelObject.__init__"s €Øˆ� r"có —d|jzS©Nz sentinel.%sr°©rPs r#Ú__repr__z_SentinelObject.__repr__%ó€Ø˜tŸy™yÑ(Ð(r"có —d|jzSr·r°r¸s r#Ú __reduce__z_SentinelObject.__reduce__(rºr"N)rrrr rAr¹r¼r!r"r#r³r³ s„Ù'òò)ó)r"r³có"—eZdZdZd„Zd„Zd„Zy)Ú _SentinelzAAccess attributes to return a named object, usable as a sentinel.có—i|_yr5)Ú _sentinelsr¸s r#rAz_Sentinel.__init__.s €Øˆ�r"cób—|dk(rt‚|jj|t|««S)NÚ __bases__)rErÀÚ setdefaultr³rµs r#Ú __getattr__z_Sentinel.__getattr__1s,€Ø �;Ò ä Ð Ø�‰×)Ñ)¨$´ÀÓ0EÓFÐFr"có—y)Nrr!r¸s r#r¼z_Sentinel.__reduce__7s€Ør"N)rrrr rArÄr¼r!r"r#r¾r¾,s„ÙKòòGó r"r¾>Ú _mock_namer—Ú _mock_parentr‘Ú_mock_new_nameÚ_mock_new_parentÚ_mock_side_effectÚ_mock_return_valuecóf—tj|«d|z}||fd„}||fd„}t||«S)NÚ_mock_cóN—|j}|€ t||«St||«Sr5)r™r*)rPrwÚ _the_namerSs r#Ú_getz"_delegating_property.._getLs,€Ø×!Ñ!ˆØ ˆ;ܘ4 Ó+Ð +Ü�s˜DÓ!Ð!r"cóZ—|j}|€||j|<yt|||«yr5)r™rkr`)rPÚvaluerwrÏrSs r#Ú_setz"_delegating_property.._setQs,€Ø×!Ñ!ˆØ ˆ;Ø',ˆD�M‰M˜)Ò $ä �C˜˜uÕ %r")Ú_allowed_namesÚaddÚproperty)rwrÏrÐrÓs r#Ú_delegating_propertyr×Is>€Ü×Ñ�tÔØ˜4‘€Iب ó"ð $¨yó&ô �D˜$Ó Ðr"có—eZdZd„Zd„Zy)r�cóÔ—t|t«stj||«St|«}t|«}||kDryt d||z dz«D]}||||z}||k(sŒyy)NFréT)r(rfÚ __contains__ÚlenÚrange)rPrÒÚ len_valueÚlen_selfÚiÚsub_lists r#rÛz_CallList.__contains__^sw€Ü˜%¤Ô&Ü×$Ñ$ T¨5Ó1Ð 1ܘ“Jˆ Ü�t“9ˆØ �xÒ Øä�q˜( YÑ.°Ñ2Ö3ˆAؘA˜a  ™kÐ*ˆHؘ5Ó Ùð4ðr"có>—tjt|««Sr5)ÚpprintÚpformatrfr¸s r#r¹z_CallList.__repr__ls€Ü�~‰~œd 4›jÓ)Ð)r"N)rrrrÛr¹r!r"r#r�r�\s „ò ó*r"r�có—t|«}t|«sy|js$|js|j€ |j �y|}|�||ury|j }|�Œ|r||_||_|r||_||_y)NFT)r?r'rÆrÈrÇrÉ)ÚparentrÒrwÚnew_nameÚ_parents r#Ú_check_and_set_parentréps™€Ü ˜%Ó €Eä ˜UÔ #ØØ × Ò ˜U×1Ò1Ø × Ñ Ð 'Ø × Ñ Ð +Øà€GØ Ð ð �eÑ ØØ×*Ñ*ˆð Ñ ñØ!'ˆÔØ'ˆÔÙ Ø#ˆÔØˆÔØ r"có—eZdZd„Zd„Zy)Ú _MockItercó$—t|«|_yr5)Úiterr.)rPr.s r#rAz_MockIter.__init__Œs €Ü˜“9ˆ�r"có,—t|j«Sr5)Únextr.r¸s r#Ú__next__z_MockIter.__next__Žs€Ü�D—H‘H‹~Ðr"N)rrrrArðr!r"r#rërë‹s „òór"rëcó—eZdZeZdZd„Zy)ÚBaseNcó—yr5r!©rPrQrRs r#rAz Base.__init__”s€Ø r")rrrrrËrÊrAr!r"r#ròrò‘s„Ø ÐØÐó r"ròcóŽ—eZdZdZe«Z d,d„Z d,d„Zd„Zd-d„Z d.d„Z d „Z d „Z d Z ee e e «Zed „«Zed «Zed«Zed«Zed«Zed«Zd„Zd„Zeee«Zd/dddœdedefd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d0d „Z$d!„Z%d"„Z&d#„Z'd$„Z(d%„Z)d&„Z*d'„Z+d-d(„Z,d)„Z-d*„Z.d1d+„Z/y)2r z A non-callable version of `Mock`NFc  óæ—|f} t|t«s|xs|}|�t|«rt|f} t|j| d|j i«}t t|«j|«}|S)Nr ) r6ÚAsyncMockMixinr/r7rr Ú _safe_superr Ú__new__)ÚclsÚspecrrwÚspec_setræÚ _spec_stateÚ _new_nameÚ _new_parentÚ_spec_as_instanceÚ _eat_selfÚunsaferRÚbasesÚspec_argÚnewrZs r#rùzNonCallableMock.__new__¤sm€ð�ˆÜ˜#œ~Ô.àÒ' 4ˆHØÐ#¬ °hÔ(?Ü'¨Ð-�Ü�3—<‘< ¨°C·K±KÐ(@ÓAˆÜœ°Ó4×<Ñ<¸SÓAˆØˆr"c  óš—|€|}|j} || d<|| d<|| d<|| d<d| d<|�|}d}| €|du} |j||| | «i| d<|| d <d| d <d| d <d| d <d | d<t«| d<t«| d<t«| d<| | d<| r|jdi| ¤Žt t |«j ||||||«y)NrÇrÆrÈrÉFÚ _mock_sealedTr˜Ú _mock_wrapsr™Ú _mock_calledÚ_mock_call_argsrÚ_mock_call_countÚ_mock_call_args_listÚ_mock_mock_callsrŽÚ _mock_unsafer!)rkÚ_mock_add_specr�Úconfigure_mockrør rA)rPrûrrwrürærýrþrÿrrrrRrks r#rAzNonCallableMock.__init__·s*€ð Ð Ø ˆKà—=‘=ˆØ#)ˆ�Ñ Ø!%ˆ�ÑØ%.ˆÐ!Ñ"Ø'2ˆÐ#Ñ$Ø#(ˆ�Ñ à Р؈D؈HØ Ð Ø dÐ*ˆIà ×јD (Ð,=¸yÔIà%'ˆÐ!Ñ"Ø"'ˆ�ÑØ%)ˆÐ!Ñ"à#(ˆ�Ñ Ø&*ˆÐ"Ñ#Ø'(ˆÐ#Ñ$Ü+4«;ˆÐ'Ñ(Ü'0£{ˆÐ#Ñ$ä#,£;ˆ�Ñ Ø#)ˆ�Ñ á Ø ˆD× Ñ Ñ ) &Ò )ä”O TÓ*×3Ñ3Ø �%˜˜x¨Ø õ r"cól—t|«}d|_d|_d|_d|_t |||«y)zÍ Attach a mock as an attribute of this one, replacing its name and parent. Calls to the attached mock will be recorded in the `method_calls` and `mock_calls` attributes of this one.NÚ)r?rÇrÉrÆrÈr`)rPr=rbÚ inner_mocks r#Ú attach_mockzNonCallableMock.attach_mockäs:€ô # 4Ó(ˆ à"&ˆ ÔØ&*ˆ Ô#Ø "ˆ ÔØ$(ˆ Ô!ä��i Õ&r"có(—|j||«y©zðAdd a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is True then only attributes on the spec can be set.N)r©rPrûrüs r#Ú mock_add_speczNonCallableMock.mock_add_specós€ð ×јD (Õ+r"cóˆ—t|«rtd|›d�«‚d}d}g}|�{t|«spt|t«r|}n t |«}t |||«}|xr|d}t |«} | D]*} tt|| d««sŒ|j| «Œ,| }|j} || d<|| d<|| d<|| d<|| d<y) Nz#Cannot spec a Mock object. [object=Ú]rÚÚ _spec_classÚ _spec_setÚ_spec_signatureÚ _mock_methodsÚ _spec_asyncs) r'rrhr(r7rKÚdirrr*Úappendrk) rPrûrürrrrrÚresÚ spec_listrœrks r#rzNonCallableMock._mock_add_specüsç€ä ˜TÔ "Ü"Ð%HÈÈÐPQÐ#RÓSÐ Sàˆ ØˆØˆ à Ð ¤H¨T¤Nܘ$¤Ô%Ø"‘ ä" 4›j� Ü'¨Ø(9¸9óFˆCà!šn c¨!¡fˆOä˜D› ˆIã!�Ü&¤w¨t°T¸4Ó'@ÕAØ ×'Ñ'¨Õ-ð"ðˆDà—=‘=ˆØ"-ˆ�ÑØ (ˆ�ÑØ&5ˆÐ"Ñ#Ø$(ˆ�Ñ!Ø#/ˆ�Ò r"có¾—|j}|j�|jj}|tur&|j€|j |d¬«}||_|S)Nú()©rÿrþ)rËr™r‘rrÚ_get_child_mock)rPr’s r#Ú__get_return_valuez"NonCallableMock.__get_return_valuese€Ø×%Ñ%ˆØ × Ñ Ð *Ø×%Ñ%×2Ñ2ˆCà ”'‰>˜d×.Ñ.Ð6Ø×&Ñ&Ø ¨Dð'óˆCð!$ˆDÔ Øˆ r"cój—|j�||j_y||_t||dd«y)Nr%)r™r‘rËré)rPrÒs r#Ú__set_return_valuez"NonCallableMock.__set_return_value*s2€Ø × Ñ Ð *Ø/4ˆD× Ñ Õ ,à&+ˆDÔ #Ü ! $¨¨t°TÕ :r"z1The value to be returned when the mock is called.cóH—|j€ t|«S|jSr5)rr7r¸s r#Ú __class__zNonCallableMock.__class__6s$€à × Ñ Ð #ܘ“:Ð Ø×ÑÐr"r“r”r•r–r�cóÆ—|j}|€ |jS|j}|�8t|«s-t |t «st |«st |«}||_|Sr5)r™rÊr—Úcallabler(rër:)rPÚ delegatedÚsfs r#Ú__get_side_effectz!NonCallableMock.__get_side_effectCs\€Ø×'Ñ'ˆ Ø Ð Ø×)Ñ)Ð )Ø × "Ñ "ˆØ ˆN¤8¨B¤<Ü" 2¤yÔ1¼-ÈÔ:Kܘ2“ˆBØ$&ˆIÔ !؈ r"cóT—t|«}|j}|€||_y||_yr5)Ú _try_iterr™rÊr—)rPrÒr/s r#Ú__set_side_effectz!NonCallableMock.__set_side_effectNs-€Ü˜%Ó ˆØ×'Ñ'ˆ Ø Ð Ø%*ˆDÕ "à$)ˆIÕ !r"©r‘r—r‘r—có—|€g}t|«|vry|jt|««d|_d|_d|_t «|_t «|_t «|_|r t|_ |rd|_ |jj«D]/}t|t«s|t urŒ|j#|||¬«Œ1|j}t%|«r||ur|j#|«yyy)z-Restore the mock object to its initial state.NFrr5)Úidr!r“r•r”r�r�r–rŽrrËrÊr˜Úvaluesr(Ú _SpecStateÚ_deletedr�r')rPÚvisitedr‘r—Úchildr’s r#r�zNonCallableMock.reset_mockYsæ€ð ˆ?؈GÜ ˆd‹8�wÑ Ø Ø�‰”r˜$“xÔ àˆŒ ؈ŒØˆŒÜ#›+ˆŒÜ'›kˆÔÜ%›KˆÔá Ü&-ˆDÔ #Ù Ø%)ˆDÔ "à×(Ñ(×/Ñ/Ö1ˆEܘ%¤Ô,°¼Ñ0AØØ × Ñ ˜W°<È[Ð Õ Yð2ð ×%Ñ%ˆÜ ˜SÔ ! c°¡oØ �N‰N˜7Õ #ð'6Ð !r"c óÒ—t|j«d„¬«D]H\}}|jd«}|j«}|}|D]}t ||«}Œt |||«ŒJy)aZSet 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ó*—|djd«S)NrÚ.)Úcount)Úentrys r#Úz0NonCallableMock.configure_mock..†s€°°q±·±ÀÔ1Dr")Úkeyr?N)ÚsortedÚitemsÚsplitÚpopr*r`)rPrRÚargÚvalrQÚfinalr.rAs r#rzNonCallableMock.configure_mockysh€ô˜vŸ|™|›~ñ$E÷ F‰HˆC�ð —9‘9˜S“>ˆDØ—H‘H“JˆE؈CÛ�ܘc 5Ó)‘ðä �C˜ Õ $ñFr"c óÖ—|dvr t|«‚|j�$||jvs|tvr$td|z«‚t|«r t|«‚|jsD|jr||jvr*|j d«s|t vrt|›d|›d�«‚tj5|jj|«}|tur t|«‚|€Jd}|j�t|j|«}|j|||||¬«}||j|<nat|t «rQ t#|j$|j&|j(|j*|j,«}||j|<ddd«|S#t.$r6|j0dxs|}t/d|›d |›d |›d |j$›d � «‚wxYw#1swYSxYw) N>rrzMock object has no attribute %r)ÚassertÚassretÚasertÚaseertÚassrtz6 is not a valid assertion. Use a spec for the mock if z is meant to be an attribute.)rærwrrþrÿrÆúCannot autospec attr ú from target ú, as it has already been mocked out. [target=ú, attr=r)rErÚ _all_magicsr±rÚ startswithÚ_ATTRIB_DENY_LISTr Ú_lockr˜rlr:rr*r'r(r9r rûrürZrærwrrk)rPrwrvrÚ target_names r#rÄzNonCallableMock.__getattr__�s €Ø Ð4Ñ 4Ü  Ó&Ð &Ø × Ñ Ð +ؘ4×-Ñ-Ñ-°¼Ñ1DÜ$Ð%FÈÑ%MÓNÐNÜ �tŒ_Ü  Ó&Ð &Ø× Ò ¨$×*<Ò*<ÀÈD×L^ÑL^Ñ@^Ø�‰ÐOÔPÐTXÔ\mÑTmÜ$Ø�hð'Ø'+ hÐ.KðMóNðNô× "Ó "Ø×(Ñ(×,Ñ,¨TÓ2ˆFØœÑ!Ü$ TÓ*Ð*Ø�Ø�Ø×#Ñ#Ð/ô$ D×$4Ñ$4°dÓ;�Eà×-Ñ-Ø d°%À4Ø $ð.ó�ð.4�×#Ñ# DÒ)ä˜F¤JÔ/ð DÜ,ØŸ ™  V§_¡_°f·o±oØŸ ™  v§{¡{ó�Fð.4�×#Ñ# DÑ)÷;#ð>ˆ øô(òDØ"&§-¡-° Ñ"=Ò"EÀ�KÜ*Ø/°¨x°}Ø&˜/ð*#Ø#' (¨'°&·+±+°ÀðCóDðDðDú÷/#ð>ˆ ús&Â6B GÅAFÆGÆ?GÇGÇG(có|—|jg}|j}|}d}|dgk(rd}|�B|}|j|j|z«d}|jdk(rd}|j}|�ŒBtt |««}|j xsd}t |«dkDr |ddvr|dz }||d<dj|«S)Nr?r%rr=rÚ)r%z().r)rÈrÉr!rfÚreversedrÆrÜÚjoin)rPÚ _name_listrèÚlastÚdotÚ_firsts r#Ú_extract_mock_namez"NonCallableMock._extract_mock_name¿sÛ€Ø×)Ñ)Ð*ˆ Ø×'Ñ'ˆØˆàˆØ ˜$˜Ò ؈CàÐ!؈Dà × Ñ ˜g×4Ñ4°sÑ:Ô ;؈CØ×%Ñ%¨Ò-Ø�à×.Ñ.ˆGðÑ!ôœ( :Ó.Ó/ˆ Ø—‘Ò* FˆÜ ˆz‹?˜QÒ Ø˜!‰} MÑ1ؘ#‘ �؈ �1‰ Ø�w‰w�zÓ"Ð"r"cóø—|j«}d}|dvrd|z}d}|j�)d}|jrd}||jjz}dt |«j›|›|›dt |«›d�S) Nr)r=zmock.z name=%rz spec=%rz spec_set=%rÚ)rarrrr7r7)rPrwÚ name_stringÚ spec_strings r#r¹zNonCallableMock.__repr__Ús…€Ø×&Ñ&Ó(ˆàˆ Ø Ð(Ñ (Ø$ tÑ+ˆKàˆ Ø × Ñ Ð 'Ø$ˆKØ�~Š~Ø,� Ø%¨×(8Ñ(8×(AÑ(AÑAˆKøä �‹J× Ò Ù Ú Ü ˆt�Hð  ð r"có—tstj|«S|jxsg}t t |««}t |j«}|jj«D��cgc]\}}|tur|‘Œ}}}|D�cgc]}|jd«rŒ|‘Œ}}|D�cgc] }|jd«r t|«r|‘Œ"}}tt||z|z|z««Scc}}wcc}wcc}w)z8Filter the output of `dir(mock)` to only useful members.r$)r ÚobjectÚ__dir__rr r7rfrkr˜rEr:rVr±rDÚset)rPÚextrasÚ from_typeÚ from_dictÚm_nameÚm_valueÚfrom_child_mocksÚes r#rhzNonCallableMock.__dir__ïsø€åÜ—>‘> $Ó'Ð 'à×#Ñ#Ò) rˆÜœ˜T› “Oˆ ܘŸ™Ó'ˆ à*.×*=Ñ*=×*CÑ*CÔ*Eô(Ù*E‘�v˜wØœhÑ&ò Ð*Eð ñ(ñ!*ÓC¡ ˜1°·±¸cÕ1B’Q  ˆ ÐCÙ )ó#¡ ˜1°·±¸cÔ1Bܘq”\ò  ˆ ð#ä”c˜& 9Ñ,¨yÑ8Ð;KÑKÓLÓMÐMùó(ùòDùò#sÁ2C2 C8Â$C8Â.%C=có`‡‡—|tvrtj‰||«S‰jr6‰j�*|‰jvr|‰j vrt d|z«‚|tvrd|z}t |«‚|tvr�‰j�|‰jvrt d|z«‚t|«s)tt‰«|t||««|Šˆˆfd„}n^t‰|d|«tt‰«||«|‰j|<n*|dk(r|‰_yt‰|||«r|‰j|<‰j r/t#‰|«s#‰j%«›d|›�}t d|›�«‚t'|t(«r|‰j |<ytj‰||«S)Nz!Mock object has no attribute '%s'z.Attempting to set unsupported magic method %r.có•—‰‰g|¢­i|¤ŽSr5r!)rQÚkwrurPs €€r#rBz-NonCallableMock.__setattr__..sø€©H°TÐ,G¸DÒ,GÀBÒ,Gr"r,r?z Cannot set )rÔrgÚ __setattr__rrrkrEÚ_unsupported_magicsrUr'r`r7Ú _get_methodrér˜rrr)rar(r)rPrwrÒÚmsgÚ mock_namerus` @r#rtzNonCallableMock.__setattr__s¥ù€Ø ”>Ñ !ä×%Ñ% d¨D°%Ó8Ð 8Ø�nŠn ×!3Ñ!3Ð!?Ø ˜×*Ñ*Ñ *Ø ˜Ÿ ™ Ñ %Ü Ð!DÀtÑ!KÓLÐ LØ Ô(Ñ (ØBÀTÑIˆCÜ  Ó%Ð %Ø ”[Ñ Ø×!Ñ!Ð-°$¸d×>PÑ>PÑ2PÜ$Ð%HÈ4Ñ%OÓPÐPä$ UÔ+Üœ˜T›  D¬+°d¸EÓ*BÔCØ �ÜG‘ô& d¨E°4¸Ô>Üœ˜T›  D¨%Ô0Ø,1�×#Ñ# DÒ)Ø �[Ò Ø$ˆDÔ Ø ä$ T¨5°$¸Ô=Ø,1�×#Ñ# DÑ)à × Ò ¤W¨T°4Ô%8Ø×2Ñ2Ó4Ð5°Q°t°fÐ=ˆIÜ  ;¨y¨kÐ!:Ó;Ð ;ä �eœ\Ô *Ø"'ˆD�M‰M˜$Ñ Ø Ü×!Ñ! $¨¨eÓ4Ð4r"cóœ—|tvr;|t|«jvr$tt|«|«||jvry|jj |t «}||jvr tt|«j|«n|tur t|«‚|t ur |j|=t|j|<yr5) rUr7rkÚdelattrr˜rlÚ_missingrør Ú __delattr__r:rE)rPrwr.s r#r|zNonCallableMock.__delattr__+s«€Ø ”;Ñ  4¬4°«:×+>Ñ+>Ñ#>Ü ”D˜“J Ô %ؘ4Ÿ=™=Ñ(ðà×!Ñ!×%Ñ% d¬HÓ5ˆØ �4—=‘=Ñ Ü œ¨Ó .× :Ñ :¸4Õ @Ø ”H‰_Ü  Ó&Ð &Ø ”hÑ Ø×#Ñ# DÐ)Ü$,ˆ×јDÒ!r"có<—|jxsd}t|||«Sr<)rÆÚ_format_call_signature©rPrQrRrws r#Ú_format_mock_call_signaturez+NonCallableMock._format_mock_call_signature=s€Ø�‰Ò( &ˆÜ% d¨D°&Ó9Ð9r"cóp—d}|j||«}|j}|j|Ž}||||fzS)Nz0expected %s not found. Expected: %s Actual: %s)r€r•)rPrQrRÚactionÚmessageÚexpected_stringr•Ú actual_strings r#Ú_format_mock_failure_messagez,NonCallableMock._format_mock_failure_messageBsF€ØFˆØ×:Ñ:¸4ÀÓHˆØ—N‘Nˆ Ø8˜×8Ñ8¸)ÐDˆ ؘ& /°=ÐAÑAÐAr"có —|s |jSd}|jdd«jd«}|j}|D]K}|j |«}|�t |t «r|St|«}|j}|j}ŒM|S)aH * 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. Nr%rr?)rÚreplacerFr˜rlr(r9r?)rPrwrSÚnamesÚchildrenr<s r#Ú_get_call_signature_from_namez-NonCallableMock._get_call_signature_from_nameJs—€ñØ×'Ñ'Ð 'àˆØ— ‘ ˜T 2Ó&×,Ñ,¨SÓ1ˆØ×&Ñ&ˆãˆDØ—L‘L Ó&ˆE؈}¤ ¨5´*Ô =Øðˆ ô & eÓ,�Ø ×/Ñ/�Ø×+Ñ+‘ððˆ r"cóv—t|t«r#t|«dkDr|j|d«}n |j}|�Pt|«dk(rd}|\}}n|\}}} |j |i|¤Ž}t ||j|j«S|S#t$r}|jd«cYd}~Sd}~wwxYw)a 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. r®rNr) r(rgrÜr‹rrOrrQrRÚ TypeErrorÚwith_traceback)rPÚ_callrSrwrQrRÚ bound_callrps r#Ú _call_matcherzNonCallableMock._call_matcherks¾€ô �eœUÔ #¬¨E« °QªØ×4Ñ4°U¸1±XÓ>‰Cà×&Ñ&ˆCà ˆ?Ü�5‹z˜QŠØ�Ø$‘ �‘fà%*Ñ"��d˜Fð .Ø%˜SŸX™X tÐ6¨vÑ6� ܘD *§/¡/°:×3DÑ3DÓEÐEðˆLøôò .Ø×'Ñ'¨Ó-Õ-ûð .úsÁ2B B8ÂB3Â-B8Â3B8cóš—|jdk7r._error_message®sø€Ø×3Ñ3°D¸&ÓAˆC؈Jr"T©Útwo)r•r€r—r‘Ú_Callr(Ú Exception)rPrQrRÚexpectedÚactualÚ error_messagerŸÚcauses``` r#r}z"NonCallableMock.assert_called_with¢s ú€ð �>‰>Ð !Ø×7Ñ7¸¸fÓEˆHØ"‰Fâ¡ð)ˆMä  Ó/Ð /ö ð×%Ñ%¤e¨T°6¨NÀÔ&EÓFˆØ×#Ñ# D§N¡NÓ3ˆØ �XÒ Ü *¨8´YÔ ?‘HÀTˆEÜ ¡Ó!1Ó2¸Ð =ð r"có¼—|jdk(sz3NonCallableMock.assert_has_calls..Ïóèø€ÐF¡˜A¬Z¸¼9Õ-E”a¡ùó‚˜Nc3ó@•K—|]}‰j|«–—Œy­wr5©r‘©r®ÚcrPs €r#r¯z3NonCallableMock.assert_has_calls..Ðsøèø€ÐM¹_¸˜d×0Ñ0°×3¹_ùóƒzCalls not found.z+Error processing expected calls. Errors: {}ú Expected: z Actual)Úprefixr?r=z does not contain all of z in its call list, found z instead)r‘rïr�r�Úformatr(r£r—r–ÚrstriprfÚremoverGr!rÆrg) rPÚcallsÚ any_orderrµr¤r§Ú all_callsÚproblemrpÚ not_foundÚkalls ` r#r‰z NonCallableMock.assert_has_callsÄs~ø€ñ49Ó9±5¨a�D×&Ñ& qÕ)°5ˆÐ9ÜÑF¡ÓFÈÓMˆÜÓM¸T¿_º_ÓMÓMˆ ÙØ˜yÑ(Ø�=Ø0‘Gð ,ß-3©Vá-5ó$7Ù-5¨ô*4°A´yÔ)A¡AÀtÑ$KØ-5ñ$7ó.8ðô%Ø�ið !Ü!*¨5Ó!1Ð 2Ø×'Ñ'¨zÐ'Ó:×AÑAÀ#ÓFÐGðIóðð ð 䘓Oˆ àˆ ÛˆDð 'Ø× Ñ  Õ&ðñ Ü à&*§o¡oÒ&?¸Ñ&?Ü&+¨IÕ&6º ðCóðð  ð ùò7:ùò$7øôò 'Ø× Ñ  Ö&ð 'ús†DÁ+D#ÃD(Ä(EÅEcó"—|jt||fd¬««}t|t«r|nd}|jD�cgc]}|j|«‘Œ}}|s |t |«vr!|j ||«}td|z«|‚ycc}w)zùassert 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.Tr Nz%s call not found)r‘r¢r(r£r–Ú _AnyComparerr€r—©rPrQrRr¤r§rµr¥r„s r#r‹zNonCallableMock.assert_any_callñsš€ð ×%Ñ%¤e¨T°6¨NÀÔ&EÓFˆÜ& x´Ô;‘ÀˆØ15×1DÒ1DÓEÑ1D¨A�$×$Ñ$ QÕ'Ð1DˆÐEÙ �H¤L°Ó$8Ñ8Ø"×>Ñ>¸tÀVÓLˆOÜ Ø# oÑ5óàð ð9ùòFóÁB c óJ—|jr,d|vrd|d›�nd}|j«|z}t|«‚|jd«}||jdvr t di|¤ŽSt |«}t|t«r|tvrt }n�t|t«r0|tvs|jr||jvrt}nTt }nMt|t«s.t|t«rt}n&t|t«rt }n|j"d}di|¤ŽS)aPCreate 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).rwr?r%rþrrÚr!)rrarErlrkr r7r6rÚ_async_method_magicsr÷Ú_all_sync_magicsrÚ CallableMixinr r rrj)rPrsrbrxrþÚ_typeÚklasss r#r'zNonCallableMock._get_child_mocks€ð × Ò Ø,2°b©L˜!˜B˜v™J˜<Ñ(¸dˆIØ×/Ñ/Ó1°IÑ=ˆIÜ  Ó+Ð +à—F‘F˜;Ó'ˆ Ø ˜Ÿ ™  nÑ5Ñ 5Ü‘?˜r‘?Ð "ä�T“ ˆÜ �eœYÔ '¨IÔ9MÑ,Mä‰EÜ ˜œ~Ô .ØÔ-Ñ-Ø×&Ò&¨9¸×8JÑ8JÑ+Jä!‘ä!‘ܘE¤=Ô1ܘ%Ô!5Ô6Ü!‘ܘE¤?Ô3Ü‘à—M‘M !Ñ$ˆEÙ‰{�r‰{Ðr"cóT—|jsyd|›dt|j«›d�S)zÓRenders 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. rÚ z: r?)r�r)rPr¸s r#r–zNonCallableMock._calls_repr's-€ð�ŠØØ�F�8˜2œi¨¯©Ó8Ð9¸Ð;Ð;r") NNNNNNrNFNF©F)FFr5)r)ÚCalls)0rrrr rrXrùrArrrÚ"_NonCallableMock__get_return_valueÚ"_NonCallableMock__set_return_valueÚ"_NonCallableMock__return_value_docrÖr‘r,r×r“r”r•r–r�Ú!_NonCallableMock__get_side_effectÚ!_NonCallableMock__set_side_effectr—Úboolr�rrÄrar¹rhrtr|r€r†r‹r‘rƒr�r…r}r‡r‰r‹r'r–r!r"r#r r ™s`„Ù*ñ ‹G€Eð=AØEIØBØEIØò, 8ó*òZ ò #ôL � Ø!,×!;Ñ!;¸cÑ!AÀNÑ!R�ð&×6Ñ6ˆKð-Ó%r"cóš—|j}|�Bt|«r|‚t|«st|«}t|«r |‚||i|¤Ž}|tur|S|j tur |j S|jr(|jj tur |j S|j�|j|i|¤ŽS|j Sr5) r—r:rdrïrrËr‘r™r)rPrQrRÚeffectrvs r#räz CallableMixin._execute_mock_call§s΀ð×!Ñ!ˆØ РܘVÔ$Ø� ܘvÔ&ܘf›�Ü  Ô(Ø �Lá Ð0¨Ñ0�àœWÑ$Ø� à × "Ñ "¬'Ñ 1Ø×$Ñ$Ð $à × Ò  4×#6Ñ#6×#CÑ#CÌ7Ñ#RØ×$Ñ$Ð $à × Ñ Ð 'Ø#�4×#Ñ# TÐ4¨VÑ4Ð 4à× Ñ Ð r") rrrrrArWrDrârárär!r"r#rÉrÉ[s8„à ¨dÀØ $°¸dØ!¨R¸Tó 'ò ò 0ò8ò,7ó\!r"rÉcó—eZdZdZy)ra‰ 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. Nrr!r"r#rrÆs„ò7r"rcó:—d}|D]}||vsŒt|›d�«‚y)N)Ú autospectÚ auto_specÚset_specz5 might be a typo; use unsafe=True if this is intended)Ú RuntimeError)Úkwargs_to_checkÚtyposÚtypos r#Ú_check_spec_arg_typosrös1€Ø 2€EÛˆØ �?Ò "ÜØ�(ÐOÐPóð ñr"có€—eZdZdZgZddœd„Zd„Zd„Zd„Ze jd„«Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zy)Ú_patchNF©rc ó~—|� |tur td«‚|� td«‚| s t| «t|«rt d|›d|›d�«‚t|«rt d|›d|›d�«‚||_||_||_||_||_ ||_ d|_ ||_ ||_ | |_g|_d|_y)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=rz? as the spec_set target has already been mocked out. [spec_set=F)rrGrör'rÚgetterrbrÚ new_callablerûÚcreateÚ has_localrüÚautospecrRÚadditional_patchersÚ is_started) rPrûrbrrûrýrürÿrürRrs r#rAz_patch.__init__s€ð Ð #Øœ'Ñ!Ü ØBóððÐ#Ü ØGóðñÜ ! &Ô )Ü ˜TÔ "Ü"Ø# I =ð16Ø6:°X¸Qð@óAð Aô ˜XÔ &Ü"Ø# I =ð1AØAIÀ ÈAðOóPð PðˆŒ Ø"ˆŒØˆŒØ(ˆÔ؈Œ ؈Œ ؈ŒØ ˆŒ Ø ˆŒ ؈Œ Ø#%ˆÔ ؈�r"c óf—t|j|j|j|j|j |j |j|j|j« }|j|_ |jD�cgc]}|j«‘Œc}|_ |Scc}wr5) rørûrbrrûrýrürÿrürRÚattribute_namerÚcopy)rPÚpatcherÚps r#rz _patch.copy7sŒ€ÜØ �K‰K˜Ÿ™¨¯©°4·9±9Ø �K‰K˜Ÿ™Ø �M‰M˜4×,Ñ,¨d¯k©kó ˆð "&×!4Ñ!4ˆÔà"×6Ò6ó' Ù6˜ˆA�F‰F�HÐ6ñ' ˆÔ#ðˆùò' s B.có²—t|t«r|j|«Stj|«r|j |«S|j |«Sr5©r(r7Údecorate_classr+rÚdecorate_async_callableÚdecorate_callable)rPr2s r#rDz_patch.__call__DsM€Ü �dœDÔ !Ø×&Ñ& tÓ,Ð ,Ü × &Ñ & tÔ ,Ø×/Ñ/°Ó5Ð 5Ø×%Ñ% dÓ+Ð+r"cóÞ—t|«D]^}|jtj«sŒ#t ||«}t |d«sŒ<|j «}t||||««Œ`|S©NrD)r rVrÚ TEST_PREFIXr*r)rr`)rPrËrœÚ attr_valuers r#r z_patch.decorate_classLsa€Ü˜–JˆDØ—?‘?¤5×#4Ñ#4Ô5Øä  ¨Ó-ˆJܘ: zÔ2Øà—i‘i“kˆGÜ �E˜4¡¨Ó!4Õ 5ððˆ r"c#óRK—g}tj«5}|jD]U}|j|«}|j�|j |«Œ2|j tusŒE|j|«ŒW|t|«z }||f–—ddd«y#1swYyxYw­wr5) Ú contextlibÚ ExitStackÚ patchingsÚ enter_contextrÚupdaterrr!rg)rPÚpatchedrQÚkeywargsÚ extra_argsÚ exit_stackÚpatchingrHs r#Údecoration_helperz_patch.decoration_helperZs’èø€àˆ Ü × !Ñ !Ô # zØ#×-Ô-�Ø ×.Ñ.¨xÓ8�Ø×*Ñ*Ð6Ø—O‘O CÕ(Ø—\‘\¤WÒ,Ø×%Ñ% cÕ*ð .ð ”E˜*Ó%Ñ %ˆDؘÐ"Ò "÷$× #Ñ #üs#‚B'™ABÁ+'B B'ÂB$ B'c󘇇‡—t‰d«r‰jj‰«‰St‰«ˆˆˆfd„«Š‰g‰_‰S)Nrcól•—‰j‰||«5\}}‰|i|¤Žcddd«S#1swYyxYwr5©r©rQrÚnewargsÚ newkeywargsr2rrPs €€€r#rz)_patch.decorate_callable..patchedos=ø€à×'Ñ'¨Ø(,Ø(0ô2á5K°g¸{Ù˜WÐ4¨ Ñ4÷2÷2ò2ús• *ª3©r)rr!r©rPr2rs``@r#r z_patch.decorate_callableisKú€ä �4˜Ô %Ø �N‰N× !Ñ ! $Ô '؈Kä ˆt‹õ 5ó ð 5ð "˜FˆÔ؈r"c󘇇‡—t‰d«r‰jj‰«‰St‰«ˆˆˆfd„«Š‰g‰_‰S)NrcŸóˆ•K—‰j‰||«5\}}‰|i|¤Žƒd{–—†cddd«S7Œ #1swYyxYw­wr5rrs €€€r#rz/_patch.decorate_async_callable..patched€sNøèø€à×'Ñ'¨Ø(,Ø(0ô2á5K°g¸{Ù! 7Ð:¨kÑ:×:÷2ñ2ð;ø÷2ð2üs#ƒA—6¦4§6ª A´6¶?»Ar"r#s``@r#r z_patch.decorate_async_callablezsKú€ä �4˜Ô %Ø �N‰N× !Ñ ! $Ô '؈Kä ˆt‹õ ;ó ð ;ð "˜FˆÔ؈r"cóH—|j«}|j}t}d} |j|}d}|tvrt|t«rd|_ |js|turt |›d|›�«‚||fS#tt f$rt ||t«}YŒiwxYw)NFTz does not have the attribute ) rûrbrrkrEÚKeyErrorr*Ú _builtinsr(rrý)rPÚtargetrwruÚlocals r#Ú get_originalz_patch.get_original‹s¥€Ø—‘“ˆØ�~‰~ˆäˆØˆð Ø—‘ tÑ,ˆHðˆEà ”9Ñ ¤¨F´JÔ!?؈DŒKà�{Š{˜x¬7Ñ2Ü Ú7=¹tÐDóð ð˜ˆÐøô¤Ð)ò 6ܘv t¬WÓ5ŠHð 6ús¦A>Á> B! B!c óJ—|jr td«‚|j|j|j}}}|j |j }}|j}|j«|_ |durd}|durd}|durd}|� |� td«‚|€|�|dvr td«‚|j«\}}|tu�rl|�€id} |dur |}|dur|}d}n|� |dur |}d}n|dur|}|€|�%|tur td«‚t|t«rd} |�|} nb|€t|«rt } nN|€|�D|} |�|} t#| «rd | v} n t%| « } t| «rt } n| rt&} n t(} nt(} i} |�|| d <|�|| d <t| t«r+t+| t,«r|j.r|j.| d <| j1|«| di| ¤Ž}| �rFt3|«�r:|} |�|} t#| «st5| «st&} | j7d «| d|d dœ| ¤Ž|_nö|�ç|tur td«‚|tur td«‚t;|«}|dur|}t3|j«r)t=d|j.›d|j›d|›d�«‚t3|«rMt?|jd|j«}t=d|j.›d|›d|j›d|›d� «‚tA|f||j.dœ|¤Ž}n |r td«‚|}||_!||_"tGjH«|_%d|_ tM|j|j.|«|jN�ui}|jtur|||jN<|jPD]A}|jJjS|«}|jtusŒ1|j1|«ŒC|S|S#|jTtWjX«Žs‚YyxYw)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=TruerDrûrürwr%r&zBautospec creates the mock for you. Can't specify autospec and new.z%Can't use 'autospec' with create=TruerQz: as the patch target has already been mocked out. [target=rTrrrRrS)rüÚ_namez.Can't pass kwargs to a mock we aren't creatingr!)-rròrrûrürÿrRrürûr)r�r+rr(r7r/r rhr.r rr6r rbrr'rnrGr‘rÕrr*r Ú temp_originalÚis_localrrÚ _exit_stackr`rrrÚ__exit__ÚsysÚexc_info)rPrrûrürÿrRrürur*ÚinheritÚKlassÚ this_specÚ not_callableÚ_kwargsrYÚnew_attrrrrHs r#Ú __enter__z_patch.__enter__£s‹€à �?Š?ÜÐ9Ó:Ð :à"Ÿh™h¨¯ © °4·=±=�8ˆTˆØŸ=™=¨$¯+©+�&ˆØ×(Ñ(ˆ Ø—k‘k“mˆŒ ð �5‰=؈DØ �uÑ ØˆHØ �uÑ ØˆHà Ð  Ð 4ÜÐ=Ó>Ð >Ø Ð  Ð!5Ø ˜LÑ (ÜÐTÓUÐ Uà×+Ñ+Ó-‰ˆ�%à ”'Š>˜hÑ.؈GØ�t‰|à�ؘtÑ#Ø'�HØ‘DØÐ!ؘtÑ#Ø#�HØ‘DؘTÑ!Ø#�àР8Ð#7ØœwÑ&Ü#Ð$GÓHÐHܘh¬Ô-à"�GðÐ'Ø$‘Ø�¤-°Ô"9Ü!‘ØÐ! XÐ%9Ø � ØÐ'Ø (�IܘIÔ&Ø#-°YÐ#>‘Lä'/° Ó':Ð#:�LÜ  Ô+Ü%‘EÙ!Ü0‘Eä%‘Eä!�àˆGØÐØ"&�˜‘ØÐ#Ø&.�˜ Ñ#ô˜5¤$Ô'ܘ5¤/Ô2°t·~²~Ø"&§.¡.�˜‘à �N‰N˜6Ô "ÙÑ"˜'Ñ"ˆCâÔ,¨SÕ1ð!� ØÐ'Ø (�IÜ  Ô+Ü& yÔ1Ü0�Eà— ‘ ˜FÔ#Ù#(ð$4°SÀDñ$4Ø+2ñ$4�Õ à Ð !ðœ'Ñ!Üð(óððœ7Ñ"ÜÐ GÓHÐHܘH“~ˆHؘ4ÑØ#�ä  §¡Ô-Ü&Ø+¨D¯N©NÐ+=ð>à#Ÿ{™{˜o¨W°X°LÀðCóDðDô! Ô*Ü% d§k¡k°:¸t¿{¹{ÓK� Ü&Ø+¨D¯N©NÐ+=¸]Ø"�oð&Ø#Ÿ{™{˜o¨W°X°LÀðCóDðDô " (ðB°XØ(,¯©ñBØ:@ñB‰Cá ôÐLÓMÐ Màˆà%ˆÔ؈Œ Ü%×/Ñ/Ó1ˆÔ؈Œð Ü �D—K‘K §¡°Ô :Ø×"Ñ"Ð.Ø� Ø—8‘8œwÑ&Ø7:�J˜t×2Ñ2Ñ3Ø $× 8Ô 8�HØ×*Ñ*×8Ñ8¸ÓB�CØ—|‘|¤wÒ.Ø"×)Ñ)¨#Õ.ð!9ð"Ð!àˆJøð Ø �4—=‘=¤#§,¡,£.Ñ1Øñ2úsÍB O<Ï%O<Ï:O<Ï<$P"có—|jsy|jr>|jtur,t |j |j |j«n…t|j |j «|jsYt|j |j «r|j dvr+t |j |j |j«|`|`|`|j}|` d|_|j|ŽS)zUndo the patch.N)r rr^Ú__annotations__r_F) rr/r.rr`r)rbrzrýr)r0r1)rPr3rs r#r1z_patch.__exit__=sÌ€à�ŠØ à �=Š=˜T×/Ñ/´wÑ>Ü �D—K‘K §¡°×1CÑ1CÕ Dä �D—K‘K §¡Ô 0Ø—;’;¬°· ± ¸T¿^¹^Ô(LØŸ™ð+=ñ=ô˜Ÿ ™  T§^¡^°T×5GÑ5GÔHà Ð Ø ˆMØ ˆKØ×%Ñ%ˆ Ø Ð ØˆŒØ"ˆz×"Ñ" HÐ-Ð-r"có\—|j«}|jj|«|S©z-Activate a patch, returning any created mock.)r:Ú_active_patchesr!©rPrvs r#Ústartz _patch.startVs'€à—‘Ó!ˆØ ×Ñ×#Ñ# DÔ)؈ r"có~— |jj|«|jddd«S#t$rYywxYw©zStop an active patch.N)r?r»rGr1r¸s r#Ústopz _patch.stop]sD€ð Ø × Ñ × 'Ñ '¨Ô -ð �}‰}˜T 4¨Ó.Ð.øô ò áð ús ‚0° <»<)rrrrr?rArrDr rÚcontextmanagerrr r r+r:r1rArDr!r"r#rørø sg„à€NØ€OðAFô# òL ò,ò ð×Ññ #óð #òò"ò"ò0Xòt.ò2ó/r"røcó²— |jdd«\}}t t j |«|fS#tttf$rtd|›�«‚wxYw)Nr?rÚz,Need a valid target to patch. You supplied: )Úrsplitr�rGrErÚpkgutilÚ resolve_name)r)rbs r#Ú _get_targetrJisj€ðGØ"ŸM™M¨#¨qÓ1ш� ô ”7×'Ñ'¨Ó 0°)Ð ;Ð;øô ”z¤>Ð 2òGÜØ:¸6¸*Ð EóGð GðGús ‚3³#Arùc óv‡—t‰«turt‰›d�«‚ˆfd„} t| |||||||| |¬« S)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ó•—‰Sr5r!©r)s€r#rBz_patch_object..ˆsø€‘Vr"rù)r7Ústrr�rø) r)rbrrûrýrürÿrürrRrûs ` r#Ú _patch_objectrOrsSø€ô$ ˆFƒ|”sÑÜØˆjÐKÐ Ló ð ó€FÜ Ø� ˜3  fØ�(˜L¨&¸ô ðr"c ó~‡—t‰«turttj‰«}nˆfd„}|s t d«‚t |j««}|d\} } t|| | |||||i« } | | _ |ddD]:\} } t|| | |||||i« } | | _ | jj| «Œ<| S)a¾Perform 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ó•—‰Sr5r!rMs€r#rBz!_patch_multiple..¨sø€™r"z=Must supply at least one keyword argument with patch.multiplerrÚN) r7rNrrHrIrGrfrErørrr!) r)rûrýrürÿrürRrûrErbrrÚ this_patchers ` r#Ú_patch_multiplerS�sÙø€ô, ˆFƒ|”sÑÜœ×-Ñ-¨vÓ6‰ãˆá ÜØ Kó ð ô �—‘“Ó €Eؘ1‘X�N€IˆsÜØ� ˜3  f¨hØ�, ó€Gð'€GÔØ  ›)‰ˆ �3ÜØ �I˜s D¨&°(Ø �l Bó ˆ ð'0ˆ Ô#Ø×#Ñ#×*Ñ*¨<Õ8ð $ð €Nr"c óH—t|«\} } t| | ||||||||¬« S)a: `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. rù)rJrø) r)rrûrýrürÿrürrRrûrbs r#rrÀs7€ôV$ FÓ+Ñ€FˆIÜ Ø� ˜3  fØ�(˜L¨&¸ô ðr"cóT—eZdZdZdd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zy )Ú _patch_dicta# 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 ó„—||_t|«|_|jj|«||_d|_yr5)Úin_dictÚdictr8rÚclearÚ _original)rPrXr8rZrRs r#rAz_patch_dict.__init__/s4€ØˆŒ ä˜6“lˆŒ Ø � ‰ ×ј6Ô"؈Œ ؈�r"có²—t|t«r|j|«Stj|«r|j |«S|j |«Sr5r)rPÚfs r#rDz_patch_dict.__call__8sM€Ü �aœÔ Ø×&Ñ& qÓ)Ð )Ü × &Ñ & qÔ )Ø×/Ñ/°Ó2Ð 2Ø×%Ñ% aÓ(Ð(r"có2‡‡—t‰«ˆˆfd„«}|S)Nc󀕗‰j« ‰|i|¤Ž‰j«S#‰j«wxYwr5©rVÚ _unpatch_dict©rQrsr]rPs €€r#Ú_innerz-_patch_dict.decorate_callable.._innerAs8ø€à × Ñ Ô ð %Ù˜$�~ "‘~à×"Ñ"Õ$ø�×"Ñ"Õ$ús“+«=©r©rPr]rcs`` r#r z_patch_dict.decorate_callable@ó ù€Ü ˆq‹ô %ó ð %ðˆ r"có2‡‡—t‰«ˆˆfd„«}|S)NcŸóœ•K—‰j« ‰|i|¤Žƒd{–—†‰j«S7Œ#‰j«wxYw­wr5r`rbs €€r#rcz3_patch_dict.decorate_async_callable.._innerMsDøèø€à × Ñ Ô ð %Ù ˜^¨™^×+à×"Ñ"Õ$ð,ùà×"Ñ"Õ$üs%ƒA • 7 5¡7¤A µ7·A Á A rdres`` r#r z#_patch_dict.decorate_async_callableLrfr"có—t|«D]{}t||«}|jtj«sŒ/t |d«sŒ‘>ˆä�GÔð -Ø �N‰N˜8Õ $øÜò -Û�Ø'¨™}�˜’ ò ð -ús¥7·AÁAcó<—|j�|j«y)zUnpatch the dict.F)r[ra)rPrQs r#r1z_patch_dict.__exit__’s€à �>‰>Ð %Ø × Ñ Ô Ør"cód—|j«}tjj|«|Sr>)r:rør?r!r@s r#rAz_patch_dict.start™s'€à—‘Ó!ˆÜ×Ñ×%Ñ% dÔ+؈ r"có†— tjj|«|j ddd«S#t$rYywxYwrC)rør?r»rGr1r¸s r#rDz_patch_dict.stop sD€ð Ü × "Ñ "× )Ñ )¨$Ô /ð �}‰}˜T 4¨Ó.Ð.øô ò áð ús‚4´ A¿AN)r!F)rrrr rArDr r r r:rVrar1rArDr!r"r#rVrVs>„ñó8ò)ò ò òòò +ò8 -òòó/r"rVcón— |j«y#t$rt|«}|D]}||=ŒYywxYwr5)rZrErf)rXÚkeysrCs r#rnrn«s9€ðØ� ‰ �øÜ òÜ�G‹}ˆÛˆCؘ‘ òðús ‚“4³4có`—ttj«D]}|j«Œy)z7Stop all active patches. LIFO to unroll nested patches.N)r[rør?rD)rs r#Ú_patch_stopallrv´s €äœ&×0Ñ0Ö1ˆØ � ‰ � ñ2r"Útestz¿lt 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#ó&K—|] }d|z–—Œ y­w)zi%sNr!©r®Úns r#r¯r¯Ósèø€Ð7Ñ&6 �5˜1•9Ñ&6ùó‚c#ó&K—|] }d|z–—Œ y­w)zr%sNr!rzs r#r¯r¯Ôsèø€Ð5Ñ$4˜q�˜•Ñ$4ùr|>rhÚ__get__Ú__set__r¹Ú __delete__Ú __format__r¼Ú __missing__Ú __getstate__Ú __reversed__Ú __setstate__Ú __getformat__Ú __reduce_ex__Ú__getnewargs__Ú__subclasses__Ú__getinitargs__Ú__getnewargs_ex__có ‡—ˆfd„}||_|S)z:Turns a callable object (like a mock) into a real functioncó•—‰|g|¢­i|¤ŽSr5r!)rPrQrsr2s €r#Úmethodz_get_method..methodåsø€Ù�DÐ&˜4Ò& 2Ñ&Ð&r")r)rwr2rŽs ` r#rvrvãsø€ô'à€F„OØ €Mr"r­>Ú __aexit__Ú __anext__Ú __aenter__Ú __aiter__>Ú__del__rùrArÄÚ __prepare__rtÚ__instancecheck__Ú__subclasscheck__có,—tj|«Sr5)rgÚ__hash__r¸s r#rBrBs €œVŸ_™_¨TÔ2r"có,—tj|«Sr5)rgÚ__str__r¸s r#rBrBs €œFŸN™N¨4Ô0r"có,—tj|«Sr5)rgÚ __sizeof__r¸s r#rBrBs€œv×0Ñ0°Ô6r"cój—t|«j›d|j«›dt|«›�S)NÚ/)r7rrar7r¸s r#rBrBs3€¤$ t£*×"5Ñ"5Ð!6°a¸×8OÑ8OÓ8QÐ7RÐRSÔTVÐW[ÓT\ÐS]Ñ^r")r˜ršrœÚ __fspath__rÚyð?gð?) Ú__lt__Ú__gt__Ú__le__Ú__ge__Ú__int__rÛÚ__len__r1Ú __complex__Ú __float__Ú__bool__Ú __index__r�có‡—ˆfd„}|S)NcóZ•—‰jj}|tur|S‰|urytS©NT)Ú__eq__rËrÚNotImplemented)ÚotherÚret_valrPs €r#r­z_get_eq..__eq__s/ø€Ø—+‘+×0Ñ0ˆØ œ'Ñ !؈NØ �5‰=ØÜÐr"r!)rPr­s` r#Ú_get_eqr±sø€ôð €Mr"có‡—ˆfd„}|S)Ncó^•—‰jjturtS‰|urytS©NF)Ú__ne__rËrr®)r¯rPs €r#rµz_get_ne..__ne__#s*ø€Ø �;‰;× )Ñ )´Ñ 8܈NØ �5‰=ØÜÐr"r!)rPrµs` r#Ú_get_ner¶"sø€ôð €Mr"có‡—ˆfd„}|S)Ncól•—‰jj}|tur tg«St|«Sr5)Ú__iter__rËrrí©r°rPs €r#r¹z_get_iter..__iter__,s/ø€Ø—-‘-×2Ñ2ˆØ ”gÑ Ü˜“8ˆOô�G‹}Ðr"r!)rPr¹s` r#Ú _get_iterr»+sø€ôð €Or"có‡—ˆfd„}|S)Ncó�•—‰jj}|turtt g««Stt |««Sr5)r’rËrÚ_AsyncIteratorrírºs €r#r’z"_get_async_iter..__aiter__6s8ø€Ø—.‘.×3Ñ3ˆØ ”gÑ Ü!¤$ r£(Ó+Ð +Üœd 7›mÓ,Ð,r"r!)rPr’s` r#Ú_get_async_iterr¿5sø€ô-ð Ðr")r­rµr¹r’cóð—tj|t«}|tur||_ytj|«}|�||«}||_yt j|«}|�||«|_yyr5)Ú_return_valuesrlrr‘Ú_calculate_return_valueÚ_side_effect_methodsr—)r=rŽrwÚfixedÚreturn_calculatorr‘Ú side_effectors r#Ú_set_return_valuerÇFs{€Ü × Ñ ˜t¤WÓ -€EØ ”GÑØ#ˆÔØä/×3Ñ3°DÓ9ÐØÐ$Ù(¨Ó.ˆ Ø*ˆÔØä(×,Ñ,¨TÓ2€MØÐ Ù*¨4Ó0ˆÕð!r"có—eZdZd„Zd„Zy)Ú MagicMixincó„—|j«tt|«j|i|¤Ž|j«yr5)Ú_mock_set_magicsrørÉrA)rPrQrss r#rAzMagicMixin.__init__Ys6€Ø ×ÑÔØ.Œ ”J Ó%×.Ñ.°Ð;¸Ò;Ø ×ÑÕr"c óz—ttz}|}t|dd«�U|j|j«}t «}||z }|D]&}|t |«jvsŒt||«Œ(|t t |«j«z }t |«}|D]}t||t||««Œy)Nr) Ú_magicsrÇr*Ú intersectionrrir7rkrzr`Ú MagicProxy)rPÚ orig_magicsÚ these_magicsÚ remove_magicsrArÊs r#rËzMagicMixin._mock_set_magics_s¯€ÜÔ 4Ñ4ˆ Ø"ˆ ä �4˜¨$Ó /Ð ;Ø&×3Ñ3°D×4FÑ4FÓGˆLä›EˆMØ'¨,Ñ6ˆMã&�ØœD ›J×/Ñ/Ò/ä˜D %Õ(ð'ð $¤c¬$¨t«*×*=Ñ*=Ó&>Ñ>ˆ ä�T“ ˆÛ!ˆEÜ �E˜5¤*¨U°DÓ"9Õ :ñ"r"N)rrrrArËr!r"r#rÉrÉXs „ò ó ;r"rÉcó—eZdZdZdd„Zy)r z-A version of `MagicMock` that isn't callable.cóH—|j||«|j«yr©rrËrs r#rz"NonCallableMagicMock.mock_add_specyó €ð ×јD (Ô+Ø ×ÑÕr"NrÎ)rrrr rr!r"r#r r ws „Ù7ô r"r có —eZdZy)ÚAsyncMagicMixinN)rrrr!r"r#rØr؃s„Ør"rØcó6‡—eZdZdZdd„Zddœdefˆfd„ZˆxZS)ra„ 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`. FcóH—|j||«|j«yrrÕrs r#rzMagicMock.mock_add_spec’rÖr")r‘r‘c󈕗|r#|jrt|j«rd}t«j|d|i|¤Žy)NFr‘)rÆr±Úsuperr�)rPr‘rQrRr,s €r#r�zMagicMock.reset_mock›s<ø€á Ø—’ܘ$Ÿ/™/Ô*ð !ˆLØŒ‹×јDÐF¨|ÐF¸vÓFr"rÎ)rrrr rrÕr�Ú __classcell__©r,s@r#rr‡s&ø„ñ ó ð9>ò G°÷ Gñ Gr"rcó —eZdZd„Zd„Zdd„Zy)rÏcó —||_||_yr5©rwræ)rPrwræs r#rAzMagicProxy.__init__©s€ØˆŒ ؈� r"có’—|j}|j}|j|||¬«}t|||«t |||«|S)N)rwrþrÿ)rwrær'r`rÇ)rPrAræÚms r#Ú create_mockzMagicProxy.create_mock­sM€Ø— ‘ ˆØ—‘ˆØ × "Ñ "¨¸Ø/5ð #ó 7ˆä�˜˜qÔ!ܘ& ! UÔ+؈r"Ncó"—|j«Sr5)rä)rPr.rÊs r#r~zMagicProxy.__get__¶s€Ø×ÑÓ!Ð!r"r5)rrrrArär~r!r"r#rÏrϨs„òòô"r"rÏc󊇗eZdZed«Zed«Zed«Zˆfd„Zd„Zd„Z d„Z d„Z d „Z d „Z dd „Zd „Zˆfd „ZˆxZS)r÷r¨r©rªcóØ•—t«j|i|¤Žtjj|j d<d|j d<d|j d<t «|j d<tr7tt¬«}t|j d<t|j d<ntt¬«}tjtjztjz|_d|_d |_d|_d|_||j d <d |j d <t)«|j d <i|j d<d|j d<y)Nr§rÚ_mock_await_countÚ_mock_await_argsÚ_mock_await_args_list©rürr)rQrRr1r rr^r_r<)rÜrAr¥r¦r§rkr�Ú _CODE_SIGr Ú _CODE_ATTRSrr+Ú CO_COROUTINEÚ CO_VARARGSÚCO_VARKEYWORDSÚco_flagsÚ co_argcountÚ co_varnamesÚco_posonlyargcountÚco_kwonlyargcountrg)rPrQrRÚ code_mockr,s €r#rAzAsyncMockMixin.__init__Æs6ø€ØŒ‹×ј$Ð) &Ò)ô*1×);Ñ);×)IÑ)Iˆ� ‰ �oÑ&Ø-.ˆ� ‰ Ð)Ñ*Ø,0ˆ� ‰ Ð(Ñ)Ü1:³ˆ� ‰ Ð-Ñ.Ý Ü'´Ô=ˆIÜ08ˆI× Ñ ˜}Ñ -Ü4=ˆI× Ñ Ð0Ò 1ä'´Ô:ˆIä × Ñ Ü× Ñ ñ !ä×$Ñ$ñ %ð Ôð !"ˆ ÔØ 2ˆ ÔØ'(ˆ Ô$Ø&'ˆ Ô#Ø$-ˆ� ‰ �jÑ!Ø$/ˆ� ‰ �jÑ!Ü(-«ˆ� ‰ �nÑ%Ø*,ˆ� ‰ Ð&Ñ'Ø+/ˆ� ‰ Ð'Ò(r"c�óŒK—t||fd¬«}|xjdz c_||_|jj |«|j }|�_t |«r|‚t|«s t|«}t |«r&|‚t|«r||i|¤Žƒd{–—†}n||i|¤Ž}|tur|S|jtur |jS|j�At|j«r|j|i|¤Žƒd{–—†S|j|i|¤ŽS|jS#t$rt‚wxYw7Œ¡7Œ7­w)NTr rÚ)r¢r¨r©rªr!r—r:rdrïÚ StopIterationÚStopAsyncIterationrrrËr‘r)rPrQrRr�rìrvs r#räz!AsyncMockMixin._execute_mock_callçsTèø€ô�t˜V�n¨$Ô/ˆØ ×Ò˜AÑÕØˆŒØ ×Ñ×#Ñ# EÔ*à×!Ñ!ˆØ РܘVÔ$Ø� ܘvÔ&ð-Ü! &›\�Fô ! Ô(Ø �LÜ$ VÔ,Ù% tÐ6¨vÑ6×6‘á Ð0¨Ñ0�àœWÑ$Ø� à × "Ñ "¬'Ñ 1Ø×$Ñ$Ð $à × Ñ Ð 'Ü" 4×#3Ñ#3Ô4Ø-˜T×-Ñ-¨tÐ>°vÑ>×>Ð>Ø#�4×#Ñ# TÐ4¨VÑ4Ð 4à× Ñ Ð øô-%ò-ô-Ð,ð-úð7øð?ús=‚A-EÁ0 D-Á;#EÂEÂA+EÄ EÄ "EÄ-D=Ä=EÅEcó`—|jdk(rd|jxsd›d�}t|«‚y)zA Assert that the mock was awaited at least once. rú Expected r=z to have been awaited.N©r¨rÆr—r˜s r#ržzAsyncMockMixin.assert_awaited s;€ð × Ñ ˜qÒ Ø˜dŸo™oÒ7°Ð8Ð8NÐOˆCÜ  Ó%Ð %ð !r"cóz—|jdk(s,d|jxsd›d|j›d�}t|«‚y)z@ Assert that the mock was awaited exactly once. rÚrûr=ú$ to have been awaited once. Awaited r”Nrür˜s r#rŸz"AsyncMockMixin.assert_awaited_once sM€ð×Ñ 1Ò$ؘtŸ™Ò8°&Ð9ð:Ø#×/Ñ/Ð0°ð9ˆCä  Ó%Ð %ð%r"có8‡‡‡—‰j€!‰j‰‰«}td|›d�«‚ˆˆˆfd„}‰jt ‰‰fd¬««}‰j‰j«}||k7r%t |t «r|nd}t|««|‚y)zN Assert that the last await was with the specified arguments. NzExpected await: z Not awaitedcó0•—‰j‰‰d¬«}|S)NÚawait)r‚r�ržs €€€r#rŸz:AsyncMockMixin.assert_awaited_with.._error_message( sø€Ø×3Ñ3°D¸&ÈÐ3ÓQˆC؈Jr"Tr )r©r€r—r‘r¢r(r£)rPrQrRr¤rŸr¥r§s``` r#r z"AsyncMockMixin.assert_awaited_with s™ú€ð �?‰?Ð "Ø×7Ñ7¸¸fÓEˆHÜ Ð#3°H°:¸]Ð!KÓLÐ Lö ð×%Ñ%¤e¨T°6¨NÀÔ&EÓFˆØ×#Ñ# D§O¡OÓ4ˆØ �XÒ Ü *¨8´YÔ ?‘HÀTˆEÜ ¡Ó!1Ó2¸Ð =ð r"cóœ—|jdk(s,d|jxsd›d|j›d�}t|«‚|j|i|¤ŽS)zi Assert that the mock was awaited exactly once and with the specified arguments. rÚrûr=rþr”)r¨rÆr—r r©s r#r¡z'AsyncMockMixin.assert_awaited_once_with2 s`€ð ×Ñ 1Ò$ؘtŸ™Ò8°&Ð9ð:Ø#×/Ñ/Ð0°ð9ˆCä  Ó%Ð %Ø'ˆt×'Ñ'¨Ð8°Ñ8Ð8r"có"—|jt||fd¬««}t|t«r|nd}|jD�cgc]}|j|«‘Œ}}|s |t |«vr!|j ||«}td|z«|‚ycc}w)zU Assert the mock has ever been awaited with the specified arguments. Tr Nz%s await not found)r‘r¢r(r£rªrÃr€r—rÄs r#r¢zAsyncMockMixin.assert_any_await= sš€ð×%Ñ%¤e¨T°6¨NÀÔ&EÓFˆÜ& x´Ô;‘ÀˆØ15×1EÒ1EÓFÑ1E¨A�$×$Ñ$ QÕ'Ð1EˆÐFÙ �H¤L°Ó$8Ñ8Ø"×>Ñ>¸tÀVÓLˆOÜ Ø$ Ñ6óàð ð9ùòGrÅc ó@‡—|D�cgc]}‰j|«‘Œ}}td„|D«d«}tˆfd„‰jD««}|sb||vr]|€d}n1dj |D�cgc]}t |t «r|nd‘Œc}«}t|›dt|«›d‰j›�«|‚yt|«}g} |D]} |j| «Œ| rtt| «›d�«|‚ycc}wcc}w#t$r| j| «YŒXwxYw) a´ 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`. c3óBK—|]}t|t«sŒ|–—Œy­wr5r¬r­s r#r¯z3AsyncMockMixin.assert_has_awaits..W r°r±Nc3ó@•K—|]}‰j|«–—Œy­wr5r³r´s €r#r¯z3AsyncMockMixin.assert_has_awaits..X søèø€ÐSÑ>R¸˜t×1Ñ1°!×4Ñ>Rùr¶zAwaits not found.z,Error processing expected awaits. Errors: {}r·z Actual: z not all found in await list) r‘rïr�rªr¹r(r£r—rfr»rGr!rg) rPr¼r½rµr¤r§Ú all_awaitsr¿rprÀrÁs ` r#r£z AsyncMockMixin.assert_has_awaitsJ s\ø€ñ49Ó9±5¨a�D×&Ñ& qÕ)°5ˆÐ9ÜÑF¡ÓFÈÓMˆÜÓS¸d×>RÒ>RÓSÓSˆ ÙØ˜zÑ)Ø�=Ø1‘Gð ,ß-3©Vá-5ó$7Ù-5¨ô*4°A´yÔ)A¡AÀtÑ$KØ-5ñ$7ó.8ðô%Ø�ið !Ü!*¨5Ó!1Ð 2ð3Ø#×3Ñ3Ð4ð6óðð ð ä˜*Ó%ˆ àˆ ÛˆDð 'Ø×!Ñ! $Õ'ðñ Ü Ü49¸)Õ4DÐFóàð ð ùò7:ùò$7øôò 'Ø× Ñ  Ö&ð 'ús†C6Á+C;ÃDÄDÄDcóz—|jdk7r,d|jxsd›d|j›d�}t|«‚y)z9 Assert that the mock was never awaited. rrûr=z# to not have been awaited. Awaited r”Nrür˜s r#r¤z!AsyncMockMixin.assert_not_awaitedv sM€ð × Ñ ˜qÒ Ø˜tŸ™Ò8°&Ð9ð:Ø#×/Ñ/Ð0°ð9ˆCä  Ó%Ð %ð !r"cót•—t«j|i|¤Žd|_d|_t «|_y)z0 See :func:`.Mock.reset_mock()` rN)rÜr�r¨r©r�rª)rPrQrRr,s €r#r�zAsyncMockMixin.reset_mock s5ø€ð Œ‹×јDÐ+ FÒ+ØˆÔØˆŒÜ(›{ˆÕr"rÎ)rrrr×r¨r©rªrAräržrŸr r¡r¢r£r¤r�rÝrÞs@r#r÷r÷Ás\ø„Ù& }Ó5€KÙ% lÓ3€JÙ*Ð+<Ó=€Oô0òB&!òP&ò&ò>ò$ 9ò ó*òX&÷+ð+r"r÷có—eZdZdZy)r aY 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. Nrr!r"r#r r ‰ s„ò'r"r có"—eZdZdZd„Zd„Zd„Zy)Ú_ANYz2A helper object that compares equal to everything.có—yr¬r!©rPr¯s r#r­z _ANY.__eq__· s€Ør"có—yr´r!rs r#rµz _ANY.__ne__º s€Ør"có—y)Nzr!r¸s r#r¹z _ANY.__repr__½ s€Ør"N)rrrr r­rµr¹r!r"r#r r ´ s„Ù8òòór"r c ó—d|z}d}dj|D�cgc] }t|«‘Œc}«}dj|j«D��cgc] \}}|›d|›�‘Œc}}«} |r|}| r |r|dz }|| z }||zScc}wcc}}w)Nz%s(%%s)rz, Ú=)r\ÚreprrE) rwrQrRrƒÚformatted_argsrHÚ args_stringrCrÒÚ kwargs_strings r#r~r~Ä sŸ€Ø˜$Ñ€GØ€NØ—)‘)±$Ó7±$¨3œT #�Y°$Ñ7Ó8€KØ—I‘IØ17·±´ôÙ1?¡: 3¨’3™Ò°òó€MñØ$ˆÙÙ Ø ˜dÑ "ˆNؘ-Ñ'ˆà �^Ñ #Ð#ùò8ùós —A>ÁB cóŠ—eZdZdZ dd„Z dd„Zd„ZejZd„Z d„Z d„Z d „Z e d „«Ze d „«Zd „Zd „Zy)r¢a£ 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. Ncón—d}i}t|«}|dk(r|\}}}nh|dk(r2|\} } t| t«r| }t| t«r| }n9| }n6| | }}n1|dk(r,|\}t|t«r|}nt|t«r|}n|}|rtj |||f«Stj ||||f«S)Nr!ér®rÚ)rÜr(rNrgrù) rúrÒrwrær¡Ú from_kallrQrRÚ_lenÚfirstÚseconds r#rùz _Call.__new__é sÅ€àˆØˆÜ�5‹zˆØ �1Š9Ø!&Ñ ˆD�$™Ø �QŠYØ!‰MˆE�6ܘ%¤Ô%Ø�ܘf¤eÔ,Ø!‘Dà#‘Fà$ f�f‘Ø �QŠY؉FˆEܘ%¤Ô%ؑܘE¤5Ô)Ø‘à�á Ü—=‘=  t¨V nÓ5Ð 5ä�}‰}˜S 4¨¨vÐ"6Ó7Ð7r"có.—||_||_||_yr5)rÆrÇÚ_mock_from_kall)rPrÒrwrær¡rs r#rAz_Call.__init__ s€àˆŒØ"ˆÔØ(ˆÕr"có"— t|«}d}t|«dk(r|\}}n|\}}}t|dd«r't|dd«r|j|jk7ryd}|dk(rdi}}n‚|dk(r|\}}}nv|dk(r5|\} t | t «r| }i}nXt | t«r| }di}}nAd}| }n<|dk(r6|\} } t | t«r| }t | t «r| i}}n d| }}n| | }}ny|r||k7ry||f||fk(S#t$r tcYSwxYw) Nrr®rÇFrr!rrÚ)rÜr�r®r*rÇr(rgrN) rPr¯Ú len_otherÚ self_nameÚ self_argsÚ self_kwargsÚ other_nameÚ other_argsÚ other_kwargsrÒrrs r#r­z _Call.__eq__ sV€ð "ܘE› ˆIðˆ Ü ˆt‹9˜Š>Ø%)Ñ "ˆI‘{à04Ñ -ˆI�y +ä �D˜.¨$Ô /´G¸EÀ>ÐSWÔ4XØ×%Ñ%¨×);Ñ);Ò;Øàˆ Ø ˜Š>Ø')¨2˜ ‰JØ ˜!Š^Ø38Ñ 0ˆJ˜ ¡LØ ˜!Š^؉FˆEܘ%¤Ô'Ø"� Ø!‘ ܘE¤3Ô'Ø"� Ø+-¨r˜L‘ à� Ø$‘ Ø ˜!Š^à!‰MˆE�6ܘ%¤Ô%Ø"� ܘf¤eÔ,Ø/5°r  ‘Jà/1°6  ‘Jà+0°&˜L‘ àá ˜ yÒ0Øð˜LÐ)¨i¸Ð-EÑEÐEøô_ò "Ü!Ò !ð "ús‚ C<Ã<DÄ DcóŽ—|j€td||fd¬«S|jdz}t|j||f||¬«S)Nrr%r°rá©rÆr¢rs r#rDz_Call.__call__H sH€Ø �?‰?Ð "ܘ"˜d FÐ+°$Ô7Ð 7à�‰ Ñ%ˆÜ�d—o‘o t¨VÐ4¸4ÈÔMÐMr"cór—|j€ t|d¬«S|j›d|›�}t||d¬«S)NF)rwrr?)rwrærr))rPrœrws r#rÄz_Call.__getattr__P s6€Ø �?‰?Ð "ܘd¨eÔ4Ð 4ØŸ/›/©4Ð0ˆÜ˜$ t°uÔ=Ð=r"có^—|tjvrt‚tj||«Sr5)rgrkrEÚ__getattribute__)rPrœs r#r,z_Call.__getattribute__W s'€Ø ”5—>‘>Ñ !Ü Ð Ü×%Ñ% d¨DÓ1Ð1r"cóD—t|«dk(r |\}}||fS|\}}}||fS)Nr®)rÜrs r#Ú_get_call_argumentsz_Call._get_call_arguments] s:€Ü ˆt‹9˜Š>؉LˆD�&ð�Vˆ|Ðð"&Ñ ˆD�$˜à�Vˆ|Ðr"có(—|j«dS©Nr©r.r¸s r#rQz _Call.argse ó€à×'Ñ'Ó)¨!Ñ,Ð,r"có(—|j«dS)NrÚr1r¸s r#rRz _Call.kwargsi r2r"cóþ—|js(|jxsd}|jd«rd|z}|St|«dk(rd}|\}}n'|\}}}|sd}n|jd«sd|z}nd|z}t |||«S)Nrr%zcall%sr®zcall.%s)rrÆrVrÜr~)rPrwrQrRs r#r¹z_Call.__repr__m sŽ€Ø×#Ò#Ø—?‘?Ò, fˆDØ�‰˜tÔ$Ø $‘�؈Kä ˆt‹9˜Š>؈D؉LˆD‘&à!%Ñ ˆD�$˜Ùؑؗ_‘_ TÔ*Ø  4Ñ'‘à $‘�Ü% d¨D°&Ó9Ð9r"cóŽ—g}|}|�,|jr|j|«|j}|�Œ,tt |««S)z•For a call object that represents multiple calls, `call_list` returns a list of all the intermediate calls as well as the final call.)rr!rÇr�r[)rPÚvalsÚthings r#Ú call_listz_Call.call_list‚ sM€ðˆØˆØÐØ×$Ò$Ø— ‘ ˜EÔ"Ø×&Ñ&ˆEðÑôœ $›Ó(Ð(r")r!rNFT)r!NNFT)rrrr rùrAr­rgrµrDrÄr,r.rÖrQrRr¹r8r!r"r#r¢r¢Ö s|„ñð$:?Øó8ð@>CØó)ò2Fðj�]‰]€FòNò>ò2ò ðñ-óð-ðñ-óð-ò:ó* )r"r¢)rc óž—t|«r t|«}t|t«}t|«rt d|›d�«‚t |«}d|i} |rd|i} n|€i} | r|rd| d<|s t |«|jd|«}|} |€d } | j|«t} tj|«ri} n=|r|r td «‚t} n't|«st} n|r|rt!|«st} | d||| |d œ| ¤Ž} t|t"«rt%| |«} |rt'| «nt)|| ||«|�|s| |j*|<|jd d«} |r|sd |vrt-||dd| | ¬«| _t1|«D�]}t3|«rŒ t5||«}d|i}| rt9| |«r|j|¬«|rd|i}t|t"«st;||| ||«}|| j*|<n~| }t|t"«r | j<}t?|||«}||d<tA|«rt}nt}|d||||dœ|¤Ž}|| j*|<|«|_t)|||¬«t|t"«s�ŒtC| ||«�Œt| «r|r| jDdi|¤Ž| S#t6$rY�ŒCwxYw)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=rrûrüNTrrwrzJInstance can not be True when create_autospec is mocking an async function)rærÿrþrwrr‘r%)rZr-rèrrdr)rærwrþrÿ)rYr!)#rhr7r(r'rr3rörGrrr+Úisdatadescriptorròr rdr rnr>rzr«r[r˜r r‘r r±r*rEr)r9r=Ú _must_skiprr`r)rûrürZrèr-rrRÚis_typeÚ is_async_funcr8rþr5r=ÚwrappedrAruÚ child_kwargsrrærYÚ child_klasss r#r r ’ s€ô.�„~ô�D‹zˆä˜œtÓ$€GܘÔÜð"*Ø*.¨°ð 4ó5ð 5ä" 4Ó(€MØ�tˆn€GÙØ˜tÐ$‰Ø ˆàˆÙ‘8Ø'+ˆÐ#Ñ$٠ܘfÔ%à �J‰J�v˜uÓ %€EØ€IØ€àˆ à ‡N�N�6Ôä €EÜ×Ñ Ô%ð‰Ù Ù Üð >ó?ð ?ä‰Ü �tŒ_Ü$‰Ù ‘XÔ&8¸Ô&>Ü$ˆá ð (˜¨WÀ Øñ (Ø&ñ (€Dô�$œ Ô&ô˜d DÓ)ˆÙ Ü ˜dÕ #䘘t W¨hÔ7àС8Ø(,ˆ×јuÑ%ð�j‰j˜ $Ó'€GÙ‘x N¸&Ñ$@Ü+¨D°(ÀTØ26ÀØ29ô;ˆÔô�T—ˆÜ �UÔ à ð ܘt UÓ+ˆHð Ð)ˆ á ”w˜w¨Ô.Ø × Ñ  hÐ Ô /Ù Ø&¨Ð1ˆLä˜(¤MÔ2ܘX x°°u¸hÓGˆCØ),ˆD× Ñ  Ò &àˆFܘ$¤ Ô.ØŸ™�ä" 4¨°Ó8ˆIØ(1ˆL˜Ñ %Ü" 8Ô,Ü'‘ ä'� ÙðB V°%À5Ø*0ñBØ4@ñBˆCà),ˆD× Ñ  Ñ &Ù*›}ˆCÔ Ü ˜X s°iÕ @ô �cœ=Ö )Ü �D˜% Ö %ðgôn˜Ô¡6؈×ÑÑ%˜fÒ%à €KøôUò Ú ð úsÆ J?Ê? K Ë K có,—t|t«s|t|di«vry|j}|jD]X}|j j |t«}|turŒ,t|ttf«ryt|t«r|cSy|S)z[ Return whether we should skip the first argument on spec's `entry` attribute. rkF) r(r7r*r,rjrkrlrrCrBr>)rûrAr<rËrvs r#r;r;( s‡€ô �dœDÔ !Ø ”G˜D *¨bÓ1Ñ 1àØ�~‰~ˆà—”ˆØ—‘×#Ñ# E¬7Ó3ˆØ ”WÑ Ø Ü �fœ|¬[Ð9Ô :ÙÜ ˜¤ Ô .ðŠNáðð €Nr"có—eZdZ dd„Zy)r9NcóX—||_||_||_||_||_||_yr5)rûÚidsrürærZrw)rPrûrürærwrDrZs r#rAz_SpecState.__init__F s,€àˆŒ ؈ŒØ ˆŒ ؈Œ Ø ˆŒ ؈� r")FNNNF)rrrrAr!r"r#r9r9D s „à48Ø/4ôr"r9cóv—t|t«rtj|«Stj|«Sr5)r(ÚbytesÚioÚBytesIOÚStringIO)Ú read_datas r#Ú _to_streamrK\ s*€Ü�)œUÔ#Ü�z‰z˜)Ó$Ð$ä�{‰{˜9Ó%Ð%r"c ód‡‡‡ ‡ ‡ —t‰«}|dgŠ ˆ ˆ fd„}ˆ ˆ fd„}ˆˆ fd„Š ˆ ˆ fd„Šˆ ˆ fd„}t€Vddl}tt t |j ««jt t |j««««at€+ddl}tt t |j«««a |€tdt¬ «}tt¬ «Š ‰ ‰ j_ d‰ j_ d‰ j_ d‰ j _ d‰ j"_ |‰ j_‰ «‰ d <‰ d ‰ j _|‰ j"_‰‰ j&_|‰ j(_ˆ ˆ ˆ ˆfd „}||_‰ |_ |S) 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󆕗‰jj�‰jjS‰dj|i|¤ŽSr0)Ú readlinesr‘©rQrRÚ_stateÚhandles €€r#Ú_readlines_side_effectz)mock_open.._readlines_side_effectr sCø€Ø × Ñ × (Ñ (Ð 4Ø×#Ñ#×0Ñ0Ð 0Ø"ˆv�a‰y×"Ñ" DÐ3¨FÑ3Ð3r"c󆕗‰jj�‰jjS‰dj|i|¤ŽSr0)Úreadr‘rOs €€r#Ú_read_side_effectz$mock_open.._read_side_effectw s=ø€Ø �;‰;× #Ñ #Ð /Ø—;‘;×+Ñ+Ð +؈v�a‰y�~‰~˜tÐ. vÑ.Ð.r"c?ó`•K—‰«Ed{–—† ‰dj|i|¤Ž–—Œ7Œ­wr0)Úreadline)rQrRÚ_iter_side_effectrPs €€r#Ú_readline_side_effectz(mock_open.._readline_side_effect| s<øèø€Ù$Ó&×&Ð&ØØ$�&˜‘)×$Ñ$ dÐ5¨fÑ5Ò 5ðð 'ús ƒ .Ž,�.c3óŠ•K—‰jj� ‰jj–—Œ‰dD]}|–—Œy­wr0)rWr‘)ÚlinerPrQs €€r#rXz$mock_open.._iter_side_effect� sBøèø€Ø �?‰?× 'Ñ 'Ð 3ØØ—o‘o×2Ñ2Ò2ðà˜1”IˆDØ‹JñùsƒAAcóx•—‰jj�‰jjSt‰d«Sr0)rWr‘rï)rPrQs€€r#Ú_next_side_effectz$mock_open.._next_side_effectˆ s1ø€Ø �?‰?× 'Ñ 'Ð 3Ø—?‘?×/Ñ/Ð /Ü�F˜1‘I‹Ðr"rÚopen)rwrû)rûrÚcó •—t‰«‰d<‰jj‰dk(r‰«‰d<‰d‰j_tS)NrrÚ)rKrWr—r)rQrRrYrPrQrJs €€€€r#Ú reset_datazmock_open..reset_data¨ sHø€Ü˜yÓ)ˆˆq‰ Ø �?‰?× &Ñ &¨&°©)Ò 3á-Ó/ˆF�1‰IØ*0°©)ˆF�O‰OÔ '܈r")rKÚ file_specÚ_iorfrir Ú TextIOWrapperÚunionrHÚ open_specr^rr:r‘ÚwriterTrWrNr—r¹rð) r=rJÚ _read_datarRrUr]rbr`rXrYrPrQs ` @@@@r#rrc sWü€ô˜IÓ&€Jؘ$Ð €Fõ4õ /õ 6õ õô ÐÛÜœœS ×!2Ñ!2Ó3Ó4×:Ñ:¼3¼sÀ3Ç;Á;Ó?OÓ;PÓQÓRˆ ôÐÛÜœœS §¡›]Ó+Ó,ˆ Ø €|ܘf¬9Ô5ˆä œIÔ &€FØ$*€F×ÑÔ!à $€F‡L�LÔØ#€F‡K�KÔØ#'€F‡O�OÔ Ø$(€F×ÑÔ!à/€F‡K�KÔÙ%Ó'€Fˆ1�IØ"(¨¡)€F‡O�OÔØ#9€F×ÑÔ Ø"3€F‡O�OÔØ"3€F‡O�OÔ÷ð"€DÔØ€DÔØ €Kr"có$—eZdZdZd„Zdd„Zd„Zy)raW 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 ó—tdi|¤ŽS)Nr!)r)rPrRs r#r'zPropertyMock._get_child_mock¾ s€ÜÑ"˜6Ñ"Ð"r"Ncó—|«Sr5r!)rPr.Úobj_types r#r~zPropertyMock.__get__Á s €Ù‹vˆ r"có—||«yr5r!)rPr.rIs r#rzPropertyMock.__set__à s €Ù ˆS� r"r5)rrrr r'r~rr!r"r#rrµ s„ñò#óór"rcó—d|_t|«D]d} t||«}t |t «sŒ!t |j j|«t«rŒK|j|usŒZt|«Œfy#t$rYŒswxYw)a˜Disable 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) rr r*rEr(r r˜rlr9rÉr)r=rœrãs r#rrÇ s�€ð€DÔÜ�D– ˆð ܘ˜dÓ#ˆAô˜!œ_Ô-Ø Ü �a×&Ñ&×*Ñ*¨4Ó0´*Ô =Ø Ø × Ñ  Ò %Ü ��Gñøôò Ù ð ús— A;Á; BÂBcó—eZdZdZd„Zd„Zy)r¾z8 Wraps an iterator in an asynchronous iterator. cóz—||_tt¬«}tj|_||j d<y)Nrër1)Úiteratorr rr+ÚCO_ITERABLE_COROUTINErñrk)rPrprös r#rAz_AsyncIterator.__init__ã s/€Ø ˆŒ Ü#¬XÔ6ˆ Ü$×:Ñ:ˆ ÔØ$-ˆ� ‰ �jÒ!r"cƒó^K— t|j«S#t$rYt‚wxYw­wr5)rïrprørùr¸s r#r�z_AsyncIterator.__anext__é s1èø€ð ܘŸ ™ Ó&Ð &øÜò Ø Ü Ð ð üs‚-„˜-™ *¢-©*ª-N)rrrr rAr�r!r"r#r¾r¾ß s„ñò.ó !r"r¾rÎ)NFNNN)FFNN)Nr)ˆÚ__all__r¥rrGr+rãr2ÚbuiltinsrHrÚtypesrrrÚ unittest.utilrÚ functoolsrrÚ threadingrr£rr rVr(r rÜrør/r3r'r:r?rKr[rVrdrhrnrzrtr«r±rgr³r¾rrÚMISSINGr{ÚDELETEDr:rÔr×rfr�rérëròr Ú frozensetÚ removeprefixrWrÃr3rÉrrörørJrOrSrrVrnrvrYÚmultipleÚstopallrÚ magic_methodsÚnumericsr\rFÚinplaceÚrightÚ _non_defaultsrvrÍrÇÚ_sync_async_magicsÚ _async_magicsrÈrUrurÂr®rÁr±r¶r»r¿rÃrÇrÉr rØrrÏrFrArìrírGr÷r r rr~rgr¢rr r;r9r7r­r>rarerKrrrr¾)rwrŽs00r#Úr†sðð €ó&ÛÛ ÛÛ Û ÛÛÝ'ß2Ñ2Ý#ß$ÝôC�yôCñ" (œmÓ H™m�d°4·?±?À3Õ3GŠT˜mÑ H€ à € ð€ ò@òò2ò òò óF #ò òò&ò óò6."òb>ò6)ô )�fô )ô �ô ñ ‹;€à × Ñ €Ø × Ñ €Ø × Ñ €ò€ò ô&*�ô*ò(ô6�ôô  ˆ6ô ôX <�dôX <ñxá�OÔ$óá$ˆØ ‡��yÔ!ð ×Ñ�iÕ Ø$ñóÐô �4ô ò ôg!�Dôg!ôV8ˆ=˜/ô8òzôY/ˆVôY/òz <ð '¨Tؘt¨dØðð&+ôð:?CØ04ó.ðd $¨uØ °4ðOàCHôOôdV/�&ôV/òrò𠀄 Ø €„ Ø €„Ø€„ Ø€Ôð  ðð"Kð ð �(‰(Ñ7 h§n¡nÔ&6Ó7Ó 7€Ø �‰Ñ5 H§N¡NÔ$4Ó5Ó5€ò € òð‡H�Hˆm˜X w°Ð 6Ó7×=Ñ=Ô?ó á?ð!€HˆvÓØ?ñ €ò @Ðà!�]ÐØ$Ð'9Ñ9€ à˜]Ñ*ÐØ Ñ.€ òÐñ3Ù0Ù6Ù^ñ ÐðØØØØØØØØØØØØñ€ò"òòòðØØØ ñ Ðò1ô$;�ô;ô>  ˜: ô  ô �jô ôG� ˜DôGôB"�ô"ð$Ø!�×!Ñ!¡'¨(×*;Ñ*;¸TÓ"BÓC€IÙ�h“-€Kô E+�TôE+ôP(� °ô(ôV ˆ6ô ñ ƒf€ò$ô$v)ˆEôv)ñr �uÔ€ðCGØðSØ*/ôSòlô8 �ô ñ ˆÓáˆ�‰Óð € ð € Ø € ò&óOôd�4ôò$÷0!ò!ùòe] IùòP ùòl øðdòØ‚Iðús*ÁN;Á3N;Ä0)OÉ& OË:+O Ï OÏO