Files
cms-website/.deps_siteforge_v812/click/__pycache__/testing.cpython-312.pyc
T

211 lines
24 KiB
Plaintext
Raw Normal View History

Ë
îÅÙjš?ãó—ddlZddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddl m Z ddl m
Z
ddl mZddl mZddl mZej"rdd lmZGd
„d «Zej*d ej,ed
ej.dfd„«ZGd„dej2«Zdej,ej6eeej<ej>fded
ej@fd„Z!Gd„d«Z"Gd„d«Z#y)éN)Ú
TracebackTypeé)Ú_compat)Ú
formatting)Útermui)Úutils)Ú_find_binary_reader)Ú BaseCommandcó
—eZdZdejdejddfd„Zdedejfd„Zde de fd „Z
dd
e de fd „Z dd
e de fd „Z
dd
e de fd
„Zdeje fd„Zdej"e fd„Zdefd„Zy)Ú EchoingStdinÚinputÚoutputÚreturnNcó.—||_||_d|_y)NF)Ú_inputÚ_outputÚ_paused)Úselfr
rs úQC:\Users\30997\AppData\Local\Temp\pip-target-6g32zz5s\lib\python\click/testing.pyÚ__init__zEchoingStdin.__init__s€ØˆŒ ؈Œ ؈� óÚxcó.—t|j|«S©N)Úgetattrr©rrs rÚ __getattr__zEchoingStdin.__getattr__s€Ü�t—{‘{ AÓ&Ð&rÚrvcóT—|js|jj|«|Sr)rrÚwrite)rrs rÚ_echozEchoingStdin._echos €Ø�|Š|Ø �L‰L× Ñ ˜rÔ "àˆ rÚncóV—|j|jj|««Sr)r!rÚread©rr"s rr$zEchoingStdin.read$s €Ø�z‰z˜$Ÿ+™+×*Ñ*¨1Ó-Ó.Ð.rcóV—|j|jj|««Sr)r!rÚread1r%s rr'zEchoingStdin.read1's €Ø�z‰z˜$Ÿ+™+×+Ñ+¨AÓ.Ó/Ð/rcóV—|j|jj|««Sr)r!rÚreadliner%s rr)zEchoingStdin.readline*s €Ø�z‰z˜$Ÿ+™+×.Ñ.¨qÓ1Ó2Ð2rcóz—|jj«D�cgc]}|j|«‘Œc}Scc}wr)rÚ readlinesr!rs rr+zEchoingStdin.readlines-s1€Ø'+§{¡{×'<Ñ'<Ô'>Ó?Ñ'> !�—
‘
˜1•
Ð'>Ñ?Ð?ùÒ?s�8có@‡—tˆfd„‰jD««S)Nc3ó@•K—|]}‰j|«–—Œy­wr)r!)Ú.0rrs €rÚ <genexpr>z(EchoingStdin.__iter__.<locals>.<genexpr>1søèø€Ð7©; a�D—J‘J˜q—M©;ùsƒ)Úiterr©rs`rÚ__iter__zEchoingStdin.__iter__0sø€ÜÓ7¨4¯;ª;Ó7Ó7Ð7rcó,—t|j«Sr)Úreprrr1s rÚ__repr__zEchoingStdin.__repr__3s€Ü�D—K‘KÓ Ð r)éÿÿÿÿ)Ú__name__Ú
__module__Ú __qualname__ÚtÚBinaryIOrÚstrÚAnyrÚbytesr!Úintr$r'r)ÚListr+ÚIteratorr2r5©rrr r s¾„ð˜aŸj™jð°!·*±*ðÀóð
'˜Sð' Q§U¡Uó'ð˜ð %óñ /�cð/ 5ó/ñ0�sð0 Eó0ñ3˜#ð3 uó3ð@˜1Ÿ6™6 %™=ó@ð8˜!Ÿ*™* UÑ+ó8ð!˜#ô!rr Ústreamrc#ó>K—|€d–—yd|_d–—d|_y­w)NTF)r)rCs rÚ _pause_echorE7sèø€à
€~Ü
àˆŒÛ
؈�ùs‚c
󈇗eZdZdejdededej ddf
ˆfd„ Zedefd„«Z edefd „«Z
ˆxZ S)
Ú_NamedTextIOWrapperÚbufferÚnameÚmodeÚkwargsrNc óB•—t‰|�|fi|¤Ž||_||_yr)ÚsuperrÚ_nameÚ_mode)rrHrIrJrKÚ __class__s €rrz_NamedTextIOWrapper.__init__Bs%ø€ô ‰Ñ˜Ñ* 6Ò*؈Œ
؈�
rcó—|jSr)rNr1s rrIz_NamedTextIOWrapper.nameIó €à�z‰zÐrcó—|jSr)rOr1s rrJz_NamedTextIOWrapper.modeMrRr) r7r8r9r:r;r<r=rÚpropertyrIrJÚ
__classcell__)rPs@rrGrGAsnø„ðØ—j‘jðØ(+ðØ36ðØBCÇ%Á%ðà
õðð�còóððð�còóôrrGr
Úcharsetcó*—t|d«rMttjtjtj
|««}|�|St
d«‚|€d}n!t|t«r|j|«}tj|«S)Nr$z.Could not find binary reader for input stream.r) Úhasattrr r:ÚcastÚIOr=Ú TypeErrorÚ
isinstancer<ÚencodeÚioÚBytesIO)r
rVrs rÚmake_input_streamr`Rsv€ôˆu�fÔÜ
¤§¡¬¯©¬Q¯U©U© °UÓ!;Ó
<ˆà
ˆ>؈IäÐHÓIÐIà €}Ø‰Ü �Eœ3Ô Ø— ‘ ˜WÓ%ˆä
�:‰:�eÓ Ðrcó"—eZdZdZ ddddedej edejded ej e d
ej ejeje e e ffd „Z
ed efd
„«Zed efd„«Zed efd„«Zd efd„Zy)ÚResultz3Holds the captured result of an invoked CLI script.NÚrunnerÚ CliRunnerÚ stdout_bytesÚ stderr_bytesÚ return_valueÚ exit_codeÚ exceptionÚexc_infocóf—||_||_||_||_||_||_||_yr©rcrerfrgrhrirj)rrcrerfrgrhrirjs rrzResult.__init__is:€ðˆŒ à(ˆÔà(ˆÔð)ˆÔà"ˆŒà"ˆŒà ˆ�
rrcó—|jS)z(The (standard) output as unicode string.)Ústdoutr1s rrz
Result.output†s€ð�{‰{Ðrcó‚—|jj|jjd«j dd«S)z&The standard output as unicode string.Úreplaceú
Ú
)reÚdecodercrVrpr1s rrnz
Result.stdout‹s9€ð× Ñ ×'Ñ'¨¯ © ×(;Ñ(;¸YÓG×OÑOØ �Dó
ð
rcó°—|j€ td«‚|jj|jjd«j dd«S)z%The standard error as unicode string.zstderr not separately capturedrprqrr)rfÚ
ValueErrorrsrcrVrpr1s rÚstderrz
Result.stderr’sQ€ð × Ñ Ð $ÜÐ=Ó>Ð >Ø× Ñ ×'Ñ'¨¯ © ×(;Ñ(;¸YÓG×OÑOØ �Dó
ð
rcó€—|jrt|j«nd}dt|«j›d|›d�S)NÚokayÚ<Ú Ú>)rir4Útyper7)rÚexc_strs rr5zResult.__repr__›s8€Ø*.¯.ª.”$�t—~‘~Ô&¸fˆØ”4˜“:×&Ñ&Ð' q¨¨ °Ð3Ð3rr)r7r8r9Ú__doc__r>r:ÚOptionalr=r?Ú
BaseExceptionÚTupleÚTyperrrTr<rrnrvr5rBrrrbrbfsë„Ù=ð
ñ!àð!ðð!ð—j‘j Ñ'ð !ð
—e‘eð !ð ð
!ð—:‘:˜mÑ,ð!ð—*‘*Ø
�G‰G�A—F‘F˜=Ñ)¨=¸-ÐGÑ Hñ
ó!ð:ð˜òóððð
˜ò
óð
ð ð
˜ò
óð
ð4˜#ô4rrbcó€—eZdZdZ ddedej ejeej efdededdf
d„Z d d
defd „Z
dd ej ejeej efdejeej effd
„Z e j ddej ejeeej ej"fdej ejeej efdedej$ej&ej*ej ej*ffd„«Z dd d
dej ejeej.efdej ejeeej ej"fdej ejeej efdededej"defd„Ze j ddej ejedfdej$efd„«Zy)rdaøThe CLI runner provides functionality to invoke a Click command line
script for unittesting purposes in a isolated environment. This only
works in single-threaded systems without any concurrency as it changes the
global interpreter state.
:param charset: the character set for the input and output data.
:param env: a dictionary with environment variables for overriding.
:param echo_stdin: if this is set to `True`, then reading from stdin writes
to stdout. This is useful for showing examples in
some circumstances. Note that regular prompts
will automatically echo the input.
:param mix_stderr: if this is set to `False`, then stdout and stderr are
preserved as independent streams. This is useful for
Unix-philosophy apps that have predictable stdout and
noisy stderr, such that each may be measured
independently
NrVÚenvÚ
echo_stdinÚ
mix_stderrrcóD—||_|xsi|_||_||_yr)rVr„r…r†)rrVr„r…r†s rrzCliRunner.__init__³s$€ðˆŒ Ø47²I¸2ˆŒØ$ˆŒØ$ˆ�rÚclir
có"—|jxsdS)zžGiven a command object it will return the default program name
for it. The default is the `name` attribute or ``"root"`` if not
set.
Úroot)rI)rrˆs rÚget_default_prog_namezCliRunner.get_default_prog_name¿s€ð
�x‰xÒ!˜6Ð!rÚ overridescóV—t|j«}|r|j|«|S)z8Returns the environment overrides for invoking a script.)Údictr„Úupdate)rrŒrs rÚmake_envzCliRunner.make_envÆs%€ô�$—(‘(‹^ˆÙ Ø �I‰I�iÔ Øˆ rr
Úcolorc#ó” ‡‡K—t||j«}d}tj}tj}tj
}t j} dt _|j|«}tj«}
|jr0tjtjt||
««x}}t!||jdd¬«xt_Š|jrd‰_t!|
|jdd¬«t_d} |j$rtjt_n7tj«} t!| |jd dd
¬ «t_t'|«dd tj(t*d
t*fˆfd„
«} t'|«dd tj(t*d
t*fˆfd„
«}
t'|«dt,d
t*fd„«}|Š ddtj(tj.tj0dtj(t,d
t,fˆfd„
}t2j4}t2j6}t2j8}t:j<}t>j<}| t2_|
t2_|t2_|t:_|t>_i} |jA«D]O\}}tBjDjG|«||<|€ tBjD|=Œ=|tBjD|<ŒQ|
| f–—|jA«D]-\}}|€ tBjD|=Œ|tBjD|<Œ/|t_|t_|t_|t2_|t2_|t2_|t:_|t>_| t _y#tH$rY�ŒwxYw#tH$rYŒ¯wxYw#|jA«D]<\}}|€" tBjD|=Œ#tH$rYŒ&wxYw|tBjD|<Œ>|t_|t_|t_|t2_|t2_|t2_|t:_|t>_| t _wxYw­w)anA context manager that sets up the isolation for invoking of a
command line tool. This sets up stdin with the given input data
and `os.environ` with the overrides from the given dictionary.
This also rebinds some internals in Click to be mocked (like the
prompt functionality).
This is automatically done in the :meth:`invoke` method.
:param input: the input stream to put into sys.stdin.
:param env: the environment overrides as dictionary.
:param color: whether the output should contain color codes. The
application can still override this explicitly.
.. versionchanged:: 8.0
``stderr`` is opened with ``errors="backslashreplace"``
instead of the default ``"strict"``.
.. versionchanged:: 4.0
Added the ``color`` parameter.
NéPz<stdin>Úr)ÚencodingrIrJrz<stdout>Úwz<stderr>Úbackslashreplace)r•rIrJÚerrorsÚpromptrcó •—tjj|xsd«‰j«j d«}tjj|›d�«tjj «|S)NÚrqrr)Úsysrnr r)ÚrstripÚflush)r™ÚvalÚ
text_inputs €rÚ
visible_inputz*CliRunner.isolation.<locals>.visible_inputs_ø€ä �J‰J× Ñ ˜Vš\ rÔ *Ø×%Ñ%Ó'×.Ñ.¨vÓ6ˆCÜ �J‰J× Ñ  ˜u B˜ZÔ (Ü �J‰J× Ñ Ô ØˆJrcóÊ•—tjj|xsd›d�«tjj«‰j «j d«S)Nr›rrrq)rœrnr ržr)r�)r™r s €rÚ hidden_inputz)CliRunner.isolation.<locals>.hidden_inputsJø€ä �J‰J× Ñ  ¢ ¨"˜~¨RÐ0Ô 1Ü �J‰J× Ñ Ô Ø×&Ñ&Ó(×/Ñ/°Ó7Ð 7rÚechocó—tjjd«}|rtjj |«tjj «|S)Nr)rœÚstdinr$rnr rž)r¤Úchars rÚ_getcharz%CliRunner.isolation.<locals>._getchar$s>€ä—9‘9—>‘> !Ó$ˆDáÜ—
‘
× Ñ  Ô&ä �J‰J× Ñ Ô ØˆKrrCr‘có•—|€‰ S| SrrB)rCr‘Ú
default_colors €rÚshould_strip_ansiz.CliRunner.isolation.<locals>.should_strip_ansi0sø€ðˆ}Ø(Ð(Ð(Ø�9Ð rr)NN)%r`rVrœr¦rnrvrÚ FORCED_WIDTHr�r^r_r…r:rYr;r rGÚ _CHUNK_SIZEr†rErr<ÚboolrZr=rÚvisible_prompt_funcÚhidden_prompt_funcr¨rr«rÚitemsÚosÚenvironÚgetÚ Exception)rr
r„r‘Ú bytes_inputÚ
echo_inputÚ old_stdinÚ
old_stdoutÚ
old_stderrÚold_forced_widthÚ bytes_outputÚ bytes_errorr¡r£r¨r«Úold_visible_prompt_funcÚold_hidden_prompt_funcÚold__getchar_funcÚold_should_strip_ansiÚold__compat_should_strip_ansiÚold_envÚkeyÚvaluerªr s @@rÚ isolationzCliRunner.isolationÏsðùèø€ô6(¨¨t¯|©|Ó<ˆ ؈
ä—I‘Iˆ Ü—Z‘Zˆ
Ü—Z‘Zˆ
Ü%×2Ñ2ÐØ"$Œ
Ôà�m‰m˜CÓ ˆä—z‘z“|ˆ à �?Š?Ü'(§v¡vÜ—
‘
œL¨°lÓCó(ð
ˆK˜*ô"5Ø  $§,¡,°YÀSô"
ð
ŒŒ �Jð �?Š?ð&'ˆJÔ "ä(Ø  4§<¡<°jÀsô
ŒŒ
ðˆ Ø �?Š?ÜŸ™ŒC�JäŸ*™*›,ˆKÜ,ØØŸ™ØØØ)ô ŒCŒJô
�ZÓ ñ ¤!§*¡*¬S¡/ð ¼Sô ó
!ð ô
�ZÓ ñ 8¤§¡¬C¡ð 8¼Cô 8ó
!ð 8ô
�ZÓ ð œ4ð ¤Cò ó
!ð ðˆ
ðOSñ Ü—J‘JœqŸt™t¤A§E¡E™{Ñ+ð Ü;<¿:¹:ÄdÑ;Kð ä
õ ô#)×"<Ñ"<ÐÜ!'×!:Ñ!:ÐÜ"ŸO™OÐÜ %× 7Ñ 7ÐÜ(/×(AÑ(AÐ%Ø%2ŒÔ"Ø$0ŒÔ!Ø"ŒŒØ"3ŒÔØ$5ŒÔ!àˆð 7Ø!Ÿi™ižk‘
��UÜ!Ÿz™zŸ~™~¨cÓ2�˜‘ Ø�=ðÜŸJ™J s™Oð',”B—J‘J˜s’Oð*ð  Ð-Ò -à%Ÿm™mžo‘
��UØ�=ðÜŸJ™J s™Oð',”B—J‘J˜s’Oð.ð$ŒCŒJØ#ŒCŒJØ!ŒCŒIØ)@ŒFÔ &Ø(>ŒFÔ %Ø/ŒFŒOØ&;ŒEÔ #Ø(EŒGÔ %Ø&6ŒJÕ #øô-%òÚðûô%òÙðûð &Ÿm™mžo‘
��UØ�=ðÜŸJ™J s™OøÜ$òÙðúð',”B—J‘J˜s’Oð.ð$ŒCŒJØ#ŒCŒJØ!ŒCŒIØ)@ŒFÔ &Ø(>ŒFÔ %Ø/ŒFŒOØ&;ŒEÔ #Ø(EŒGÔ %Ø&6ŒJÕ #üsŒ„K!SË&:PÌ!O2Ì2PÍSÍ'PÍ8A:SÏ2 O?Ï;PÏ>O?Ï?PÐ PÐ SÐ
PÐSÐSÐ+P=Ð<SÐ= Q ÑSÑQ Ñ A<SÓSÚargsÚcatch_exceptionsÚextrac óì—d}|j|||¬«5} d}
d} d} t|t«rtj|«} |j d«}
|jd|xsd|
dœ|¤Ž}
tj&j-«| dj/«}|j0rd}n| dj/«} ddd«t3|
  |¬ «S#t $r|j|«}
YŒ¤wxYw#t$rÛ}tj«}tjtjtjt tj"f|j$«}|€d}|dk7r|} t|t «sItj&j)t|««tj&j)d«d}|} Yd}~�Œmd}~wt*$r&}|s‚|} d} tj«}Yd}~�Œšd}~wwxYw#tj&j-«| dj/«}|j0rd}w| dj/«}wxYw#1swY�Œ¨xYw)
aÚInvokes a command in an isolated environment. The arguments are
forwarded directly to the command line script, the `extra` keyword
arguments are passed to the :meth:`~clickpkg.Command.main` function of
the command.
This returns a :class:`Result` object.
:param cli: the command to invoke
:param args: the arguments to invoke. It may be given as an iterable
or a string. When given as string it will be interpreted
as a Unix shell command. More details at
:func:`shlex.split`.
:param input: the input data for `sys.stdin`.
:param env: the environment overrides.
:param catch_exceptions: Whether to catch any other exceptions than
``SystemExit``.
:param extra: the keyword arguments to pass to :meth:`main`.
:param color: whether the output should contain color codes. The
application can still override this explicitly.
.. versionchanged:: 8.0
The result object has the ``return_value`` attribute with
the value returned from the invoked command.
.. versionchanged:: 4.0
Added the ``color`` parameter.
.. versionchanged:: 3.0
Added the ``catch_exceptions`` parameter.
.. versionchanged:: 3.0
The result object has the ``exc_info`` attribute with the
traceback if available.
N)r
r„r‘rÚ prog_namerB)rÇrËrrrrl)rÆr\r<ÚshlexÚsplitÚpopÚKeyErrorr‹ÚmainÚ
SystemExitrœrjr:rYrÚUnionr?r=Úcodernr rµržÚgetvaluer†rb)rrˆrÇr
r„rÈr‘rÉrjÚ
outstreamsrgrirhrËÚeÚe_codernrvs rÚinvokezCliRunner.invokeas€ðXˆØ
�^‰^ %¨S¸ˆ^Ô