+
    üÐj[  ã                   ó  € R t ^ RIHt ^ RIHt  ! R R]P
                  4      t ! R R]P                  4      t ! R R]P
                  4      t	 ! R	 R
]P                  4      t
 ! R R]P
                  4      t ! R R]P
                  4      t ! R R]P                  4      t ! R R]P                  4      t ! R R]P
                  4      t ! R R]P
                  4      t ! R R]P
                  4      t ! R R]P                  4      t ! R R]P                  4      t ! R R]P                  4      t ! R R ]P                  4      t ! R! R"]P                  4      t ! R# R$]P                  4      t ! R% R&]P                  4      tR'# )(zK
Tests for L{twisted.python.usage}, a command line option parsing library.
©Úusage)Úunittestc                   óX   a € ] tR t^t o . RO. RO. R	O. R
O.t. RORR..tR tR tRtV t	R# )ÚWellBehavedNÚfloutÚoc                ó$   € R V P                   R&   R# )úPONY!ÚmyflagN©Úopts©Úselfs   &Ú9/usr/lib/python3/dist-packages/twisted/test/test_usage.pyÚ
opt_myflagÚWellBehaved.opt_myflag!   s   € Ø%ˆ�	‰	�(Óó    c                ó*   € V R 2V P                   R&   R# )z WITH A PONY!ÚmyparamNr   ©r   Úvalues   &&r   Úopt_myparamÚWellBehaved.opt_myparam$   s   € Ø"' ¨Ð6ˆ�	‰	�)Ór   © )ÚlongÚwÚdefaultzand a docstring)ÚanotherÚnzno docstring)ÚlongonlyNÚnoshort)Ú	shortlessNÚexceptzthis one got docstring)ÚaflagÚfzO

                 flagallicious docstringness for this here

                 )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚoptParametersÚoptFlagsr   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s<   ø‡ € â3Ú(Ú%Ú?ð	€Mò	
ð 
�#ˆð€Hò&÷7ð 7r   r   c                   ó<   a € ] tR t^(t o RtR tR tR tR tRt	V t
R# )ÚParseCorrectnessTestszN
Test L{usage.Options.parseOptions} for correct values under
good conditions.
c                ó˜   € RP                  4       V n        \        4       V n        V P                  P	                  V P                  4       R# )z<
Instantiate and parseOptions a well-behaved Options class.
úA--long Alpha -n Beta --shortless Gamma -f --myflag --myparam TofuN)ÚsplitÚniceArgVr   ÚniceÚparseOptionsr   s   &r   ÚsetUpÚParseCorrectnessTests.setUp.   s7   € ð Vß
‰%‹'ð 	Œô  “MˆŒ	à�	‰	×Ñ˜tŸ}™}Ö-r   c                ón  € V P                  V P                  P                  R,          R4       V P                  V P                  P                  R,          R4       V P                  V P                  P                  R,          R4       V P                  V P                  P                  R,          R4       R	# )
z!
Parameters have correct values.
r   ÚAlphar   ÚBetar    r!   r"   ÚGammaN©ÚassertEqualr6   r   r   s   &r   Útest_checkParametersÚ*ParseCorrectnessTests.test_checkParameters;   sx   € ð 	×Ñ˜Ÿ™Ÿ™¨Õ/°Ô9Ø×Ñ˜Ÿ™Ÿ™¨	Õ2°FÔ;Ø×Ñ˜Ÿ™Ÿ™¨
Õ3°YÔ?Ø×Ñ˜Ÿ™Ÿ™¨Õ4°gÖ>r   c                óº   € V P                  V P                  P                  R,          ^4       V P                  V P                  P                  R,          ^ 4       R# )z
Flags have correct values.
r$   r   Nr>   r   s   &r   Útest_checkFlagsÚ%ParseCorrectnessTests.test_checkFlagsD   s>   € ð 	×Ñ˜Ÿ™Ÿ™¨Õ0°!Ô4Ø×Ñ˜Ÿ™Ÿ™¨Õ0°!Ö4r   c                óº   € V P                  V P                  P                  R,          R4       V P                  V P                  P                  R,          R4       R# )z2
Custom flags and parameters have correct values.
r   r
   r   zTofu WITH A PONY!Nr>   r   s   &r   Útest_checkCustomsÚ'ParseCorrectnessTests.test_checkCustomsK   s?   € ð 	×Ñ˜Ÿ™Ÿ™¨Õ1°7Ô;Ø×Ñ˜Ÿ™Ÿ™¨	Õ2Ð4GÖHr   ©r6   r5   N)r&   r'   r(   r)   Ú__doc__r8   r@   rC   rF   r,   r-   r.   s   @r   r1   r1   (   s%   ø‡ € ñò
.ò?ò5÷Ið Ir   r1   c                   ó^   a € ] tR t^St o RRRR].RRRR].RRRR	].R
RRR]..tR t]tRt	V t
R# )ÚTypedOptionsÚfoointNéˆ  zFoo intÚfoofloatçìQ¸…ë@z	Foo floatÚeggintzEgg int without defaultÚeggfloatzEgg float without defaultc                ó   € Wn         R# )zO
This option has an underscore in its name to exercise the _ to -
translation.
N©ÚunderscoreValuer   s   &&r   Úopt_under_scoreÚTypedOptions.opt_under_score[   s
   € ð
  %Ör   rS   )r&   r'   r(   r)   ÚintÚfloatr*   rU   Úopt_ur,   r-   r.   s   @r   rK   rK   S   sR   ø‡ € à	�4˜˜i¨Ð-Ø	�T˜4 ¨eÐ4Ø	�4˜Ð8¸#Ð>Ø	�T˜4Ð!<¸eÐDð	€Mò%ð †Er   rK   c                   óH   a € ] tR t^et o RtR tR tR tR tR t	R t
RtV tR	# )
Ú
TypedTestszC
Test L{usage.Options.parseOptions} for options with forced types.
c                ó$   € \        4       V n        R # ©N)rK   r   r   s   &r   r8   ÚTypedTests.setUpj   s   € Ü!“^ˆŽ
r   c                óh  € . pV P                   P                  V4       V P                  V P                   P                  R,          R4       V P	                  V P                   P                  R,          \
        4       V P                  V P                   P                  R,          R4       V P	                  V P                   P                  R,          \        4       V P                  V P                   P                  R,          4       V P                  V P                   P                  R,          4       R# )z
Default values are parsed.
rL   rM   rN   rO   rP   rQ   N)r   r7   r?   r   ÚassertIsInstancerW   rX   ÚassertIsNone©r   ÚargVs   & r   Útest_defaultValuesÚTypedTests.test_defaultValuesm   sÅ   € ð ˆØ�
‰
×Ñ Ô%Ø×Ñ˜Ÿ™Ÿ™¨Õ2°CÔ8Ø×Ñ˜dŸj™jŸo™o¨hÕ7¼Ô=Ø×Ñ˜Ÿ™Ÿ™¨Õ4°dÔ;Ø×Ñ˜dŸj™jŸo™o¨jÕ9¼5ÔAØ×Ñ˜$Ÿ*™*Ÿ/™/¨(Õ3Ô4Ø×Ñ˜$Ÿ*™*Ÿ/™/¨*Õ5Ö6r   c                óL  € RP                  4       pV P                  P                  V4       V P                  V P                  P                  R,          R4       V P                  V P                  P                  R,          \        4       V P                  V P                  P                  R,          R	4       V P                  V P                  P                  R,          \        4       V P                  V P                  P                  R,          ^ 4       V P                  V P                  P                  R,          \        4       V P                  V P                  P                  R,          R4       V P                  V P                  P                  R,          \        4       R# )
z"
int and float values are parsed.
z8--fooint 912 --foofloat -823.1 --eggint 32 --eggfloat 21rL   i�  rN   rP   rQ   g      5@NgÍÌÌÌÌ¸‰À)r4   r   r7   r?   r   r`   rW   rX   rb   s   & r   Útest_parsingValuesÚTypedTests.test_parsingValuesz   s  € ð N×TÑTÓVˆØ�
‰
×Ñ Ô%Ø×Ñ˜Ÿ™Ÿ™¨Õ2°CÔ8Ø×Ñ˜dŸj™jŸo™o¨hÕ7¼Ô=Ø×Ñ˜Ÿ™Ÿ™¨Õ4°fÔ=Ø×Ñ˜dŸj™jŸo™o¨jÕ9¼5ÔAØ×Ñ˜Ÿ™Ÿ™¨Õ2°BÔ7Ø×Ñ˜dŸj™jŸo™o¨hÕ7¼Ô=Ø×Ñ˜Ÿ™Ÿ™¨Õ4°dÔ;Ø×Ñ˜dŸj™jŸo™o¨jÕ9¼5ÖAr   c                óŒ   € V P                   P                  RR.4       V P                  V P                   P                  R4       R# )z_
A dash in an option name is translated to an underscore before being
dispatched to a handler.
z--under-scoreÚfooN©r   r7   r?   rT   r   s   &r   Útest_underscoreOptionÚ TypedTests.test_underscoreOption‰   s5   € ð
 	�
‰
×Ñ °%Ð 8Ô9Ø×Ñ˜Ÿ™×3Ñ3°UÖ;r   c                óŒ   € V P                   P                  RR.4       V P                  V P                   P                  R4       R# )z5
An option name with a dash in it can have an alias.
z-uÚbarNrk   r   s   &r   Útest_underscoreOptionAliasÚ%TypedTests.test_underscoreOptionAlias‘   s4   € ð 	�
‰
×Ñ  u Ô.Ø×Ñ˜Ÿ™×3Ñ3°UÖ;r   c                ó�   € RP                  4       pV P                  \        P                  V P                  P                  V4       R# )z'
Passing wrong values raises an error.
z--fooint eggN)r4   ÚassertRaisesr   Ú
UsageErrorr7   rb   s   & r   Útest_invalidValuesÚTypedTests.test_invalidValues˜   s4   € ð ×#Ñ#Ó%ˆØ×Ñœ%×*Ñ*¨D¯J©J×,CÑ,CÀTÖJr   r   N)r&   r'   r(   r)   rI   r8   rd   rg   rl   rp   ru   r,   r-   r.   s   @r   r[   r[   e   s0   ø‡ € ñò$ò7òBò<ò<÷Kð Kr   r[   c                   ó    € ] tR t^ t. RO.tRtR# )ÚWrongTypedOptionsNr   )ÚbarwrongNNzBar with wrong coerceÚhe)r&   r'   r(   r)   r*   r,   r   r   r   rx   rx       s
   † ÚLÐM„Mr   rx   c                   óH   a € ] tR t^¤t o R tR tRRRR].RRRR]..tRtV tR# )	ÚWeirdCallableOptionsc                ó   € \        R 4      h)ÚOuch)ÚRuntimeError©r   s   &r   Ú_barÚWeirdCallableOptions._bar¥   s   € Ü˜6Ó"Ð"r   c                ó   € \        R 4      h)ÚYay)Ú
ValueErrorr€   s   &r   Ú_fooÚWeirdCallableOptions._foo¨   s   € Ü˜ÓÐr   ry   NzBar with strange callableÚfoowrongzFoo with strange callabler   )	r&   r'   r(   r)   r�   r†   r*   r,   r-   r.   s   @r   r|   r|   ¤   s6   ø‡ € ò#ò ð 
�T˜4Ð!<¸dÐCØ	�T˜4Ð!<¸dÐCð†Mr   r|   c                   ó6   a € ] tR t^±t o RtR tR tR tRtV t	R# )ÚWrongTypedTestsz>
Test L{usage.Options.parseOptions} for wrong coerce options.
c                ó|   € \        4       pRP                  4       pV P                  \        VP                  V4       R# )z"
Using a non-callable type fails.
z--barwrong eggN)rx   r4   rs   Ú	TypeErrorr7   ©r   Úusrc   s   &  r   Útest_nonCallableÚ WrongTypedTests.test_nonCallable¶   s0   € ô Ó ˆØ×%Ñ%Ó'ˆØ×Ñœ) R§_¡_°dÖ;r   c                ó@   € \        4       p. pVP                  V4       R# )z@
The coerce functions are not called if no values are provided.
N)r|   r7   r�   s   &  r   Útest_notCalledInDefaultÚ'WrongTypedTests.test_notCalledInDefault¾   s   € ô "Ó#ˆØˆØ
�‰˜Ör   c                ó<  € \        4       pRP                  4       pV P                  \        P                  VP
                  V4      pV P                  \        V4      R4       \        4       pRP                  4       pV P                  \        VP
                  V4       R# )z9
Errors raised by coerce functions are handled properly.
z--foowrong blahz&Parameter type enforcement failed: Yayz--barwrong blahN)	r|   r4   rs   r   rt   r7   r?   Ústrr   )r   rŽ   rc   Úes   &   r   Útest_weirdCallableÚ"WrongTypedTests.test_weirdCallableÆ   sy   € ô "Ó#ˆØ ×&Ñ&Ó(ˆà×Ñœe×.Ñ.°·±ÀÓFˆØ×Ñœ˜Q›Ð!IÔJä!Ó#ˆØ ×&Ñ&Ó(ˆà×Ñœ,¨¯©¸Ö>r   r   N)
r&   r'   r(   r)   rI   r�   r’   r—   r,   r-   r.   s   @r   rŠ   rŠ   ±   s   ø‡ € ñò<ò÷?ð ?r   rŠ   c                   ó&   a € ] tR t^Öt o R tRtV tR# )ÚOutputTestsc                ó¨   € \        4       pV P                  \        P                  VP                  R.4      pV P                  \        V4      R4       R# )z6
Error output case adjustment does not mangle options
z-Zzoption -Z not recognizedN)r   rs   r   rt   r7   r?   r•   )r   Úoptr–   s   &  r   Útest_uppercasingÚOutputTests.test_uppercasing×   sB   € ô ‹mˆØ×Ñœe×.Ñ.°×0@Ñ0@À4À&ÓIˆØ×Ñœ˜Q›Ð!;Ö<r   r   N)r&   r'   r(   r)   r�   r,   r-   r.   s   @r   rš   rš   Ö   s   ø‡ € ÷=ð =r   rš   c                   ó"   € ] tR t^àtR.tR.tRtR# )ÚInquisitionOptionsr   N)Úexpectr–   )útorture-deviceÚtúcomfy-chairzset preferred torture device)r&   r'   r(   r)   r+   r*   r,   r   r   r   r    r    à   s   † àð€Hð 	Oð„Mr   r    c                   ó   € ] tR t^étRR.tRtR# )ÚHolyQuestOptionsr   N)Ú	horsebackÚhzuse a horse)ú	for-grailÚg)r&   r'   r(   r)   r+   r,   r   r   r   r¦   r¦   é   s   † à)Øð„Hr   r¦   c                   ó4   € ] tR t^ðtR	.tRR]R3RR]R3.tRtR# )
ÚSubCommandOptionsNÚinquisitionÚinquestzPerform an inquisitionÚ	holyquestÚquestzEmbark upon a holy questr   )úeuropian-swallowNz$set default swallow type to Europian)	r&   r'   r(   r)   r+   r    r¦   ÚsubCommandsr,   r   r   r   r¬   r¬   ð   s1   † àJð€Hð 
˜	Ð#5Ð7OÐPØ	�gÐ/Ð1KÐLð„Kr   r¬   c                   óT   a € ] tR t^út o RtR tR tR tR tR t	R t
R tR	 tR
tV tR# )ÚSubCommandTestszB
Test L{usage.Options.parseOptions} for options with subcommands.
c                ór  € \        4       pVP                  RR.4       V P                  VR,          4       V P                  VP                  R4       V P                  VP                  \        4       V P                  VP                  R,          4       V P                  VP                  R,          R4       R# )z
A subcommand is recognized.
ú--europian-swallowr­   r±   r¡   r¢   r¤   N)	r¬   r7   Ú
assertTruer?   Ú
subCommandr`   Ú
subOptionsr    ÚassertFalse©r   r   s   & r   Útest_simpleSubcommandÚ%SubCommandTests.test_simpleSubcommandÿ   sŠ   € ô ÓˆØ	�‰Ð,¨mÐ<Ô=Ø�‰˜Ð,Õ-Ô.Ø×Ñ˜Ÿ™ }Ô5Ø×Ñ˜aŸl™lÔ,>Ô?Ø×Ñ˜Ÿ™ hÕ/Ô0Ø×Ñ˜Ÿ™Ð&6Õ7¸ÖGr   c                ór  € \        4       pVP                  . RO4       V P                  VR,          4       V P                  VP                  R4       V P                  VP                  \        4       V P                  VP                  R,          4       V P                  VP                  R,          R4       R# )z1
Flags and options of a subcommand are assigned.
r­   r±   r¡   r¢   ÚfeatherN)r­   ú--expectú--torture-device=feather©	r¬   r7   rº   r?   r¸   r`   r¹   r    r·   r»   s   & r   Ú"test_subcommandWithFlagsAndOptionsÚ2SubCommandTests.test_subcommandWithFlagsAndOptions  s…   € ô ÓˆØ	�‰ÒNÔOØ×Ñ˜Ð-Õ.Ô/Ø×Ñ˜Ÿ™ }Ô5Ø×Ñ˜aŸl™lÔ,>Ô?Ø�‰˜Ÿ™ XÕ.Ô/Ø×Ñ˜Ÿ™Ð&6Õ7¸ÖCr   c                ór  € \        4       pVP                  . RO4       V P                  VR,          4       V P                  VP                  R4       V P                  VP                  \        4       V P                  VP                  R,          4       V P                  VP                  R,          R4       R# )z7
Flags and options of a subcommand alias are assigned.
r±   r­   r¡   r¢   r¿   N)r®   rÀ   rÁ   rÂ   r»   s   & r   Ú'test_subcommandAliasWithFlagsAndOptionsÚ7SubCommandTests.test_subcommandAliasWithFlagsAndOptions  s…   € ô ÓˆØ	�‰ÒJÔKØ×Ñ˜Ð-Õ.Ô/Ø×Ñ˜Ÿ™ }Ô5Ø×Ñ˜aŸl™lÔ,>Ô?Ø�‰˜Ÿ™ XÕ.Ô/Ø×Ñ˜Ÿ™Ð&6Õ7¸ÖCr   c                óp  € \        4       pVP                  RR.4       V P                  VR,          4       V P                  VP                  R4       V P                  VP                  \        4       V P                  VP                  R,          4       V P                  VP                  R,          4       R# )z7
Flags and options of another subcommand are assigned.
r¯   z--for-grailr±   r§   r©   N)	r¬   r7   rº   r?   r¸   r`   r¹   r¦   r·   r»   s   & r   Ú)test_anotherSubcommandWithFlagsAndOptionsÚ9SubCommandTests.test_anotherSubcommandWithFlagsAndOptions#  s†   € ô ÓˆØ	�‰˜ ]Ð3Ô4Ø×Ñ˜Ð-Õ.Ô/Ø×Ñ˜Ÿ™ {Ô3Ø×Ñ˜aŸl™lÔ,<Ô=Ø×Ñ˜Ÿ™ kÕ2Ô3Ø�‰˜Ÿ™ [Õ1Ö2r   c                óÚ   € \        4       pVP                  R.4       V P                  VR,          4       V P                  VP                  4       V P                  \        VR4      4       R# )zh
If no subcommand is specified and no default subcommand is assigned,
a subcommand will not be implied.
r¶   r±   r¹   N)r¬   r7   r·   ra   r¸   rº   Úhasattrr»   s   & r   Útest_noSubcommandÚ!SubCommandTests.test_noSubcommand/  sU   € ô
 ÓˆØ	�‰Ð,Ð-Ô.Ø�‰˜Ð,Õ-Ô.Ø×Ñ˜!Ÿ,™,Ô'Ø×Ñœ  LÓ1Ö2r   c                ó~  € \        4       pRVn        VP                  R.4       V P                  VR,          4       V P	                  VP
                  R4       V P                  VP                  \        4       V P                  VP                  R,          4       V P	                  VP                  R,          R4       R# )	z;
Flags and options in the default subcommand are assigned.
r®   r¶   r±   r­   r¡   r¢   r¤   N)
r¬   ÚdefaultSubCommandr7   r·   r?   r¸   r`   r¹   r    rº   r»   s   & r   Útest_defaultSubcommandÚ&SubCommandTests.test_defaultSubcommand:  s�   € ô ÓˆØ'ˆÔØ	�‰Ð,Ð-Ô.Ø�‰˜Ð,Õ-Ô.Ø×Ñ˜Ÿ™ }Ô5Ø×Ñ˜aŸl™lÔ,>Ô?Ø×Ñ˜Ÿ™ hÕ/Ô0Ø×Ñ˜Ÿ™Ð&6Õ7¸ÖGr   c                ó:  a€  ! R R\         P                  4      o ! V3R lR\         P                  4      pV! 4       pVP                  R.4       V P                  \	        VP
                  R4      4       V P                  VP
                  P                  V4       R# )z_
The parseOptions method from the Options object specified for the
given subcommand is called.
c                   ó&   a € ] tR tRt o R tRtV tR# )ÚDSubCommandTests.test_subCommandParseOptionsHasParent.<locals>.SubOptiM  c                óp   € V P                   V n        \        P                  P                  ! V .VO5/ VB  R # r]   )ÚparentÚ	sawParentr   ÚOptionsr7   )r   ÚaÚkws   &*,r   r7   ÚQSubCommandTests.test_subCommandParseOptionsHasParent.<locals>.SubOpt.parseOptionsN  s)   € Ø!%§¡�”Ü—‘×*Ò*¨4Ð:°!Ò:°rÔ:r   )rØ   N)r&   r'   r(   r)   r7   r,   r-   r.   s   @r   ÚSubOptrÕ   M  s   ø‡ € ÷;ð ;r   rÝ   c                   ó(   <€ ] tR tRtRR Z R3.tRtR# )ÚASubCommandTests.test_subCommandParseOptionsHasParent.<locals>.OptiR  rj   r%   ro   r   N©r&   r'   r(   r)   r²   r,   ©rÝ   s   €r   ÚOptrß   R  s   ø† à˜™V UÐ+ðŒKr   râ   rj   rØ   N)r   rÙ   r7   r·   rÌ   r¹   r?   rØ   )r   râ   r   rÝ   s   &  @r   Ú$test_subCommandParseOptionsHasParentÚ4SubCommandTests.test_subCommandParseOptionsHasParentG  sk   ø€ ô	;”U—]‘]ô 	;÷
	”%—-‘-ô 	ñ
 ‹EˆØ	�‰˜�wÔØ�‰œ §¡¨kÓ:Ô;Ø×Ñ˜Ÿ™×/Ñ/°Ö3r   c                ó:  a€  ! R R\         P                  4      o ! V3R lR\         P                  4      p ! V3R lR\         P                  4      pV! 4       pVP                  R.4       V! 4       pVP                  R.4       V P                  \	        VP
                  R	4      4       V P                  \	        VP
                  R	4      4       V P                  VP
                  P                  V4       V P                  VP
                  P                  V4       R
# )zP
The .parent pointer is correct even when the same Options class is
used twice.
c                   ó   € ] tR tRtRtR# )Ú:SubCommandTests.test_subCommandInTwoPlaces.<locals>.SubOptib  r   N)r&   r'   r(   r)   r,   r   r   r   rÝ   rç   b  s   † Ûr   rÝ   c                   ó(   <€ ] tR tRtRR Z R3.tRtR# )Ú:SubCommandTests.test_subCommandInTwoPlaces.<locals>.OptFooie  rj   r%   Úquuxr   Nrà   rá   s   €r   ÚOptFooré   e  ó   ø† à˜™V VÐ,ðŒKr   rë   c                   ó(   <€ ] tR tRtRR Z R3.tRtR# )Ú:SubCommandTests.test_subCommandInTwoPlaces.<locals>.OptBarij  ro   Úbrê   r   Nrà   rá   s   €r   ÚOptBarrî   j  rì   r   rð   rj   ro   r×   N)r   rÙ   r7   r·   rÌ   r¹   ÚfailUnlessIdenticalr×   )r   rë   rð   ÚoFooÚoBarrÝ   s   &    @r   Útest_subCommandInTwoPlacesÚ*SubCommandTests.test_subCommandInTwoPlaces\  sÅ   ø€ ô	”U—]‘]ô 	÷	”U—]‘]ô 	÷
	”U—]‘]ô 	ñ
 ‹xˆØ×Ñ˜5˜'Ô"Ù‹xˆØ×Ñ˜5˜'Ô"Ø�‰œ §¡°Ó:Ô;Ø�‰œ §¡°Ó:Ô;Ø× Ñ  §¡×!7Ñ!7¸Ô>Ø× Ñ  §¡×!7Ñ!7¸Ö>r   r   N)r&   r'   r(   r)   rI   r¼   rÃ   rÆ   rÉ   rÍ   rÑ   rã   rô   r,   r-   r.   s   @r   r´   r´   ú   s;   ø‡ € ñò
Hò
Dò
Dò
3ò	3òHò4÷*?ð ?r   r´   c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )ÚHelpStringTestsiy  z
Test generated help strings.
c                óN   € RP                  4       V n        \        4       V n        R# )z+
Instantiate a well-behaved Options class.
r3   N)r4   r5   r   r6   r   s   &r   r8   ÚHelpStringTests.setUp~  s!   € ð Vß
‰%‹'ð 	Œô  “MˆŽ	r   c                ó�   €  V P                   P                  4        R#   \         d   pT P                  T4        Rp?R# Rp?ii ; i)z
__str__ shouldn't go boom.
N)r6   Ú__str__Ú	ExceptionÚfail)r   r–   s   & r   Útest_noGoBoomÚHelpStringTests.test_noGoBoom‰  s4   € ð	Ø�I‰I×ÑÖøÜô 	Ø�I‰I�a�LŠLûð	ús   ‚ žA©A Á Ac                ó0  € \        V P                  4      P                  4        Uu. uF  qP                  R4      ^ 8¼  g   K  VNK  	  ppV P	                  \        V4      ^ 8„  4       V P	                  V^ ,          P                  R4      ^ 8¬  4       R# u upi )z;
Extra whitespace in flag and parameters docs is stripped.
r$   ÚflagalliciousN)r•   r6   Ú
splitlinesÚfindr·   Úlen)r   ÚsÚliness   &  r   Ú&test_whitespaceStripFlagsAndParametersÚ6HelpStringTests.test_whitespaceStripFlagsAndParameters’  sr   € ô   §	¡	›N×5Ñ5Ô7ÓPÑ7�q¿6¹6À'»?ÈaÑ;O—�Ñ7ˆÐPØ�‰œ˜E›
 Q™Ô'Ø�‰˜˜a�Ÿ™ oÓ6¸!Ñ;Ö<ùò Qs   ¦BÁBrH   N)
r&   r'   r(   r)   rI   r8   rþ   r  r,   r-   r.   s   @r   r÷   r÷   y  s   ø‡ € ñò	"ò÷=ð =r   r÷   c                   ó0   a € ] tR tRt o RtR tR tRtV tR# )ÚPortCoerceTestsi�  z+
Test the behavior of L{usage.portCoerce}.
c                óê   € V P                  ^ \        P                  ! R4      4       V P                  R\        P                  ! R4      4       V P                  R\        P                  ! R4      4       R# )z$
Test the answers with valid input.
Ú0iŠ  Ú3210iÿÿ  Ú65535N)r?   r   Ú
portCoercer   s   &r   Útest_validCoerceÚ PortCoerceTests.test_validCoerce¢  sU   € ð 	×Ñ˜œE×,Ò,¨SÓ1Ô2Ø×Ñ˜œu×/Ò/°Ó7Ô8Ø×Ñ˜¤× 0Ò 0°Ó 9Ö:r   c                ó.  € V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       R# )z
Test error path.
Ú z-21Ú212189rj   N)rs   r…   r   r  r   s   &r   Útest_errorCoerceÚ PortCoerceTests.test_errorCoerceª  sd   € ð 	×Ñœ*¤e×&6Ñ&6¸Ô;Ø×Ñœ*¤e×&6Ñ&6¸Ô>Ø×Ñœ*¤e×&6Ñ&6¸ÔAØ×Ñœ*¤e×&6Ñ&6¸Ö>r   r   N)	r&   r'   r(   r)   rI   r  r  r,   r-   r.   s   @r   r
  r
  �  s   ø‡ € ñò;÷?ð ?r   r
  c                   ó`   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )ÚZshCompleterTestsi´  z
Test the behavior of the various L{twisted.usage.Completer} classes
for producing output usable by zsh tab-completion system.
c                ó(  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VR4       R# )zH
Completer produces zsh shell-code that produces no completion matches.
úsome-optionz:some-option:úsome actionT©ÚdescrÚrepeatú*:some action:N)r   Ú	CompleterÚ
_shellCodeÚ_ZSHr?   ©r   ÚcÚgots   &  r   Útest_completerÚ ZshCompleterTests.test_completerº  si   € ô �OŠOÓˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜˜oÔ.ä�OŠO -¸Ô=ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð.Ö/r   c                óº  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! R4      pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRRR7      pVP                  R\         P                  4      pV P	                  VR4       R	# )
zV
CompleteFiles produces zsh shell-code that completes file names
according to a glob.
r  z:some-option (*):_files -g "*"z*.pyz$:some-option (*.py):_files -g "*.py"r  Tr  z%*:some action (*.py):_files -g "*.py"N)r   ÚCompleteFilesr!  r"  r?   r#  s   &  r   Ú
test_filesÚZshCompleterTests.test_filesÆ  s¥   € ô
 ×ÒÓ!ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð>Ô?ä×Ò Ó'ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜ÐDÔEä×Ò ¨mÀDÔIˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜ÐEÖFr   c                ó(  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VR4       R# )zF
CompleteDirs produces zsh shell-code that completes directory names.
r  z:some-option:_directoriesr  Tr  z*:some action:_directoriesN)r   ÚCompleteDirsr!  r"  r?   r#  s   &  r   Ú	test_dirsÚZshCompleterTests.test_dirs×  sn   € ô ×ÒÓ ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð9Ô:ä×Ò ]¸4Ô@ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð:Ö;r   c                óÄ  € \         P                  ! R4      pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! . R
O4      pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! . R
ORRR7      pVP                  R\         P                  4      pV P	                  VR4       R	# )z_
CompleteList produces zsh shell-code that completes words from a fixed
list of possibilities.
ÚABCr  z:some-option:(A B C)z:some-option:(1 2 3)r  Tr  z*:some action:(1 2 3)N©Ú1Ú2Ú3)r   ÚCompleteListr!  r"  r?   r#  s   &  r   Ú	test_listÚZshCompleterTests.test_listã  s§   € ô
 ×Ò˜uÓ%ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð4Ô5ä×ÒšÓ/ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð4Ô5ä×Òš°mÈDÔQˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð5Ö6r   c                óÆ  € \         P                  ! R4      pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! . R
O4      pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! . R
ORRR7      pVP                  R\         P                  4      pRpV P	                  W#4       R	# )z}
CompleteMultiList produces zsh shell-code that completes multiple
comma-separated words from a fixed list of possibilities.
r1  r  z-:some-option:_values -s , 'some-option' A B Cz-:some-option:_values -s , 'some-option' 1 2 3r  Tr  z.*:some action:_values -s , 'some action' 1 2 3Nr2  )r   ÚCompleteMultiListr!  r"  r?   )r   r$  r%  Úexpecteds   &   r   Útest_multiListÚ ZshCompleterTests.test_multiListô  sª   € ô
 ×#Ò# EÓ*ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜ÐMÔNä×#Ò#¢OÓ4ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜ÐMÔNä×#Ò#¢O¸=ÐQUÔVˆØ�l‰l˜=¬%¯*©*Ó5ˆØCˆØ×Ñ˜Ö'r   c                ó(  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VR4       R# )zL
CompleteUsernames produces zsh shell-code that completes system
usernames.
r  z:some-option:_usersr  Tr  z*:some action:_usersN)r   ÚCompleteUsernamesr!  r"  r?   ©r   r$  Úouts   &  r   Útest_usernamesÚ ZshCompleterTests.test_usernames  sn   € ô
 ×#Ò#Ó%ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð3Ô4ä×#Ò#¨-ÀÔEˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð4Ö5r   c                ó(  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VR4       R# )zK
CompleteGroups produces zsh shell-code that completes system group
names.
r  z:group:_groupsr  Tr  z*:some action:_groupsN)r   ÚCompleteGroupsr!  r"  r?   r@  s   &  r   Útest_groupsÚZshCompleterTests.test_groups  sn   € ô
 × Ò Ó"ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð.Ô/ä× Ò  }¸TÔBˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð5Ö6r   c                ó(  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VR4       R# )zE
CompleteHostnames produces zsh shell-code that completes hostnames.
r  z:some-option:_hostsr  Tr  z*:some action:_hostsN)r   ÚCompleteHostnamesr!  r"  r?   r@  s   &  r   Útest_hostnamesÚ ZshCompleterTests.test_hostnames   sn   € ô ×#Ò#Ó%ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð3Ô4ä×#Ò#¨-ÀÔEˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð4Ö5r   c                ó`  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VP                  R4      4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VP                  R4      4       R# )zr
CompleteUserAtHost produces zsh shell-code that completes hostnames or
a word of the form <username>@<hostname>.
r  z:host | user@host:r  Tr  r  N)r   ÚCompleteUserAtHostr!  r"  r·   Ú
startswithr@  s   &  r   Útest_userAtHostÚ!ZshCompleterTests.test_userAtHost,  sx   € ô
 ×$Ò$Ó&ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ�‰˜Ÿ™Ð';Ó<Ô=ä×$Ò$¨=ÀÔFˆØ�l‰l˜=¬%¯*©*Ó5ˆØ�‰˜Ÿ™Ð'7Ó8Ö9r   c                ó(  € \         P                  ! 4       pVP                  R\         P                  4      pV P	                  VR4       \         P                  ! RRR7      pVP                  R\         P                  4      pV P	                  VR4       R# )z^
CompleteNetInterfaces produces zsh shell-code that completes system
network interface names.
r  z:some-option:_net_interfacesr  Tr  z*:some action:_net_interfacesN)r   ÚCompleteNetInterfacesr!  r"  r?   r@  s   &  r   Útest_netInterfacesÚ$ZshCompleterTests.test_netInterfaces9  sn   € ô
 ×'Ò'Ó)ˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð<Ô=ä×'Ò'¨mÀDÔIˆØ�l‰l˜=¬%¯*©*Ó5ˆØ×Ñ˜Ð=Ö>r   r   N)r&   r'   r(   r)   rI   r&  r*  r.  r7  r<  rB  rF  rJ  rO  rS  r,   r-   r.   s   @r   r  r  ´  sB   ø‡ € ñò

0òGò"
<ò7ò"(ò$6ò7ò
6ò:÷?ð ?r   r  c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚCompleterNotImplementedTestsiG  zg
Using an unknown shell constant with the various Completer() classes
should raise NotImplementedError
c           
     óÎ  € \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  \         P                  \         P                  \         P                  \         P                  .
pV F-  p V! 4       pV P                  \        VP                  RR4       K/  	  R#   \         d    T! R4      p L=i ; i)z=
Using an unknown shellType should raise NotImplementedError
NÚbad_shell_type)r   r   r)  r-  r6  r:  r?  rE  rI  rM  rR  ÚBaseExceptionrs   ÚNotImplementedErrorr!  )r   ÚclassesÚclsÚactions   &   r   Útest_unknownShellÚ.CompleterNotImplementedTests.test_unknownShellM  sµ   € ô
 �O‰OÜ×ÑÜ×ÑÜ×ÑÜ×#Ñ#Ü×#Ñ#Ü× Ñ Ü×#Ñ#Ü×$Ñ$Ü×'Ñ'ð
ˆó ˆCð#Ù›�ð ×ÑÜ# V×%6Ñ%6¸Ð>Nöó øô !ô #Ù˜T›’ð#ús   ÂCÃC$Ã#C$r   N)r&   r'   r(   r)   rI   r^  r,   r-   r.   s   @r   rV  rV  G  s   ø‡ € ñ÷
ð r   rV  c                   óP   a € ] tR tRt o Rt ! R R4      tR tR tR tR t	R	t
V tR
# )ÚFlagFunctionTestsih  z"
Tests for L{usage.flagFunction}.
c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )ÚFlagFunctionTests.SomeClassim  z.
Dummy class for L{usage.flagFunction} tests.
c                ó   € R# )z�
A one argument method to be tested by L{usage.flagFunction}.

@param a: a useless argument to satisfy the function's signature.
Nr   )r   rÚ   s   &&r   ÚoneArgÚ"FlagFunctionTests.SomeClass.oneArgr  ó   ‚ r   c                ó   € R# )z=
A no argument method to be tested by L{usage.flagFunction}.
Nr   r   s   &r   ÚnoArgÚ!FlagFunctionTests.SomeClass.noArgy  rg  r   c                ó   € R# )a  
A multiple arguments method to be tested by L{usage.flagFunction}.

@param a: a useless argument to satisfy the function's signature.
@param b: a useless argument to satisfy the function's signature.
@param c: a useless argument to satisfy the function's signature.
Nr   )r   rÚ   rï   r$  s   &&&&r   ÚmanyArgsÚ$FlagFunctionTests.SomeClass.manyArgs~  rg  r   r   N)
r&   r'   r(   r)   rI   re  ri  rl  r,   r-   r.   s   @r   Ú	SomeClassrc  m  s   ø‡ € ñ	ò	ò	÷
	ð 	r   rn  c                ó‚   € V P                  R\        P                  ! V P                  4       P                  4      4       R# )z[
L{usage.flagFunction} returns C{False} if the method checked allows
exactly one argument.
FN)ÚassertIsr   ÚflagFunctionrn  re  r   s   &r   Útest_hasArgÚFlagFunctionTests.test_hasArg‡  s*   € ð
 	�‰�eœU×/Ò/°·±Ó0@×0GÑ0GÓHÖIr   c                ó‚   € V P                  R\        P                  ! V P                  4       P                  4      4       R# )zY
L{usage.flagFunction} returns C{True} if the method checked allows
exactly no argument.
TN)rp  r   rq  rn  ri  r   s   &r   Ú
test_noArgÚFlagFunctionTests.test_noArgŽ  s*   € ð
 	�‰�dœE×.Ò.¨t¯~©~Ó/?×/EÑ/EÓFÖGr   c                óÊ   € V P                  \        P                  \        P                  V P	                  4       P
                  4      pV P                  R\        V4      4       R# )zg
L{usage.flagFunction} raises L{usage.UsageError} if the method checked
allows more than one argument.
z$Invalid Option function for manyArgsN©rs   r   rt   rq  rn  rl  r?   r•   ©r   Úexcs   & r   Útest_tooManyArgumentsÚ'FlagFunctionTests.test_tooManyArguments•  sK   € ð
 ×ÑÜ×Ñœe×0Ñ0°$·.±.Ó2B×2KÑ2Kó
ˆð 	×ÑÐ?ÄÀSÃÖJr   c                óÌ   € V P                  \        P                  \        P                  V P	                  4       P
                  R4      pV P                  R\        V4      4       R# )zy
L{usage.flagFunction} uses the given method name in the error message
raised when the method allows too many arguments.
Úflubudufz$Invalid Option function for flubudufNrx  ry  s   & r   Ú,test_tooManyArgumentsAndSpecificErrorMessageÚ>FlagFunctionTests.test_tooManyArgumentsAndSpecificErrorMessageŸ  sM   € ð
 ×ÑÜ×Ñœe×0Ñ0°$·.±.Ó2B×2KÑ2KÈZó
ˆð 	×ÑÐ?ÄÀSÃÖJr   r   N)r&   r'   r(   r)   rI   rn  rr  ru  r{  r  r,   r-   r.   s   @r   ra  ra  h  s2   ø‡ € ñ÷ñ ò4JòHòK÷Kð Kr   ra  c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚOptionsInternalTestsiª  z.
Tests internal behavior of C{usage.Options}.
c           
     ó  €  ! R R\         P                  4      pV! 4       pV P                  \        P	                  . ROR4      RVP
                  R,          RVP
                  R,          RVP
                  R,          /4       R# )z[
Options which are synonyms to another option are aliases towards the
longest option name.
c                   ó.   a € ] tR tRt o R t]t]tRtV tR# )Ú;OptionsInternalTests.test_optionsAliasesOrder.<locals>.Optsiµ  c                ó   € R# )zN
This is an option method with a very long name, that is going to
be aliased.
Nr   r   s   &r   Úopt_very_very_longÚNOptionsInternalTests.test_optionsAliasesOrder.<locals>.Opts.opt_very_very_long¶  rg  r   r   N)	r&   r'   r(   r)   r‡  Ú	opt_shortÚopt_sr,   r-   r.   s   @r   ÚOptsr…  µ  s   ø‡ € òð +ˆIØ&ŽEr   r‹  r  Úshortúvery-very-longN)r  rŒ  r�  )r   rÙ   r?   ÚdictÚfromkeysÚsynonyms)r   r‹  r   s   &  r   Útest_optionsAliasesOrderÚ-OptionsInternalTests.test_optionsAliasesOrder¯  si   € ô	'”5—=‘=ô 	'ñ ‹vˆà×ÑÜ�M‰MÒ:Ð<LÓMà�T—]‘] 3Õ'Ø˜Ÿ™ wÕ/Ø  $§-¡-Ð0@Õ"Aðö	
r   r   N)r&   r'   r(   r)   rI   r‘  r,   r-   r.   s   @r   r‚  r‚  ª  s   ø‡ € ñ÷
ð 
r   r‚  N)rI   Útwisted.pythonr   Útwisted.trialr   rÙ   r   ÚTestCaser1   rK   r[   rx   r|   rŠ   rš   r    r¦   r¬   r´   r÷   r
  r  rV  ra  r‚  r   r   r   Ú<module>r–     s\  ðñõ
 !Ý "ô7�%—-‘-ô 7ô6(I˜H×-Ñ-ô (IôV�5—=‘=ô ô$8K�×"Ñ"ô 8KôvN˜Ÿ™ô Nô
˜5Ÿ=™=ô 
ô"?�h×'Ñ'ô "?ôJ=�(×#Ñ#ô =ô˜Ÿ™ô ô�u—}‘}ô ô˜Ÿ™ô ô|?�h×'Ñ'ô |?ô~!=�h×'Ñ'ô !=ôH?�h×'Ñ'ô ?ô.P?˜×)Ñ)ô P?ôf 8×#4Ñ#4ô ôB?K˜×)Ñ)ô ?KôD
˜8×,Ñ,ö 
r   