+
    Df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	2F;
3Y?4g>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?     	17;	24G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foofloatQ@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-	T4e4	48#>	T4!<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     

%2C8djjooh7=4d;djjooj95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

%2C8djjooh7=4f=djjooj95A2B7djjooh7=4d;djjooj95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3U;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3U;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     ##%%**DJJ,C,CT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MMr   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     #  
T4!<dC	T4!<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 
	#57O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all,>?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_subcommandWithFlagsAndOptions2SubCommandTests.test_subcommandWithFlagsAndOptions  s     	NO-./}5all,>?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_subcommandAliasWithFlagsAndOptions7SubCommandTests.test_subcommandAliasWithFlagsAndOptions  s     	JK-./}5all,>?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_anotherSubcommandWithFlagsAndOptions9SubCommandTests.test_anotherSubcommandWithFlagsAndOptions#  s     	]34-./{3all,<=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all,>?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    VU+Kr   r   rj   r   N)r   r   r7   r   r   r   r?   r   )r   r   r   r   s   &  @r   $test_subCommandParseOptionsHasParent4SubCommandTests.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      VV,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    	II 	IIaLL	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_whitespaceStripFlagsAndParameters6HelpStringTests.test_whitespaceStripFlagsAndParameters  sr      		N557P7q66'?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     OOll=%**5o.OO-=ll=%**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    
 !ll=%**5>?'ll=%**5DEmDIll=%**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      ll=%**59:]4@ll=%**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%ll=%**545/ll=%**545mDQll=%**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*ll=%**5MN##O4ll=%**5MN##O=QUVll=%**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    
 ##%ll=%**534##-Ell=%**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    
   "ll=%**5./  }TBll=%**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     ##%ll=%**534##-Ell=%**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    
 $$&ll=%**5';<=$$=Fll=%**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    
 '')ll=%**5<=''mDIll=%**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    
 OO####  ##$$''
 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*    
 	eU//0@0G0G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*    
 	dE..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$..2B2K2K
 	?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$..2B2K2KZ
 	?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_longNOptionsInternalTests.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MM:<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%-- 76(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   