/opt/cloudlinux/venv/lib/python3.11/site-packages/testfixtures/__pycache__
NameSizeModeActions
comparison.cpython-311.pyc587880644editdlrm
compat.cpython-311.pyc5870644editdlrm
components.cpython-311.pyc27840644editdlrm
datetime.cpython-311.pyc339940644editdlrm
django.cpython-311.pyc40280644editdlrm
logcapture.cpython-311.pyc160040644editdlrm
mock.cpython-311.pyc19360644editdlrm
outputcapture.cpython-311.pyc76200644editdlrm
popen.cpython-311.pyc136650644editdlrm
replace.cpython-311.pyc168820644editdlrm
resolve.cpython-311.pyc35670644editdlrm
rmtree.cpython-311.pyc26910644editdlrm
shouldraise.cpython-311.pyc53570644editdlrm
shouldwarn.cpython-311.pyc44040644editdlrm
sybil.cpython-311.pyc43490644editdlrm
tempdirectory.cpython-311.pyc183370644editdlrm
twisted.cpython-311.pyc73700644editdlrm
utils.cpython-311.pyc52070644editdlrm
__init__.cpython-311.pyc24850644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/testfixtures/__pycache__/replace.cpython-311.pyc (16882B)
§ 0æL<.^Ù ãóì—ddlZddlmZddlmZddlmZmZddlm Z m Z ddl m Z ddl mZmZmZmZmZddlmZmZmZmZmZdd lmZmZddlZeeegefZd „Zed ¦«Z Gd „d ¦«Z! ddedede"dedededeegeffd„Z#ededefd„¦«Z$ed dededefd„¦«Z%ed dedede fd„¦«Z&Gd„de'¦«Z(dZ)ee)e!j*e!j#e#e(g¦«dS)!éN)Úcontextmanager)Úpartial)Ú get_referrersÚ get_referents)ÚsetitemÚgetitem)Ú ModuleType)ÚAnyÚTypeVarÚCallableÚDictÚTuple)ÚresolveÚ not_thereÚResolvedÚclassmethod_typeÚ class_type)ÚwrapÚextend_docstringcóD—t||¦«ot||¦« S©N)Ú isinstance)ÚxÚyÚ descriptors úf/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/testfixtures/replace.pyÚnot_same_descriptorrs$€Ý �a˜Ñ $Ô $Ð F­Z¸¸:Ñ-FÔ-FÐ)FÐFóÚRcóê—eZdZdZd„Zdefd„Z ddeded e d ed e d e d efd„Z ddeded e d ed e d e d dfd„Z d e ded dfd„Zd e de fd„Zddeded e d dfd„Zddededed dfd„Zdd„Zd„Zd„Zd„ZdS)ÚReplacerzž These are used to manage the mocking out of objects so that units of code can be tested without having to rely on their normal dependencies. có—i|_dSr)Ú originals©Úselfs rÚ__init__zReplacer.__init__ s €Ø:<ˆŒˆˆrÚresolvedcó0—|turk|jtur, t|j|j¦«n#t $rYnwxYw|jtur! |j|j=dS#t$rYdSwxYwdS| |j|j|¦«dSr) rÚsetterÚsetattrÚdelattrÚ containerÚnameÚAttributeErrorrÚKeyError)r%r'Úvalues rÚ_replacezReplacer._replace#sÉ€Ø •IÐ Ð ØŒ¥'Ð)Ð)ðݘHÔ.°´ Ñ>Ô>Ð>Ð>øÝ%ðððØ�DðøøøàŒ¥'Ð)Ð)ðØ Ô*¨8¬=Ð9Ð9Ð9øÝðððØ�D�Dðøøøð*Ð)ð �OŠO˜HÔ.°´ ¸uÑ EÔ EÐ EÐ EÐ Es!™4´ AÁAÁ A"Á" A0Á/A0TNÚtargetÚ replacementÚstrictr,Úaccessorr-ÚreturncóÀ—|€|�td¦«‚t|t¦«r"|�td¦«‚t||¦«}nüt}|€|}|pt |dd¦«}|€td¦«‚|€I t }|||¦«}nY#t$rYnMt$rt }|||t¦«}Yn)wxYw |||¦«}n#ttf$rYnwxYw|r4|tus+||us'|||¦«} || urt|›d|›d|›�¦«‚t||t urtnt||¦«}|j €td¦«‚|jtur|rtd |jz¦«‚|} t|jt$¦«r„|j|jjvr|jj|j|_t)|j|t*¦«rt+|¦«} n*t)|j|t,¦«rt-|¦«} | || ¦«t1|¦«} | |jvr ||f|j| <|S) úM Replace the specified target with the supplied replacement. Nz-accessor is not used unless name is specifiedz0name cannot be specified when target is a stringÚ__name__z2name must be specified when target is not a stringz resolved to z , expected z%target must contain at least one dot!zOriginal %r not found)Ú TypeErrorrÚstrrrÚgetattrrr/r.ÚAssertionErrorrrr*r)Ú ValueErrorÚfoundr-r,ÚtypeÚ__dict__rÚ classmethodÚ staticmethodr1Úidr#) r%r2r3r4r,r5r-r'r?ÚexpectedÚreplacement_to_useÚkeys rÚ__call__zReplacer.__call__2s߀ð ˆ<˜HÐ0ÝÐKÑLÔLÐ Lå �f�cÑ "Ô "ð& ØÐÝÐ RÑSÔSÐSݘv yÑ1Ô1ˆHˆHåˆEØÐ Ø"� àÐ<�7 6¨:°tÑ<Ô<ˆD؈|ÝÐ TÑUÔUÐUàÐ#ðEÝ#*˜Ø ( ¨°DÑ 9Ô 9˜˜øÝ#ðððؘÝ$ðEðEðEÝ#*˜Ø ( ¨°D½)Ñ DÔ D˜˜˜ðEøøøðØ ( ¨°DÑ 9Ô 9˜˜øÝ$¥nÐ5ðððØ˜ðøøøðð ]˜u­ Ð1Ð1°V¸yÐ5HÐ5HØ#˜8 I¨tÑ4Ô4�Ø Ð)Ð)Ý(¨DÐ)[Ð)[ÀÐ)[Ð)[ÐSYÐ)[Ð)[Ñ\Ô\Ð\娨#¥wÐ.Ð.•�µGØØñ ôˆHð Œ?Ð "ÝÐDÑEÔEÐ EØ Œ>�YÐ &Ð &¨6Ð &Ý Ð!8¸8¼=Ñ!HÑIÔIÐ Ià(Ðå �hÔ(­$Ñ /Ô /ð ?ðŒ} Ô 2Ô ;Ð;Ð;Ø!)Ô!3Ô!<¸X¼]Ô!K�”å" 8¤>°;Å ÑLÔLð ?Ý%0°Ñ%=Ô%=Ð"Ð"å$ X¤^°[Å,ÑOÔOð ?Ý%1°+Ñ%>Ô%>Ð"à � Š �hÐ 2Ñ3Ô3Ð3Ý�‰jŒjˆØ �d”nÐ $Ð $Ø"(¨(Ð"2ˆDŒN˜3Ñ ØÐs*Á=B CÂ"CÃCà CÃC'Ã&C'có&—|||||||¦«dS)r8N©©r%r2r3r4r,r5r-s rÚreplacezReplacer.replace{s$€ð ˆˆV�[ &¨)°X¸tÑDÔDÐDÐDÐDrc ó~—|tj|td|turtnt |¦«¬¦«dS)a This method provides a convenient way of ensuring an environment variable in :any:`os.environ` is set to a particular value. If you wish to ensure that an environment variable is *not* present, then use :any:`not_there` as the ``replacement``. F)r-r5r4r3N)ÚosÚenvironrrr;)r%r-r3s rÚ in_environzReplacer.in_environ‚sP€ð ˆ�RŒZ˜d­W¸UØ&1µYÐ&>Ð&>�˜ÅCÈ ÑDTÔDTð Vñ Vô Vð Vð Vð VrÚbreak_on_staticcó"—t|¦«D]~}|rt|t¦«rd|fcSt|t¦«rJd|vrF| |¦«|ur/t|¦«D]}t|t ¦«r|dfccSŒ ŒdS)NrA)NN)rrrCÚdictÚgetr@)r%Ú attributer-rQÚreferrerr,s rÚ_find_containerzReplacer._find_container�s¿€Ý% iÑ0Ô0ð 3ð 3ˆHØð 3¥:¨h½ Ñ#EÔ#Eð 3ؘX�~Ð%Ð%Ð%ݘH¥dÑ+Ô+ð 3° ¸hÐ0FÐ0FØ—<’< Ñ%Ô%¨Ð2Ð2Ý%2°8Ñ%<Ô%<ð3ð3˜ Ý% iµÑ6Ô6ð3Ø#,¨d ?Ð2Ð2Ð2Ð2Ð2ð3øàˆzrrUcó°—t|¦«std¦«‚|pt|dd¦«}d}t|t¦«r*t |¦«D]}t|t ¦«r|}Œn8| ||d¬¦«\}}|�| ||d¬¦«\}}|€td|›d|›�¦«‚|||t|¬ ¦«dS) au This method provides a convenient way to replace methods, static methods and class methods on their classes. If the attribute being replaced has a ``__name__`` that differs from the attribute name on the class, such as that returned by poorly implemented decorators, then ``name`` must be used to provide the correct name. zattribute must be callabler9NT)rQFzcould not find container of z using name ©r-r5r3) Úcallabler:r<rrrrrWr.)r%rUr3r-r,ÚreferredÚ staticmethod_Ú_s rÚon_classzReplacer.on_class˜s€õ˜ Ñ"Ô"ð :ÝÐ8Ñ9Ô9Ð 9ØÐ;•w˜y¨*°dÑ;Ô;ˆØˆ Ý �iÕ!1Ñ 2Ô 2ð `Ý)¨)Ñ4Ô4ð )ð )�ݘh­ Ñ3Ô3ð)Ø (�Iøð )ð(,×';Ò';¸IÀtÐ]aÐ';Ñ'bÔ'bÑ $ˆI�}ØÐ(Ø#×3Ò3°MÀ4ÐY^Ð3Ñ_Ô_‘ � ˜1à Ð Ý Ð!aÀ Ð!aÐ!aÐY]Ð!aÐ!aÑbÔbÐ bà ˆˆY˜T­GÀÐMÑMÔMÐMÐMÐMrÚmodulecór—|pt|j¦«j}|j}|||t|¬¦«dS)aŠ This method provides a convenient way to replace targets that are module globals, particularly functions or other objects with a ``__name__`` attribute. If an object has been imported into a module other than the one where it has been defined, then ``module`` should be used to specify the module where you would like the replacement to occur. rYN)rÚ __module__r?r9r<)r%r2r3r_r,r-s rÚ in_modulezReplacer.in_module³sB€ðÐ>�g fÔ&7Ñ8Ô8Ô>ˆ ØŒˆØ ˆˆY˜T­GÀÐMÑMÔMÐMÐMÐMrcóª—t|j ¦«¦«D]+\}\}}| ||j¦«|j|=Œ,dS)z” Restore all the original objects that have been replaced by calls to the :meth:`replace` method of this :class:`Replacer`. N)Útupler#Úitemsr1r?)r%Úid_r2Úoriginals rÚrestorezReplacer.restoreÀs`€õ (-¨T¬^×-AÒ-AÑ-CÔ-CÑ'DÔ'Dð $ð $Ñ #ˆCÑ#�&˜(Ø �MŠM˜( H¤NÑ 3Ô 3Ð 3Ø”˜sÐ#Ð#ð $ð $rcó—|SrrJr$s rÚ __enter__zReplacer.__enter__És€Øˆ rcó.—| ¦«dSr)rh)r%r@r0Ú tracebacks rÚ__exit__zReplacer.__exit__Ìs€Ø � Š ‰Œˆˆˆrcóˆ—|jr:tjdd„|j ¦«D¦«z¦«dSdS)Nz;Replacer deleted without being restored, originals left: %rcó—i|]\}}||“Œ SrJrJ)Ú.0ÚkÚvs rú z$Replacer.__del__..Õs€Ð'RÐ'RÐ'R±°°A¨¨!Ð'RÐ'RÐ'Rr)r#ÚwarningsÚwarnÚvaluesr$s rÚ__del__zReplacer.__del__Ïs`€Ø Œ>ð õ ŒMð%Ø'RÐ'R¸$¼.×:OÒ:OÑ:QÔ:QÐ'RÑ'RÔ'RñSñ ô ð ð ð ð ð r©TNNNr)r6N)r9raÚ __qualname__Ú__doc__r&rr1r rÚboolÚAccessorr;rHrLrPrWr r^r rbrhrjrmrwrJrrr!r!s'€€€€€ððð =ð=ð=ð F ð Fð Fð Fð FðDHØOSðGðG˜sðG°ðG¸DðGØðGØ2:ðGØILðGØXYðGðGðGðGðREIØNRðEðE˜cðE°ðE¸TðEØðEØ19ðEØHKðEØW[ðEðEðEðEð V˜sð V°ð V¸ð Vð Vð Vð Vð ¨sð ÀTð ð ð ð ðNðN (ðN¸ðNÀCðNÐSWðNðNðNðNð6 Nð N ð N°#ð N¸zð NÐUYð Nð Nð Nð Nð$ð$ð$ð$ðððððððððððrr!Tr2r3r4r,r5r-r6c óx—t¦«}tt|j||||||¦«|j¦«S)zY A decorator to replace a target object for the duration of a test function. )r!rrrHrh)r2r3r4r,r5r-Úrs rrLrLÙs=€õ ‰ Œ €AÝ Ý�” ˜F K°¸ÀHÈdÑSÔSØ Œ ñ ô ðrc#óŒK—t¦«5}| ||¦«dV—ddd¦«dS#1swxYwYdS)zW This context manager provides a quick way to use :meth:`Replacer.in_environ`. N)r!rP)r-r3r~s rÚreplace_in_environr€ès�èè€õ ‰Œð�qØ � Š �T˜;Ñ'Ô'Ð'Ø ˆˆˆðððñôðððððððøøøððððððs ‘9¹=Á=rUc#óŽK—t¦«5}| |||¦«dV—ddd¦«dS#1swxYwYdS)zU This context manager provides a quick way to use :meth:`Replacer.on_class`. N)r!r^)rUr3r-r~s rÚreplace_on_classr‚òs’èè€õ ‰Œð�qØ � Š �9˜k¨4Ñ0Ô0Ð0Ø ˆˆˆðððñôðððððððøøøððððððó ‘:º>Á>r_c#óŽK—t¦«5}| |||¦«dV—ddd¦«dS#1swxYwYdS)zV This context manager provides a quick way to use :meth:`Replacer.in_module`. N)r!rb)r2r3r_r~s rÚreplace_in_moduler…üs’èè€õ ‰Œð�qØ � Š �F˜K¨Ñ0Ô0Ð0Ø ˆˆˆðððñôðððððððøøøððððððrƒc óJ—eZdZdZ ddededededed ef d „Z d efd „Z d „Z dS)ÚReplacezU A context manager that uses a :class:`Replacer` to replace a single target. TNr2r3r4r,r5r-có€—||_||_||_||_||_||_t ¦«|_dSr)r2r3r4r,r5r-r!Ú _replacerrKs rr&zReplace.__init__ s>€ðˆŒ Ø&ˆÔ؈Œ Ø'ˆŒØ"*ˆŒ ؈Œ Ý!™œˆŒˆˆrr6cór—| |j|j|j|j|j|j¦«Sr)r‰r2r3r4r,r5r-r$s rrjzReplace.__enter__s4€Ø�~Š~Ø ŒK˜Ô)¨4¬;¸¼ÈÌ ÐW[ÔW`ñ ô ð rcó8—|j ¦«dSr)r‰rh)r%Úexc_typeÚexc_valÚexc_tbs rrmzReplace.__exit__s€Ø Œ×ÒÑ Ô Ð Ð Ð rrx) r9raryrzr rr{r|r;r&rjrmrJrrr‡r‡sš€€€€€ððð ?CØJNð $ð $Øð $Ø,-ð $Ø7;ð $àð $à-5ð $àDGð $ð $ð $ð $ð ˜1ð ð ð ð ð !ð!ð!ð!ð!rr‡a :param target: This must be one of the following: - A string containing the dotted-path to the object to be replaced, in which case it will be resolved the the object to be replaced. This path may specify a module in a package, an attribute of a module, or any attribute of something contained within a module. - The container of the object to be replaced, in which case ``name`` must be specified. - The object to be replaced, in which case ``container`` must be specified. ``name`` must also be specified if it cannot be obtained from the ``__name__`` attribute of the object to be replaced. :param replacement: The object to use as a replacement. :param strict: When `True`, an exception will be raised if an attempt is made to replace an object that does not exist or if the object that is obtained using the ``accessor`` to access the ``name`` from the ``container`` is not identical to the ``target``. :param container: The container of the object from which ``target`` can be accessed using either :func:`getattr` or :func:`~operator.getitem`. :param accessor: Either :func:`getattr` or :func:`~operator.getitem`. If not supplied, this will be inferred preferring :func:`~operator.getitem` over :func:`getattr`. :param name: The name used to access the ``target`` from the ``container`` using the ``accessor``. If required but not specified, the ``__name__`` attribute of the ``target`` will be used. rxr)+rNÚ contextlibrÚ functoolsrÚgcrrÚoperatorrrÚtypesr Útypingr r r r rÚtestfixtures.resolverrrrrÚtestfixtures.utilsrrrtr;r|rrr!r{rLr€r‚r…Úobjectr‡Úreplace_params_docrHrJrrúr™sÆðØ € € € Ø%Ð%Ð%Ð%Ð%Ð%ØÐÐÐÐÐØ+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ø%Ð%Ð%Ð%Ð%Ð%Ð%Ð%ØÐÐÐÐÐØ6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6à[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ð[Ø5Ð5Ð5Ð5Ð5Ð5Ð5Ð5à€€€ð �S˜#�J �OÔ $€ðGðGðGð €GˆC�L„L€ð}ð}ð}ð}ð}ñ}ô}ð}ðB7;ØFJð ð Øð Ø"%ð Ø/3ð àð à)1ð à@Cð ðˆxˆj˜(Ð"Ô#ð ð ð ð ðð˜Sð¨sðððñ„ðððð ð°sðÀ#ðððñ„ðððð˜cð°ð¸Zðððñ„ðð!ð!ð!ð!ð!ˆfñ!ô!ð!ð4#ÐðLÐÐ#ØÔ# XÔ%5°wÀÐHñJôJðJðJðJr