+
    Biz                       ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ]P:                  P=                  ]
P>                  4      t  ! R	 R
]PB                  4      t" ! R R]PF                  4      t$ ! R R]PF                  4      t#]PJ                   ! R R]&4      4       t' ! R R]&4      t( ! R R]&4      t) ! R R]*4      t+R t, ! R R]PZ                  4      t. ! R R]/4      t0]#3t1]0! R]1/ 4      t2 ! R R]24      t3 ! R R ]24      t4 ! R! R"]24      t5 ! R# R$]24      t6 ! R% R&]24      t7 ! R' R(]24      t8 ! R) R*]24      t9 ! R+ R,]24      t: ! R- R.]24      t; ! R/ R0]24      t< ! R1 R2]24      t= ! R3 R4]24      t> ! R5 R6]24      t? ! R7 R8]24      t@ ! R9 R:]24      tA ! R; R<]24      tB ! R= R>]24      tC ! R? R@]24      tD ! RA RB]24      tE ! RC RD]24      tF ! RE RF]24      tG ! RG RH]24      tH ! RI RJ]24      tI ! RK RL]24      tJ ! RM RN]24      tK ! RO RP]24      tL ! RQ RR]24      tM ! RS RT]24      tN ! RU RV]24      tO ! RW RX]24      tP ! RY RZ]24      tQ ! R[ R\]24      tR ! R] R^]24      tS ! R_ R`]24      tT ! Ra Rb]24      tU ! Rc Rd]24      tV ! Re Rf]24      tW ! Rg Rh]24      tX ! Ri Rj]24      tY ! Rk Rl]24      tZ ! Rm Rn]24      t[ ! Ro Rp]24      t\ ! Rq Rr]#4      t] ! Rs Rt]24      t^ ! Ru Rv]24      t_ ! Rw Rx]24      t` ! Ry Rz]24      ta ! R{ R|]24      tb ! R} R~]24      tc ! R R]24      td ! R R]24      te ! R R]24      tf ! R R]24      tg ! R R]24      th ! R R]24      ti ! R R]24      tj ! R R]24      tk ! R R]24      tl ! R R]24      tm ! R R]24      tn ! R R]24      to ! R R]24      tp ! R R]24      tq ! R R]24      tr ! R R]24      ts ! R R]24      tt ! R R]24      tu ! R R]24      tv ! R R]24      tw ! R R]24      tx ! R R]24      ty ! R R]24      tz ! R R]24      t{ ! R R]24      t| ! R R]24      t} ! R R]24      t~ ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]']24      t ! R R]']24      tR t ! R R]#4      t ! R R]#4      t]&! 4       t]&! 4       t ! R R4      t]! R4      t]! R4      t]! R4      t]! R4      t]! R4      t]! R4      t ! R R]&4      t ! R R]']24      t ! R R]']24      t ! R R]']24      t ! R R]&4      t]EP>                   ! R R]']24      4       t]EP>                   ! R R]']24      4       t]EP>                   ! R R]']24      4       t]EP>                   ! R R]4      4       t ! R R]#4      t ! R R]#4      t ! R R]24      t ! R R]24      t ! R R]24      t ! R R]#4      t ! R R]24      t ! ER  ER]#4      t ! ER ER]24      t ! ER ER]24      t ! ER ER]#4      t ! ER ER	]#4      t] ! ER
 ER]#4      4       t ! ER ER]#4      t ! ER ER]#4      t] ! ER ER]#4      4       t] ! ER ER]#4      4       t ! ER ER]&4      t ! ER ER]]#4      t ! ER ER]]#4      t ! ER ER]]#4      t ! ER ER]]#4      t ! ER ER]]#4      t ! ER  ER!]]#4      t ! ER" ER#]]#4      t ! ER$ ER%]]#4      t ! ER& ER']]#4      t ! ER( ER)]]#4      t ! ER* ER+]]#4      t ! ER, ER-]&4      t ! ER. ER/]]4      t ! ER0 ER1]]4      t ! ER2 ER3]]4      t ! ER4 ER5]]4      t ! ER6 ER7]]4      t ! ER8 ER9]]4      t ! ER: ER;]]4      t ! ER< ER=]]4      t ! ER> ER?]#4      t ! ER@ ERA]#4      t ! ERB ERC]#4      t ! ERD ERE]/4      t]#3t1]! ERF]1/ 4      t ! ERG ERH]4      t ! ERI ERJ]4      t ! ERK ERL]4      t ! ERM ERN]4      t ! ERO ERP]4      t ! ERQ ERR]4      t ! ERS ERT]4      t ! ERU ERV]4      t ! ERW ERX]4      t ! ERY ERZ]4      t ! ER[ ER\]4      t ! ER] ER^]4      t ! ER_ ER`]4      t ! ERa ERb]4      t ! ERc ERd]4      t ! ERe ERf]4      t ! ERg ERh]4      t ! ERi ERj]4      t ! ERk ERl]4      t] ! ERm ERn]#4      4       t ! ERo ERp]4      t ! ERq ERr]4      t ! ERs ERt]4      t ! ERu ERv]4      t ! ERw ERx]4      t ! ERy ERz]4      t ! ER{ ER|]4      t ! ER} ER~]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t ! ER ER]4      t] ! ER ER]#4      4       t ! ER ER]#4      t ! ER ER]#4      t ! ER ER]#4      t ! ER ER]#4      t ! ER ER]#4      t ! ER ER]#4      t ! ER ER]#4      t ! ER ER]#4      Et  ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et	 ! ER ER]#4      Et
 ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et ! ER ER]#4      Et] ! ER ER]#4      4       Et ! ER ER]4      Et ! ER ER]#4      EtER EtE]ER8X  dc   E]! ]
EP*                  4      ^8  d6   ]
EP*                  ^,          ER8X  d   ]! ]4       ]
EP,                  ! ^ 4       ]EP.                  ! 4        R# R# (      N)StrEnum)captured_stderrforce_not_colorizedforce_not_colorized_test_class)import_helper)	os_helper)script_helper)TestTranslationsBaseupdate_translation_snapshots)mockc                   @   a a ] tR t^$t oRtRV 3R lltR tRtVtV ;t	# )StdIOBufferzReplacement for writable io.StringIO that behaves more like real file

Unlike StringIO, provides a buffer attribute that holds the underlying
binary data, allowing it to replace sys.stdout/sys.stderr in more
contexts.
c                   < VP                  R 4      p\        SV `	  \        P                  ! \        P
                  ! V4      4      R VR7       R# )utf-8)newlineN)encodesuper__init__ioBufferedWriterBytesIO)selfinitial_valuer   	__class__s   &&&)/usr/lib/python3.14/test/test_argparse.pyr   StdIOBuffer.__init__,   s@    %,,W5**2::m+DE ' 	 	3    c                    V P                  4        V P                  P                  P                  4       P	                  R 4      # )r   )flushbufferrawgetvaluedecoder   s   &r   r"   StdIOBuffer.getvalue1   s-    

{{'')0099r    ) 
)
__name__
__module____qualname____firstlineno____doc__r   r"   __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   r   r   $   s     3
: :r   r   c                   ,   a  ] tR t^6t o R tR tRtV tR# )StdStreamTestc           	     @   \         P                  ! 4       p\        P                  ! R 4      ;_uu_ 4        \        P
                  ! R4      ;_uu_ 4        VP                  ^ RR7       R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; i)Nargparse._sys.exitfoo)statusmessage)argparseArgumentParser
contextlibredirect_stderrr   patchexitr   parsers   & r   test_skip_invalid_stderr&StdStreamTest.test_skip_invalid_stderr8   sa    ((*&&t,,JJ+,,KKq%K0 - -,,, -,,s#   BA9	'B9B	BB	c                &   \         P                  ! 4       pVP                  VP                  \        P
                  ! VP                  R .4      3 F  pV P                  VR7      ;_uu_ 4        \        P                  ! R4      ;_uu_ 4        \        4       ;_uu_ 4       p\        P                  ! V4      ;_uu_ 4        \        P                  ! R4      ;_uu_ 4        V! 4        V P                  VP                  4       R4       RRR4       RRR4       RRR4       RRR4       RRR4       K  	  R#   + '       g   i     L6; i  + '       g   i     LA; i  + '       g   i     LL; i  + '       g   i     LW; i  + '       g   i     EKA  ; i)-h)funcNr6   zusage:)r:   r;   print_usage
print_help	functoolspartial
parse_argssubTestr<   redirect_stdoutr   r=   r   r>   assertRegexr"   )r   rA   rF   mocked_stderrs   &   r   test_skip_invalid_stdout&StdStreamTest.test_skip_invalid_stdout@   s    ((*f//$8
D $''**400**=99

/00  !7!7!99E 1 :  1 ('
 10 :9  10 (''sl   ,E>E+E=E(D2EEE+E>2E=EEEE(#E++E;6E>>Fr&   N)r)   r*   r+   r,   rB   rP   r.   r/   r2   s   @r   r4   r4   6   s     1F Fr   r4   c                   &   a  ] tR t^St o R tRtV tR# )TestCasec                X    V P                  \        P                  ! 4       4      pR VR&   R# )80COLUMNSN)enterContextr   EnvironmentVarGuardr   envs   & r   setUpTestCase.setUpU   s&     	 = = ?@Ir   r&   N)r)   r*   r+   r,   r\   r.   r/   rR   s   @r   rT   rT   S   s      r   rT   c                   8   a  ] tR t^]t o R tR tR tR tRtV t	R# )TempDirMixinc                    \         P                  ! 4       V n        \        P                  ! 4       V n        \        P                  ! V P                  4       R # N)tempfilemkdtemptemp_dirosgetcwdold_dirchdirr$   s   &r   r\   TempDirMixin.setUp`   s/     ((*yy{
r   c                   \         P                  ! V P                  4       \         P                  ! V P                  R R7       F\  w  rpV FP  p\         P
                  ! \         P                  P                  V P                  V4      \        P                  4       KR  	  K^  	  \        P                  ! V P                  R4       R# )F)topdownTN)re   rh   rg   walkrd   chmodpathjoinstatS_IWRITEshutilrmtree)r   rootdirsfilesnames   &    r   tearDownTempDirMixin.tearDowne   st    
!#!FDdmmT:DMMJ  "G 	dmmT*r   c                    \         P                  P                  V P                  V4      p\	        VR RR7      ;_uu_ 4       pVP                  V4       RRR4       V#   + '       g   i     T# ; i)wr   encodingN)re   rn   ro   rd   openwrite)r   filename	file_pathfiles   &&  r   create_writable_file!TempDirMixin.create_writable_filel   sQ    GGLL9	)S733tJJx  4 43s   AA.	c                n    \         P                  ! V P                  V4      \        P                  4       R # ra   )re   rm   r   rp   S_IREAD)r   r   s   &&r   create_readonly_file!TempDirMixin.create_readonly_filer   s    
**84dllCr   )rg   rd   N)
r)   r*   r+   r,   r\   rx   r   r   r.   r/   rR   s   @r   r_   r_   ]   s       
+D Dr   r_   c                   &   a  ] tR t^ut o R tRtV tR# )Sigc                    Wn         W n        R # ra   argskwargsr   r   r   s   &*,r   r   Sig.__init__w   s    	r   r   Nr)   r*   r+   r,   r   r.   r/   rR   s   @r   r   r   u   s      r   r   c                   2   a  ] tR t^|t o R tR tR tRtV tR# )NSc                <    V P                   P                  V4       R # ra   )__dict__update)r   r   s   &,r   r   NS.__init__~   s    V$r   c                    \        V P                  P                  4       4      pR P                  V Uu. uF  pRV,          NK  	  up4      p\	        V 4      P
                  : RV: R2# u upi ), z%s=%r())sortedr   itemsro   typer)   )r   sorted_itemstup	kwarg_strs   &   r   __repr__NS.__repr__   sW    dmm1134IIEw}}EF	:..	:: Fs   A)c                0    \        V 4      \        V4      8H  # ra   )varsr   others   &&r   __eq__	NS.__eq__   s    DzT%[((r   r&   N)	r)   r*   r+   r,   r   r   r   r.   r/   rR   s   @r   r   r   |   s     %;
) )r   r   c                   *   a  ] tR t^t o RR ltRtV tR# )ArgumentParserErrorNc                b    \         P                  WW#4       Wn        W n        W0n        W@n        R # ra   )	Exceptionr   r9   stdoutstderr
error_code)r   r9   r   r   r   s   &&&&&r   r   ArgumentParserError.__init__   s&    4&9$r   )r   r9   r   r   )NNNr   rR   s   @r   r   r      s     % %r   r   c           
      :   \        \        P                  \        4      '       g%   \        \        P                  \        4      '       d	   V ! V/ VB # \        P                  p\        P                  p\        4       \        n        \        4       \        n          V ! V/ VB p\        \        V4      4       F  p\        WV4      pV\        P                  J d   \        WVV4       K0  V\        P                  P                  J d   \        WV\        VR \        4      4       Kk  V\        P                  J d   \        WVV4       K  V\        P                  P                  J g   K  \        WV\        VR \        4      4       K  	  VV\        n        V\        n        #   \         d\   pTP                  p	\        P                  P                  4       p
\        P                  P                  4       p\        RYT	4      RhRp?ii ; i  T\        n        T\        n        i ; i)r    
SystemExitN)
isinstancesysr   r   r   listr   getattrsetattrr    BIN_STDOUT_SENTINELBIN_STDERR_SENTINELr   coder"   r   )rK   r   r   
old_stdout
old_stderrresultkeyattrer   r   r   s   &*,         r   stderr_to_parser_errorr      s    #**k**j[.Q.Q4*6** JJCJCJ 	>00FDL)v+3::%F4SZZ...FXGZ)[\SZZ'F4SZZ...FXGZ)[\ *   

  	>66DZZ((*FZZ((*F%fd49=>		>  

s,   CF " F G?$AG::G??H Hc                   J   a a ] tR t^t oV 3R ltV 3R ltV 3R ltRtVtV ;t	# )ErrorRaisingArgumentParserc                >   < \         \        V `
  p\        V.VO5/ VB # ra   )r   r   rK   r   )r   r   r   rK   r   s   &*, r   rK   %ErrorRaisingArgumentParser.parse_args   s%    5tG
%jB4B6BBr   c                >   < \         \        V `
  p\        V.VO5/ VB # ra   )r   r   r?   r   )r   r   r   r?   r   s   &*, r   r?   ErrorRaisingArgumentParser.exit   s%    /;%d<T<V<<r   c                >   < \         \        V `
  p\        V.VO5/ VB # ra   )r   r   errorr   )r   r   r   r   r   s   &*, r   r    ErrorRaisingArgumentParser.error   s%    0$=%e=d=f==r   r&   )
r)   r*   r+   r,   rK   r?   r   r.   r/   r0   r1   s   @@r   r   r      s     C=> >r   r   c                   *   a  ] tR t^t o RtR tRtV tR# )ParserTesterMetaclassaQ  Adds parser tests using the class attributes.

Classes of this type should specify the following attributes:

argument_signatures -- a list of Sig objects which specify
    the signatures of Argument objects to be created
failures -- a list of args lists that should cause the parser
    to fail
successes -- a list of (initial_args, options, remaining_args) tuples
    where initial_args specifies the string args to be parsed,
    options is a dict that should match the vars() of the options
    parsed out of initial_args, and remaining_args should be any
    remaining unparsed arguments
c                   VR 8X  d   R# \        V R4      '       g   \        4       V n        \        V R4      '       g   \        V n        R pR pR pR pR p ! R	 R
\
        4      p	WEV3 F  p
Wx3 F  pV	! W
V4       K  	  K  	  R# )ParserTestCaseNparser_signatureparser_classc                d    V F)  pV P                   ! VP                  / VP                  B  K+  	  R# )z(Add all arguments directly to the parserN)add_argumentr   r   )rA   argument_signaturessigs   && r   	no_groups1ParserTesterMetaclass.__init__.<locals>.no_groups   s'    *##SXX<< +r   c                    V P                  R4      pV F)  pVP                  ! VP                  / VP                  B  K+  	  R# )z4Add all arguments under a single group in the parserr7   N)add_argument_groupr   r   r   )rA   r   groupr   s   &&  r   	one_group1ParserTesterMetaclass.__init__.<locals>.one_group   s7    --e4E*""CHH;

; +r   c                    \        V4       FC  w  r#V P                  RV,          4      pVP                  ! VP                  / VP                  B  KE  	  R# )z0Add each argument in its own group to the parserzfoo:%iN)	enumerater   r   r   r   )rA   r   ir   r   s   &&   r   many_groups3ParserTesterMetaclass.__init__.<locals>.many_groups   sC    #$7811(Q,?""CHH;

; 9r   c                $    V P                  V4      # )z#Parse the args by passing in a list)rK   )rA   r   s   &&r   listargs0ParserTesterMetaclass.__init__.<locals>.listargs   s    $$T**r   c                    \         P                  pV^ ,          .V,           \         n         V P                  4       V\         n        #   T\         n        i ; i)z(Parse the args by defaulting to sys.argv)r   argvrK   )rA   r   old_sys_argvs   && r   sysargs/ParserTesterMetaclass.__init__.<locals>.sysargs   s>    88L$Q(4/CH(((*'<s   A Ac                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )0ParserTesterMetaclass.__init__.<locals>.AddTestsi	  c                J   W n         W0n        V P                   P                  pV P                  P                  pV P                  V P                  3 F=  pVP                  pWtV3pR P                  V4      p	V3R lp
 Wn        \        WV
4       K?  	  R#   \         d     Li ; i)_c                     V! V 4       R # ra   r&   r   	test_funcs   &&r   wrapperJParserTesterMetaclass.__init__.<locals>.AddTests.__init__.<locals>.wrapper  	    !$r   N)_add_arguments_parse_argsr)   test_failurestest_successesro   	TypeErrorr   )r   
tester_clsadd_argumentsrK   add_arguments_nameparse_args_namer   	func_namenames	test_namer   s   &&&&       r   r   9ParserTesterMetaclass.__init__.<locals>.AddTests.__init__  s    &3##- %)%8%8%A%A""&"2"2";";"&"4"4d6I6I!JI ) 2 2I%?JE #I09 (+4( J7; "K % s   <BB"!B"c                    VP                   P                  pVP                   P                  pVP                  ! V/ VB pV P	                  WAP
                  4       V# ra   )r   r   r   r   r   r   )r   testerr   r   rA   s   &&   r   _get_parser<ParserTesterMetaclass.__init__.<locals>.AddTests._get_parser  sR    ..330077,,d=f=##F,F,FGr   c           
     t   V P                  V4      pVP                   Fo  pVP                  4       pVP                  VR 7      ;_uu_ 4        VP	                  \
        VR7      ;_uu_ 4        VP                  V4       RRR4       RRR4       Kq  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)r   )msgN)r  failuressplitrL   assertRaisesr   rK   )r   r  rA   args_strr   s   &&   r   r   >ParserTesterMetaclass.__init__.<locals>.AddTests.test_failures%  s    ))&1 &H#>>+DT22#001D$0OO"--d3 P 32 !0 PO 322s$    B&+B=B&B#B&&B7c                P   V P                  V4      pVP                   Fp  w  r4\        V\        4      '       d   VP	                  4       pVP                  VR 7      ;_uu_ 4        V P                  W#4      pVP                  WE4       RRR4       Kr  	  R#   + '       g   i     K  ; i)r  N)r  	successesr   strr	  rL   r   assertEqual)r   r  rA   r   expected_ns	result_nss   &&    r   r   ?ParserTesterMetaclass.__init__.<locals>.AddTests.test_successes-  s    ))&1)/)9)9%D!$,,#zz|T22$($4$4V$B	**;B 32 *: 322s   ##BB%)r   r   N)
r)   r*   r+   r,   r   r  r   r   r.   r/   rR   s   @r   AddTestsr   	  s      <&4C Cr   r  )hasattrr   r   r   r   object)clsrw   basesbodydictr   r   r   r   r   r  r   rK   s   &&&&        r   r   ParserTesterMetaclass.__init__   s    ## s.//#&5C sN++9C
	=
	<	<	+	(+	Cv +	C^ (K@M'1
Z8 2 Ar   r&   N)r)   r*   r+   r,   r-   r   r.   r/   rR   s   @r   r   r      s     a9 a9r   r   r   c            	           ] tR tRtRt]! R4      .t. ROtR]! RR7      3R]! RR7      3R	]! RR7      3R
]! RR7      3R]! RR7      3.t	Rt
R# )TestOptionalsSingleDashiC  1Test an Optional with a single-dash option string-xar'   Nx-x a-xaz-x -1-1z-x-1r&   )r  r  --foo-x --fooz-x -yr)   r*   r+   r,   r-   r   r   r  r   r  r.   r&   r   r   r  r  C  sY    ;t9+8H	R$Z	c	S		"t*	dIr   r  c                   ~   ] tR tRtRt]! RRR7      ]! RR^*R7      ]! R	4      .t. ROtR]! RRRR7      3R]! RRRR7      3R]! RRR
R7      3R]! RRR
R7      3R]! RRR
R7      3R]! RRR
R7      3R]! RRR
R7      3R]! RRR
R7      3R]! R^*RR7      3R]! R^*RR7      3R]! R^*R
R7      3R]! R^*R
R7      3.t	Rt
R# )TestOptionalsSingleDashCombinediQ  r  r  
store_trueactionz-yyystore_constr,  const-zr  r'   FN)r!  yyyzT-za-z az-xzaz-xz az-x -zaz-x -z a-yz-x -yyy -zaz-x -yyy -z ar&   )r  r%  r#  r&  z-x -zz-z -xz-yxz-yz az-yyyxz-yyyzaz-xyzaz-x=r'  r&   r   r   r)  r)  Q  s	   ; 	D&F=3D	
CH 
R%TT*+	rDdd+,	U,-	e-.	d,-	"t-.	2$#./	B43/0	rErT*+	et,-	TrS12	dc23Ir   r)  c            	           ] tR tRtRt]! R4      .t. ROtR]! RR7      3R]! RR7      3R	]! R
R7      3R]! RR7      3R]! RR7      3.t	Rt
R# )TestOptionalsSingleDashLongik  zATest an Optional with a multi-character single-dash option string-foor  r'   Nr7   z-foo az-foo -1r$  z-fo a-f ar&   )r8  r  r%  z
-foo --fooz-foo -y-fooar'  r&   r   r   r7  r7  k  sY    Kv;-GH	RD\	2#;	B4L!	"+	Ir   r7  c                       ] tR tRtRt]! R4      ]! R4      ]! R4      .t. ROtR]! RRRR7      3R	]! R
RRR7      3R]! R
RRR7      3R]! RRRR7      3R]! RRRR7      3R]! RR
RR7      3R]! RRR
R7      3.t	Rt
R# )&TestOptionalsSingleDashSubsetAmbiguousiy  z=Test Optionals where option strings are subsets of each other-f-foobar-foorabr'   N)ffoobarfoorabr:  r  -fa-foaoar;  ooa	-foobar a	-foorab ar&   )r>  r8  -fo-foo bz-foobz-foobaz-foorar'  r&   r   r   r=  r=  y  s    Gt9c)nc)nEKH	R$tD12	c$t45	Sd34	d456	"uT$78	b4D9:	b4S9:Ir   r=  c                   d   ] tR tRtRt]! R4      ]! R4      .t. ROtR]! RRR7      3R]! R	RR7      3R
]! R	RR7      3R]! RR	R7      3R]! RR	R7      3R]! R	RR7      3R]! R	RR7      3R]! RR	R7      3R]! RR	R7      3R]! R	RR7      3R]! R	RR7      3R]! RR	R7      3R]! RR	R7      3.t	Rt
R# ) TestOptionalsSingleDashAmbiguousi  z7Test Optionals that partially match but are not subsetsr?  r@  r'   N)rB  rC  z-foob ar  z-foob=az-foor az-foor=az-fooba az-fooba=az-foora az-foora=arH  z	-foobar=arI  z	-foorab=ar&   )	r>  r:  rD  rE  r8  rJ  rK  z-f=az-foo=br'  r&   r   r   rM  rM    s    Ay>3y>:"H 
RtD)*	Bc$/0	Bc$/0	Bd3/0	Bd3/0	Rs401	Rs401	RtC01	RtC01	bD12	bD12	bS12	bS12Ir   rM  c                       ] tR tRtRt]! RRR7      .t. ROtR]! RR	7      3R
]! RR	7      3R]! RR	7      3R]! RR	7      3.t	Rt
R# )TestOptionalsNumerici  z(Test an Optional with a short opt stringr$  onedestr  r'   N)rP  z-1 az-1az-1-2-2r&   )r$  r  z-1 --fooz-1 -yz-1 -1z-1 -2r'  r&   r   r   rO  rO    sQ    2t%01AH	RD\		s		Ir   rO  c            	           ] tR tRtRt]! R4      .t. ROtR]! RR7      3R]! RR7      3R	]! RR7      3R
]! RR7      3R]! RR7      3.t	Rt
R# )TestOptionalsDoubleDashi  z1Test an Optional with a double-dash option stringr%  r  r'   Nr9  z--foo az--foo=az
--foo -2.5z-2.5z
--foo=-2.5r&   )r%  r>  r:  r  z--foo -xz--foo --barr'  r&   r   r   rU  rU    sY    ;w<.FH	RD\	B3K 	B3K 	rf~&	rf~&Ir   rU  c                       ] tR tRtRt]! RRR7      ]! R4      .t. ROtR]! RR	R
7      3R]! RRR
7      3R]! RR	R
7      3R]! RR	R
7      3R]! RR	R
7      3R]! RR	R
7      3.t	Rt
R	# )#TestOptionalsDoubleDashPartialMatchi  z7Tests partial matching with a double-dash option string--badgerr*  r+  z--batr'   FN)badgerbatz--bat XX--badT--badg--badger&   )--bar--b--ba--b=2z--ba=4	--badge 5r'  r&   r   r   rW  rW    s    A 	J|,G HH	Ru$'(	Be-.	"Dd+,	2Tt,-	Bd-.	Rt./Ir   rW  c                       ] tR tRtRt]! RRR7      ]! R4      .t. ROtR]! RR	R
7      3R]! RRR
7      3R]! RRR
7      3R]! RR	R
7      3R]! RR	R
7      3R]! RR	R
7      3R]! RR	R
7      3.t	Rt
R	# )"TestOptionalsDoubleDashPrefixMatchi  z?Tests when one double-dash option string is a prefix of anotherrX  r*  r+  ra  r'   FN)rY  baz--ba Xr[  z--ba=Xr\  Tr]  r^  r&   )r_  r`  ra  rb  rc  r'  r&   r   r   re  re    s    I 	J|,F >H	Ru&'	2Us+,	2Us+,	"DT*+	2Td+,	Bdt,-	Rt-.Ir   re  c                       ] tR tRtRt]! RRR7      ]! R4      ]! RR^*R	7      .t. ROtR]! RRRR7      3R]! RRRR7      3R]! RR
RR7      3R]! RR
RR7      3R]! RR^*R7      3R]! RR^*R7      3.t	Rt
R# )TestOptionalsSingleDoubleDashi  z<Test an Optional with single- and double-dash option stringsr>  r*  r+  r_  -bazr-  r.  Br'   FNrA  barbazTz--ba Bz
-f --bar Bz-f -bz-ba -fr&   )r_  -fbarz-fbazz-bazf-b Brj  r'  r&   r   r   rh  rh    s    F 	D&GF=3
 AH	R%Tt,-	rDd-.	23D12	rDct45	"t2./	2$B/0Ir   rh  c                      ] tR tRtRt]! RRR7      t]! RRR7      ]! R	4      ]! R
R^*R7      .t. ROtR]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3R]	! RR^*R7      3R]	! RR^*R7      3.t
RtR# )!TestOptionalsAlternatePrefixCharsi  z9Test an Optional with option strings with custom prefixes+:/Fprefix_charsadd_help+fr*  r+  ::bar/bazr-  r.  rj  r'   Nrk  T::ba B
+f ::bar B+f /b/ba +fr&   )r_  rn  ro  rj  r>  --bar Bri  rE   --helpz+hz::helpz/helpr)   r*   r+   r,   r-   r   r   r   r  r   r  r.   r&   r   r   rq  rq    s    C>D&GF=3
 qH	R%Tt,-	rDd-.	23D12	rDct45	"t2./	2$B/0Ir   rq  c                      ] tR tRtRt]! RRR7      t]! RRR7      ]! R	4      ]! R
R^*R7      .t. ROtR]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3R]	! RR^*R7      3R]	! RR^*R7      3.t
RtR# )*TestOptionalsAlternatePrefixCharsAddedHelpi  zWhen ``-`` not in prefix_chars, default operators created for help
should use the prefix_chars in use rather than - or --
http://bugs.python.org/issue9444rr  Trs  rv  r*  r+  rw  rx  r-  r.  rj  r'   FNrk  ry  rz  r{  r|  r&   )r_  rn  ro  rj  r>  r}  ri  r  r&   r   r   r  r    s    + =D&GF=3
 HH	R%Tt,-	rDd-.	23D12	rDct45	"t2./	2$B/0Ir   r  c            
           ] tR tRtRt]! RRR7      t]! RRR7      ]! R	RR7      ]! R
RR7      .t. ROtR]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3.t
RtR# )2TestOptionalsAlternatePrefixCharsMultipleShortArgsi  z@Verify that Optionals must be called with their defined prefixesz+-Frs  r  r*  r+  z+yz+zr'   r!  yr2  Tz+y -xz+yz -xr&   N)-wz-xyzz+xr5  z+xyzr  r&   r   r   r  r    s    Ju=D&D&D&
H 
R%5E*+	rDEU+,	"ttu-.	2-.	Ir   r  c            	           ] tR tRtRt]! RRRRRR7      .t. ROtR	]! R
R7      3R]! RR7      3R]! RR7      3R]! RR7      3R]! RR7      3.t	Rt
R# )TestOptionalsShortLongi4  z<Test a combination of single- and double-dash option strings-v	--verbose-nz--noisyr*  r+  r'   F)verboseTr&   N)z--x --verbosez-Nr  z-v xr'  r&   r   r   r  r  4  sn    F 	D+tY|D 4H	R	r$ 	b&'	r$ 	Bt$%Ir   r  c            	           ] tR tRtRt]! R4      ]! RRR7      .tR.tR]! R	R
R7      3R]! R
RR7      3R]! RRR7      3R]! RRR7      3.t	Rt
R
# )TestOptionalsDestiD  z*Tests various means of setting destinationz	--foo-bar--bazzabbazrQ  r  z--foo-bar frA  N)foo_barr  z--baz ggz--foo-bar h --baz ihr   z--baz j --foo-bar kkjr&   r'  r&   r   r   r  r  D  sf    4{+Sx-HIuH	3t45	BtC01	3s ;<	3s ;<	Ir   r  c                       ] tR tRtRt]! R4      ]! R^*R7      .tR.tR]! R^*R	7      3R
]! R^*R	7      3R]! RRR	7      3.t	Rt
R# )TestOptionalsDefaultiQ  z*Tests specifying a default for an Optionalr  r5  defaultr  r'   Nr!  r  z-xxr!  z-yyr  r&   r'  r&   r   r   r  r  Q  sU    4t9c$&;<uH	R$"	SB 	TS!"Ir   r  c                   `    ] tR tRtRt]! R4      .tRR.tR]! RR7      3R]! RR7      3.t	R	t
R# )
TestOptionalsNargsDefaulti]  z7Tests not specifying the number of args for an Optionalr  r  r'   Nr   r"  r&   r'  r&   r   r   r  r  ]  s9    At9+T{H	R$Z	cIr   r  c                   f    ] tR tRtRt]! R^R7      .tRR.tR]! RR7      3R	]! R.R7      3.t	R
t
R# )TestOptionalsNargs1ih  z&Tests specifying 1 arg for an Optionalr  nargsr  r'   Nr   r"  r&   r'  r&   r   r   r  r  h  s?    0t1-.T{H	R$Z	seIr   r  c                   h    ] tR tRtRt]! R^R7      .t. R
OtR]! RR7      3R]! . ROR7      3.t	R	t
R# )TestOptionalsNargs3is  z'Tests specifying 3 args for an Optionalr  r  r'   Nr   z-x a b cr&   )r  r  r"  -x a ba -xa -x br  bcr'  r&   r   r   r  r  s  s:    1t1-.>H	R$Z	R/*+Ir   r  c                   l   ] tR tRtRt]! RRR7      ]! RR^*R7      ]! RRR	R
7      ]! RR]RR^^.R7      .t. ROtR]	! RRR	^TR7      3R]	! RRR	^TR7      3R]	! RRR	^TR7      3R]	! R^*R	^TR7      3R]	! RRR	^TR7      3R]	! RRR^TR7      3R]	! RRR^TR7      3R]	! RRR	^*R7      3R]	! RRR	^R7      3.	t
RtR# )TestOptionalsNargsOptionali~  z0Tests specifying an Optional arg for an Optionalr  ?r  r  )r  r/  r5  spamr  r  r0  4284)r  r   r/  r  choices2r'   Nr{   r!  r  r2  z-w 2z-x 2z-y 2z-z 2r&   )r  r4  z-z 42z-z 84r)   r*   r+   r,   r-   r   intr   r  r   r  r.   r&   r   r   r  r  ~  s    : 	DD2&DV,D#T4!QP	 /H	R$$&B/0	rDDFb12	cTVr23	rDB&B/0	dcVr23	rDDDB/0	ddcR01	rDDFb12	ddf23
Ir   r  c                       ] tR tRtRt]! RRR7      ]! RRRR7      .tR	.tR
]! RRR7      3R]! . RR7      3R]! R	.RR7      3R]! R	R.RR7      3R]! R. R7      3R]! RR	.R7      3R]! RR	R.R7      3.t	Rt
R# )TestOptionalsNargsZeroOrMorei  ?Tests specifying args for an Optional that accepts zero or morer  *r  r5  r  r  r  r'   Nr  r"  r  r  -y a-y a br&   r'  r&   r   r   r  r    s    I 	DDV, uH	R$&!"	rB&!"	sev&'	2c
f-.	rDB 	dse$%	2c
+,Ir   r  c            
           ] tR tRtRt]! RRR7      ]! RRRR7      .t. ROtR
]! RRR7      3R]! R	.RR7      3R]! R	R.RR7      3R]! RR	.R7      3R]! RR	R.R7      3.t	Rt
R# )TestOptionalsNargsOneOrMorei  z>Tests specifying args for an Optional that accepts one or morer  +r  r5  r  r  r  r'   Nr  r"  r  r  r  r  r&   )r  r  r5  r  za -y br'  r&   r   r   r  r    s    H 	DDV, 3H	R$&!"	sev&'	2c
f-.	dse$%	2c
+,Ir   r  c                       ] tR tRtRt]! RRR7      ]! R]]! ^4      R7      .t. ROt	R	]
! R
R
R7      3R]
! RR
R7      3R]
! RR
R7      3R]
! R
^ R7      3R]
! R
^R7      3R]
! R^R7      3.tRtR
# )TestOptionalsChoicesi  z,Tests specifying the choices for an Optionalr>  abcr  z-gr   r  r  r'   N)rA  r  r:  z-f cr  z-g 0z-g 03z-fb -g4r  r&   )r  z-f dz-f abz-fadz-gaz-g 6r)   r*   r+   r,   r-   r   r  ranger   r  r   r  r.   r&   r   r   r  r    s    6 	D% DsE!H-/ =H	R$$ 	cT"#	cT"#	da!	"tq/"	BN#Ir   r  c                   f    ] tR tRtRt]! R]RR7      .tRR.tR]	! ^R	7      3R
]	! ^*R	7      3.t
RtR# )TestOptionalsRequiredi  z)Tests an optional action that is requiredr  Tr   requiredr  r'   -x 1r   z-x42r&   Nr  r&   r   r   r  r    sE    3 	DsT* RyH	a	bIr   r  c                   d    ] tR tRtRt]! RRR7      .tRR.tR]! R	R
7      3R]! RR
7      3.t	Rt
R	# )TestOptionalsActionStorei  z&Tests the store action for an Optionalr  storer+  r  r  r'   Nr   z-xfoor7   r&   r'  r&   r   r   r  r    s=    0tG45V}H	R$Z	"u+Ir   r  c                   d    ] tR tRtRt]! RR]R7      .tR.tR]	! RR	7      3R]	! ]R	7      3.t
R
tR# )TestOptionalsActionStoreConsti  z,Tests the store_const action for an Optionalr5  r-  r.  r  r'   Nr  r&   )r)   r*   r+   r,   r-   r   r  r   r  r   r  r.   r&   r   r   r  r    s=    6tMHIuH	R$Z	rF|Ir   r  c                   d    ] tR tRtRt]! RRR7      .t. ROtR]! RR7      3R]! R	R7      3.t	R
t
R# )TestOptionalsActionStoreFalsei  z,Tests the store_false action for an Optionalr0  store_falser+  r'   T)r2  Fr&   N)r  r3  r4  r'  r&   r   r   r  r    s9    6tM:;#H	R$Z	rE{Ir   r  c                   d    ] tR tRtRt]! RRR7      .t. ROtR]! RR7      3R]! R	R7      3.t	R
t
R# )TestOptionalsActionStoreTruei  z+Tests the store_true action for an Optionalz--appler*  r+  r'   F)appleTr&   N)r  z	--apple=bz	--apple br'  r&   r   r   r  r    s9    5y>?.H	Re_	BTN#Ir   r  c            	          a  ] tR tRt o Rt]! R]P                  R7      .tRR.t	R]
! RR	7      3R]
! R
R	7      3R]
! RR	7      3R]
! RR	7      3R]
! R
R	7      3.tR tR tRtV tR# )TestBooleanOptionalActioni  zTests BooleanOptionalActionr%  r+  	--foo bar	--foo=barr'   Nr9  T--no-fooFz--foo --no-fooz--no-foo --fooc                0   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       pVP	                  R R\         P
                  R7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r%  Tr/  r,  Nz*got an unexpected keyword argument 'const')	r:   r;   r
  r   r   BooleanOptionalActionassertInr  	exceptionr   rA   cms   &  r   
test_const$TestBooleanOptionalAction.test_const  sf    ((*y))RtH<Z<Z[ * 	BCDUV *)s   #BB	c                .   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       pVP	                  R \         P
                  R7       RRR4       V P                  \        XP                  4      R4       R#   + '       g   i     L7; i)r  r+  Nz8invalid option name '--no-foo' for BooleanOptionalAction)	r:   r;   r
  
ValueErrorr   r  r  r  r  r  s   &  r   test_invalid_name+TestBooleanOptionalAction.test_invalid_name  sg    ((*z**b
83Q3QR +R\\*S	U +*s   "BB	r&   )r)   r*   r+   r,   r-   r   r:   r  r   r  r   r  r  r  r.   r/   rR   s   @r   r  r    s}     %wx/M/MNO[)H	RD\	",	RE]#	2%=)	2$<(IWU Ur   r  c                   x    ] tR tRtRt]! RR]P                  R7      .tR.t	R]
! RR7      3R]
! R	R7      3.tR
tR# )!TestBooleanOptionalActionRequiredi  z$Tests BooleanOptionalAction requiredr%  T)r  r,  r'   r9  r  Fr&   N)r)   r*   r+   r,   r-   r   r:   r  r   r  r   r  r.   r&   r   r   r  r    sI    . 	Gd8+I+IJ tH	",	RE]#Ir   r  c                   ~    ] tR tRtRt]! RRR7      .t. ROtR]! RR	7      3R
]! R.R	7      3R]! RR.R	7      3.t	Rt
R# )TestOptionalsActionAppendi*  'Tests the append action for an Optionalr  appendr+  r  r'   Nrm  --baz a--baz a --baz br  r&   r  r  a --baz	--baz a br'  r&   r   r   r  r  *  sL    1wx895H	RD\	BC5M"	BC:./Ir   r  c                       ] tR tRtRt]! RRR.R7      .t. ROtR]! R.R	7      3R
]! RR.R	7      3R]! . ROR	7      3.t	Rt
R# )$TestOptionalsActionAppendWithDefaulti6  r  r  r  r[  r,  r  r  r'   r  r  r  r&   Nr  )r[  r  r  r'  r&   r   r   r  r  6  sQ    1wx#GH5H	RSE]	BC:&'	B?34Ir   r  c                       ] tR tRtRt]! RRR7      ]! RRR7      ]! RRR7      ]! R	RR7      .t. ROtR
]! RRRRR7      3R]! R.RRRR7      3R]! RR.RRR7      3R]! RRRRR7      3R	]! RRRRR7      3.t	Rt
R# )!TestConstActionsMissingConstKwargiB  z=Tests that const gets default value of None when not providedr>  append_constr+  r%  -br-  r_  r'   N)rA  r7   r  rl  r&   )z-f vr  r  r'  r&   r   r   r  r  B  s    G 	D(GN+D'GM*	 2H	R$DDd34	rTF$78	"t$4T:;	rDdd56	"t489Ir   r  c            	           ] tR tRtRt]! RR]R7      ]! RRRR	7      .t. ROtR
]	! RR7      3R]	! ].R7      3R]	! ]R]R.R7      3.t
RtR# )TestOptionalsActionAppendConstiU  -Tests the append_const action for an Optionalr  r  r.  -cr  r  r,  rR  r'   Nr  -b -cx -b -cyzr!  yzr&   r  r  za -cz-bxz-b xr)   r*   r+   r,   r-   r   r   r   r  r   r  r.   r&   r   r   r  r  U  sf    7 	Dy9D, 2H	R$Z	rYK !	2CD ABCIr   r  c            
           ] tR tRtRt]! RR]R.R7      ]! RRR	R
7      .t. ROtR]	! R.R7      3R]	! R].R7      3R]	! R]R]R.R7      3.t
RtR# ))TestOptionalsActionAppendConstWithDefaultid  r  r  r  r[  )r,  r/  r  r  r  r  r  r'   r   r  r!  r  r&   Nr  r  r&   r   r   r  r  d  sq    7 	Dy3%HD, 2H	R3%[	rS)$%&	2ii FGHIr   r  c                   d    ] tR tRtRt]! RRR7      .t. R
OtR]! RR7      3R]! ^R7      3.t	R	t
R# )TestOptionalsActionCountis  z&Tests the count action for an Optionalr  countr+  r'   Nr   r&   )r  r"  z-x bz	-x a -x br'  r&   r   r   r  r  s  s8    0tG451H	R$Z	rAwIr   r  c                       ] tR tRtRt]! R4      ]! R4      ]! RRR7      .tRR	.tR
]! RRRR7      3R]! RRRR7      3R]! RRRR7      3R]! RRRR7      3R]! RRRR7      3R]! RRRR7      3.t	Rt
R# )"TestOptionalsAllowLongAbbreviationi~  z2Allow long options to be abbreviated unambiguouslyr%  --foobaz--foobler*  r+  z--foob 5--foobr'   NF)r7   foobazfooblez--foo 77z--foo=7z	--fooba ar  z	--fooba=az--foobl --foo gr  Tr&   r'  r&   r   r   r  r  ~  s    < 	GJJ|,
 H%H	RDe45	B3tE:;	B3tE:;	bT#e<=	bT#e<=	B3tDABIr   r  c            	           ] tR tRtRt]! RR7      t]! R4      ]! RRR7      ]! R	4      .t. ROtR
]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3.t
RtR# )%TestOptionalsDisallowLongAbbreviationi  1Do not allow abbreviations of long options at allFallow_abbrevr%  --foodler*  r+  --foonlyr'   Nr7   foodlefoonlyz--foo 33z--foonly 7 --foodle --foo 2r  Tr  r&   )-foon 3z--foon 3--foodz--food --foo 2r  r&   r   r   r  r    sr    ;.GJ|,J
 CH	RDt45	B3uT:;	&s4(LMIr   r  c            	           ] tR tRtRt]! RRR7      t]! R4      ]! RRR	7      ]! R
4      .t. ROtR]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3.t
RtR# )0TestOptionalsDisallowLongAbbreviationPrefixCharsi  zBDisallowing abbreviations works with alternative prefix charactersr  Frt  r  ++fooz++foodler*  r+  z++foonlyr'   Nr  z++foo 3r  z++foonly 7 ++foodle ++foo 2r  Tr  r&   )z+foon 3z++foon 3z++foodz++food ++foo 2r  r&   r   r   r   r     st    L%@GJ|,J
 CH	RDt45	B3uT:;	&s4(LMIr   r   c            	           ] tR tRtRt]! RR7      t]! R4      ]! RRR7      ]! R	4      .t. ROtR
]	! RRRR7      3R]	! RRRR7      3R]	! RRRR7      3.t
RtR# )/TestOptionalsDisallowSingleDashLongAbbreviationi  r  Fr  r8  z-foodler*  r+  z-foonlyr'   Nr  z-foo 3r  z-foonly 7 -foodle -foo 2r  Tr  r&   )r  z-foodz-food -foo 2r  r&   r   r   r$  r$    sq    ;.FIl+I
 4H	RDt45	2#eD9:	#RCS%IJIr   r$  c                       ] tR tRtRt]! RR7      t]! R4      ]! RRR7      .tRR	.tR
]	! RRR7      3R]	! RRR7      3R]	! RRR7      3R]	! R^R7      3R]	! R^R7      3R]	! R^R7      3.t
RtR# )/TestDisallowLongAbbreviationAllowsShortGroupingi  r  Fr  z-rr  r	  r+  z-c -rr'   Nrr  z-rar  z-rccccz-ccz-cc -raz-ccrccr&   r  r&   r   r   r&  r&    s    ;.D	D! gH	R$$ 	SD!"	dd#$	TQ 	BN#	2?#Ir   r&  c                       ] tR tRtRt]! RRR7      t]! R4      ]! RRR	7      .tRR
.tR]	! RRR7      3R]	! RRR7      3R]	! RRR7      3R]	! R^R7      3R]	! R^R7      3R]	! R^R7      3.t
RtR# )5TestDisallowLongAbbreviationAllowsShortGroupingPrefixi  zEShort option grouping works with custom prefix and allow_abbrev=Falser  Fr!  z+rz+cr	  r+  z+c +rr'   Nr'  z+rar  z+rccr)  z+ccz+cc +raz+ccrccr&   r  r&   r   r   r+  r+    s    O%@D	D! gH	R$$ 	SD!"	dd#$	TQ 	BN#	2?#Ir   r+  c                   R   a  ] tR tRt o  ! R R]4      tR t]R 4       tR t	Rt
V tR# )	TestStrEnumChoicesi  c                   "    ] tR tRtRtRtRtRtR# )TestStrEnumChoices.Colori  redgreenbluer&   N)r)   r*   r+   r,   REDGREENBLUEr.   r&   r   r   Colorr/    s    r   r6  c                    \         P                  ! 4       pVP                  R V P                  R7       VP	                  R R.4      pV P                  VP                  V P                  P                  4       R# )--colorr  r0  N)r:   r;   r   r6  rK   r  colorr3  r   rA   r   s   &  r   test_parse_enum_value(TestStrEnumChoices.test_parse_enum_value  sX    ((*Itzz:  )U!34TZZ^^4r   c                    \         P                  ! 4       pVP                  R V P                  RR7       V P	                  RVP                  4       4       V P	                  RVP                  4       4       R# )r8  zChoose a colorr  helpz[--color {red,green,blue}]z  --color {red,green,blue}N)r:   r;   r   r6  r  format_usageformat_helpr@   s   & r   'test_help_message_contains_enum_choices:TestStrEnumChoices.test_help_message_contains_enum_choices  sZ    ((*Itzz@PQ2F4G4G4IJ2F4F4F4HIr   c                    \         P                  ! R R7      pVP                  RV P                  R7       V P	                  \         P
                  RVP                  RR.4       R# )Fexit_on_errorr8  r  z9invalid choice: 'yellow' \(choose from red, green, blue\)yellowN)r:   r;   r   r6  assertRaisesRegexArgumentErrorrK   r@   s   & r   $test_invalid_enum_value_raises_error7TestStrEnumChoices.test_invalid_enum_value_raises_error  sT    ((u=Itzz:""H!		
r   r&   N)r)   r*   r+   r,   r   r6  r;  r   rB  rJ  r.   r/   rR   s   @r   r-  r-    s6      
5 J J
 
r   r-  c                   L    ] tR tRtRt]! R4      .t. ROtR]! RR7      3.t	Rt
R# )	TestPositionalsNargsNonei  z,Test a Positional that doesn't specify nargsr7   r  r9  r&   Nr'   r  a br'  r&   r   r   rM  rM    s)    6u:, H	bSkIr   rM  c                   R    ] tR tRtRt]! R^R7      .t. R	OtR]! R.R7      3.t	Rt
R# )
TestPositionalsNargs1i  z.Test a Positional that specifies an nargs of 1r7   r  r  r9  r&   NrN  r'  r&   r   r   rQ  rQ    s/    8uA./ H	bcUmIr   rQ  c                   T    ] tR tRtRt]! R^R7      .t. ROtR]! RR.R7      3.t	R	t
R
# )TestPositionalsNargs2i  z.Test a Positional that specifies an nargs of 2r7   r  r  rO  r  r9  r&   N)r'   r  r  a b cr'  r&   r   r   rS  rS    s2    8uA./'H	Sz"#Ir   rS  c                   |    ] tR tRtRt]! RRR7      .tR.tR]! . R7      3R	]! R	.R7      3R
]! R	R.R7      3.t	Rt
R# )TestPositionalsNargsZeroOrMorei)  z0Test a Positional that specifies unlimited nargsr7   r  r  r  r'   r9  r  rO  r  r&   Nr'  r&   r   r   rV  rV  )  sN    :uC01vH	RBZ	bcUm	Sz"#Ir   rV  c                       ] tR tRtRt]! RRRRR.R7      .t. ROtR	]! RR
7      3R]! R.R
7      3R]! RR.R
7      3.t	Rt
R# )%TestPositionalsNargsZeroOrMoreDefaulti5  z>Test a Positional that specifies unlimited nargs and a defaultr7   r  rl  r  r  r  r  r  r'   r9  rO  r&   N)r  rl  za cr'  r&   r   r   rX  rX  5  sT    HuCc
ST#H	RE]	bcUm	Sz"#Ir   rX  c                   j    ] tR tRtRt]! RRR7      .tRR.tR]! R.R	7      3R
]! RR.R	7      3.t	Rt
R# )TestPositionalsNargsOneOrMoreiA  z2Test a Positional that specifies one or more nargsr7   r  r  r'   r  r  r9  rO  r  r&   Nr'  r&   r   r   r[  r[  A  sD    <uC01DzH	bcUm	Sz"#Ir   r[  c                   d    ] tR tRtRt]! RRR7      .tRR.tR]! R	R
7      3R]! RR
7      3.t	Rt
R	# )TestPositionalsNargsOptionaliL  zTests an Optional Positionalr7   r  r  r  rO  r'   Nr9  r  r&   r'  r&   r   r   r]  r]  L  s=    &uC01e}H	RD\	bSkIr   r]  c                   l    ] tR tRtRt]! RR^*RR.R7      .t. ROtR]! ^*R	7      3R]! RR	7      3.t	R
t
R# )#TestPositionalsNargsOptionalDefaultiW  z1Tests an Optional Positional with a default valuer7   r  r  r  rY  r'   r9  r&   N)r  rO  r  r'  r&   r   r   r_  r_  W  sA    ;uCc3ZPQ"H	RBZ	bSkIr   r_  c                   n    ] tR tRtRt]! RR]R^^.R7      .t. ROtR]	! ^*R7      3R	]	! ^R7      3.t
R
tR# ),TestPositionalsNargsOptionalConvertedDefaultib  zfTests an Optional Positional with a default value
that needs to be converted to the appropriate type.
r7   r  r  )r  r   r  r  r'   r9  1r&   N)r  rO  1 2r  r  r&   r   r   ra  ra  b  sK    
 	E3q!fE *H	RBZ	bQiIr   ra  c                   \    ] tR tRtRt]! R4      ]! R4      .t. ROtR]! RRR7      3.t	R	t
R
# )TestPositionalsNargsNoneNoneiq  z-Test two Positionals that don't specify nargsr7   rl  r  rO  r  r7   rl  r&   N)r'   r  r  rT  r'  r&   r   r   re  re  q  s3    7u:s5z2'H	s$%Ir   re  c                   b    ] tR tRtRt]! R4      ]! R^R7      .t. ROtR]! RR.R	7      3.t	R
t
R# )TestPositionalsNargsNone1i{  z6Test a Positional with no nargs followed by one with 1r7   rl  r  r  rO  r  rf  r&   N)r'   r%  r  rT  r'  r&   r   r   rh  rh  {  s8    @u:s5':;*H	s&'Ir   rh  c                   d    ] tR tRtRt]! R^R7      ]! R4      .t. ROtR]! RR.R	R
7      3.t	Rt
R# )TestPositionalsNargs2Nonei  z8Test a Positional with 2 nargs followed by one with noner7   r  rl  r  rT  r  r  rf  r&   Nr'   r%  r  rO  a b c dr'  r&   r   r   rj  rj    s:    BuA.E
;3H	"#s-.Ir   rj  c                   x   ] tR tRtRt]! R4      ]! R4      ]! RRR7      .t. ROtR]! R	R. R
7      3R]! R	RR.R
7      3R]! R	RRR.R
7      3R]! RR. R
7      3R]! RR. R
7      3R]! RRR.R
7      3R]! RRR.R
7      3R]! RRR.R
7      3R]! RRRR.R
7      3R]! RRRR.R
7      3R]! RRRR.R
7      3.t	Rt
R	# )"TestPositionalsNargsNoneZeroOrMorei  z>Test a Positional with no nargs followed by one with unlimitedr  r7   rl  r  r  r  Nr!  r7   rl  rO  r  rT  r  -x X ar[  a -x X-x X a ba -x X ba b -x X
-x X a b c
a -x X b c
a b c -x Xr&   )r'   r%  
a b -x X cr'  r&   r   r   rn  rn    s    Ht9c%j#e32GH*H	b4Sb)*	Ts./	"t3*56	2"-.	2"-.	R#3SE23	R#3SE23	R#3SE23	rCSsCj9:	rCSsCj9:	rCSsCj9:Ir   rn  c                   0   ] tR tRtRt]! R4      ]! R4      ]! RRR7      .t. ROtR	]! R
RR.R7      3R]! R
RRR.R7      3R]! RRR.R7      3R]! RRR.R7      3R]! RRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3.t	Rt
R
# )!TestPositionalsNargsNoneOneOrMorei  z@Test a Positional with no nargs followed by one with one or morer  r7   rl  r  r  r  rO  Nr  ro  rT  r  rr  r[  rs  rt  ru  rv  rw  r&   r'   r%  r  rx  r'  r&   r   r   rz  rz    s    Jt9c%j#e32GH/H	Ts./	"t3*56	R#3SE23	R#3SE23	R#3SE23	rCSsCj9:	rCSsCj9:	rCSsCj9:	Ir   rz  c                       ] tR tRtRt]! R4      ]! R4      ]! RRR7      .t. ROtR]! R	RR	R
7      3R]! R	RRR
7      3R]! RRR	R
7      3R]! RRR	R
7      3R]! RRRR
7      3R]! RRRR
7      3R]! RRRR
7      3.t	Rt
R	# ) TestPositionalsNargsNoneOptionali  z@Test a Positional with no nargs followed by one with an Optionalr  r7   rl  r  r  r  Nro  rO  r  rp  r[  rq  rr  rs  rt  r&   r'   r%  rT  r'  r&   r   r   r}  r}    s    Jt9c%j#e32GH%H	b4Sd+,	Ts,-	2$/0	2$/0	R#3C01	R#3C01	R#3C01Ir   r}  c                   B   ] tR tRtRt]! R4      ]! RRR7      ]! R4      .t. ROtR]! R	. RR
7      3R]! R	R.RR
7      3R]! R	RR.RR
7      3R]! R. RR
7      3R]! R. RR
7      3R]! RR.RR
7      3R]! RR.RR
7      3R]! RRR.RR
7      3R]! RRR.RR
7      3.	t	Rt
R	# )"TestPositionalsNargsZeroOrMoreNonei  z@Test a Positional with unlimited nargs followed by one with noner  r7   r  r  rl  r  Nro  rO  r  rT  r  rp  r[  rq  rr  rt  ru  rw  r&   )r'   r%  rs  rv  rx  r'  r&   r   r   r  r    s    Jt9c%s&;SZHDH	b4RS)*	Tu#./	"t#s56	2-.	2-.	R#C5c23	R#C5c23	rCc3ZS9:	rCc3ZS9:
Ir   r  c                      ] tR tRtRt]! R4      ]! RRR7      ]! R4      .t. ROtR	]! R
R.RR7      3R]! R
RR.RR7      3R]! RR.RR7      3R]! RR.RR7      3R]! RR.RR7      3R]! RRR.RR7      3R]! RRR.RR7      3.t	Rt
R
# )!TestPositionalsNargsOneOrMoreNonei  zBTest a Positional with one or more nargs followed by one with noner  r7   r  r  rl  r  rO  Nr  ro  rT  r  rr  r[  rs  rt  ru  rw  r&   )r'   r%  r  rv  rx  r'  r&   r   r   r  r    s    Lt9c%s&;SZH=H	Tu#./	"t#s56	R#C5c23	R#C5c23	R#C5c23	rCc3ZS9:	rCc3ZS9:Ir   r  c                   x    ] tR tRtRt]! RR^*R7      ]! R4      .t. ROtR]! ^*RR7      3R	]! RR
R7      3.t	Rt
R# ) TestPositionalsNargsOptionalNonei  zBTest a Positional with an Optional nargs followed by one with noner7   r  r  rl  r  rf  rO  r  r&   Nr~  r'  r&   r   r   r  r    sG    LuC<c%jI%H	bRS!"	s$%Ir   r  c                       ] tR tRtRt]! R^R7      ]! RRR7      .t. ROtR]! RR	.. R
7      3R]! RR	.R.R
7      3.t	Rt
R# )TestPositionalsNargs2ZeroOrMorei  z=Test a Positional with 2 nargs followed by one with unlimitedr7   r  rl  r  r  rO  r  rf  rT  r  r&   Nr'   r%  r  r'  r&   r   r   r  r    sR    GuA.E0EF!H	Szr*+	"#s#/0Ir   r  c                   j    ] tR tRtRt]! R^R7      ]! RRR7      .t. ROtR]! RR	.R
.R7      3.t	Rt
R# )TestPositionalsNargs2OneOrMorei  z?Test a Positional with 2 nargs followed by one with one or morer7   r  rl  r  r  rT  r  r  rf  r&   N)r'   r%  r  rO  r'  r&   r   r   r  r    s?    IuA.E0EF(H	"#s#/0Ir   r  c                       ] tR tRtRt]! R^R7      ]! RRR7      .t. ROtR]! RR	.R
R7      3R]! RR	.RR7      3.t	Rt
R
# )TestPositionalsNargs2Optionali  z7Test a Positional with 2 nargs followed by one optionalr7   r  rl  r  r  rO  r  Nrf  rT  r  r&   )r'   r%  r  rl  r'  r&   r   r   r  r    sP    AuA.E0EF,H	Szt,-	"#s-.Ir   r  c                       ] tR tRtRt]! RRR7      ]! R^R7      .tRR.tR	]! . R	.R
7      3R]! R	.R.R
7      3R]! R	R.R.R
7      3.t	Rt
R# )TestPositionalsNargsZeroOrMore1i  z=Test a Positional with unlimited nargs followed by one with 1r7   r  r  rl  r'   r%  r  rf  rO  r  rT  r  r&   Nr'  r&   r   r   r  r    sg    GuC0#e12EFGH	bRcU#$	u3%()	"#s#/0Ir   r  c                       ] tR tRtRt]! RRR7      ]! R^R7      .t. ROtR]! R.R	.R
7      3R]! RR	.R.R
7      3.t	Rt
R# )TestPositionalsNargsOneOrMore1i  z?Test a Positional with one or more nargs followed by one with 1r7   r  r  rl  r  rO  r  rf  rT  r  r&   Nr  r'  r&   r   r   r  r    sR    IuC0#e12EF!H	u3%()	"#s#/0Ir   r  c                   ~    ] tR tRtRt]! RRR7      ]! R^R7      .t. ROtR]! RR.R	7      3R
]! RR.R	7      3.t	Rt
R# )TestPositionalsNargsOptional1i(  z?Test a Positional with an Optional nargs followed by one with 1r7   r  r  rl  r  Nrf  rO  r  r&   r~  r'  r&   r   r   r  r  (  sL    IuC0#e12EF%H	bTu%&	s&'Ir   r  c                   R   ] tR tRtRt]! R4      ]! R4      ]! RRR7      ]! R^R7      .t. ROtR
]! RR	. R.R7      3R]! RR	R.R.R7      3R]! RR	. R.R7      3R]! RR	. R.R7      3R]! RR	. R.R7      3R]! RR	R.R.R7      3R]! RR	R.R.R7      3R]! RR	R.R.R7      3.t	Rt
R# )#TestPositionalsNargsNoneZeroOrMore1i3  z=Test three Positionals: no nargs, unlimited nargs and 1 nargsr  r7   rl  r  r  rm  r  rO  Nr  r!  r7   rl  rm  rT  r  rr  r[  rs  rt  ru  rv  rw  r&   r{  r'  r&   r   r   r  r  3  s    G 	D	E
EE	 0H	Ts67	"t3%cU;<	R#3BSE:;	R#3BSE:;	R#3BSE:;	rCSse#?@	rCSse#?@	rCSse#?@	Ir   r  c                      ] tR tRtRt]! R4      ]! R4      ]! RRR7      ]! R^R7      .t. ROtR]! RR	R
.R.R7      3R]! RR	R
R.R.R7      3R]! RR	R
.R.R7      3R]! RR	R
.R.R7      3R]! RR	R
.R.R7      3R]! RR	R
.R.R7      3R]! RR	R
R.R.R7      3R]! RR	R
R.R.R7      3R]! RR	R
R.R.R7      3.	t	Rt
R# )"TestPositionalsNargsNoneOneOrMore1iI  z?Test three Positionals: no nargs, one or more nargs and 1 nargsr  r7   rl  r  r  rm  r  r  rT  Nr  r  rl  dru  r[  rv  rx  rw  z-x X a b c dza -x X b c dza b c d -x Xr&   )r'   r%  r  r  za b -x X c dza b c -x X dr'  r&   r   r   r  r  I  s   I 	D	E
EE	 GH	"t3%cU;<	B3S#JSEBC	rCSse#?@	rCSse#?@	rCSse#?@	rCSse#?@	csc
FG	csc
FG	csc
FG
Ir   r  c                   L   ] tR tRtRt]! R4      ]! R4      ]! RRRR7      ]! R	^R
7      .t. ROtR]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3R]! RRRR.R7      3.t	Rt
R# )!TestPositionalsNargsNoneOptional1i`  z;Test three Positionals: no nargs, optional narg and 1 nargsr  r7   rl  r        ?r  rm  r  r  rO  Nr  r  rT  r  rr  r[  rs  rt  ru  rv  rw  r&   r{  r'  r&   r   r   r  r  `  s    E 	D	E
Ee,E	 0H	TsC59:	"t#C59:	R#3Eu=>	R#3Eu=>	R#3Eu=>	rCScu=>	rCScu=>	rCScu=>	Ir   r  c                       ] tR tRtRt]! RRR7      ]! RR^*R7      .tRR	.tR
]! R^*R7      3R]! R^*R7      3R]! RRR7      3.t	Rt
R# )$TestPositionalsNargsOptionalOptionaliv  zTest two optional nargsr7   r  r  rl  r  r%  rT  r'   Nrf  r  rO  r  r&   r'  r&   r   r   r  r  v  se    ! 	EEb) !H	RDb!"	bSb!"	s$%Ir   r  c            	           ] tR tRtRt]! RRR7      ]! RRR7      .tR.tR	]! R
. R7      3R]! R. R7      3R]! RR.R7      3R]! RRR.R7      3.t	Rt
R
# )&TestPositionalsNargsOptionalZeroOrMorei  z1Test an Optional narg followed by unlimited nargsr7   r  r  rl  r  r%  r'   Nrf  r  rO  r  rT  r  r&   r'  r&   r   r   r  r    sn    ;uC0#e32GHyH	RDb!"	bSb!"	s&'	"3*-.	Ir   r  c                       ] tR tRtRt]! RRR7      ]! RRR7      .tRR	.tR
]! RR
.R7      3R]! R
R.R7      3R]! R
RR.R7      3.t	Rt
R# )%TestPositionalsNargsOptionalOneOrMorei  z3Test an Optional narg followed by one or more nargsr7   r  r  rl  r  r'   r%  r  Nrf  rO  r  rT  r  r&   r'  r&   r   r   r  r    sc    =uC0#e32GHG}H	bTu%&	s&'	"3*-.Ir   r  c                   p    ] tR tRtRt]! R]! R4      R7      .t. ROtR]	! RR7      3R]	! RR7      3.t
R	tR
# )TestPositionalsChoicesStringi  z&Test a set of single-character choicesr  abcdefgr  r  r  r  r&   Nr'   r%  r  r  ef)r)   r*   r+   r,   r-   r   setr   r  r   r  r.   r&   r   r   r  r    s=    0vs9~>?-H	bcl	bclIr   r  c                   r    ] tR tRtRt]! R]]! ^4      R7      .t. R
Ot	R]
! ^R7      3R]
! ^R7      3.tRtR	# )TestPositionalsChoicesInti  zTest a set of integer choicesr  r  4r  15r&   Nr  r  r&   r   r   r  r    s?    'vCrCD-H	baj	rr{Ir   r  c                   l    ] tR tRtRt]! RRR7      ]! RR^R7      .t. ROtR]! RR	R
..R7      3.t	Rt
R# )TestPositionalsActionAppendi  zTest the 'append' actionr  r  r+  r,  r  r  rT  r  r  r  r&   Nrk  r'  r&   r   r   r  r    sI    " 	F8$F81- 4H	"3c
+,-Ir   r  c                   h    ] tR tRtRt]! RRR7      ]! RR^R7      .t. ROtR]! . ROR7      3.t	R	t
R
# )TestPositionalsActionExtendi  zTest the 'extend' actionr  extendr+  r  rT  r  r&   Nrk  r  r'  r&   r   r   r  r    s@    " 	F8$F81- 4H	"/*+Ir   r  c            	           ] tR tRtRt]! RRR7      ]! RRRR	7      .tR
R.tR]! RRR7      3R]! RRR7      3R]! RRR7      3R]! RRR7      3.t	Rt
R# )"TestOptionalsNumericAndPositionalsi  z;Tests negative number args when numeric options are presentr!  r  r  z-4r  r*  rR  r,  rS  z-315r'   NFr  r  Tz-4 ar&   r'  r&   r   r   r  r    ss    E 	CsDs<0 f~H	R$% !	b3% !	rDD!"	cT"#	Ir   r  c            
           ] tR tRtRt]! RRR7      ]! RRRR	7      .tR
.tR]! RRR7      3R]! RRR7      3R]! RRR7      3R]! RRR7      3R]! RRR7      3.t	Rt
R# )(TestOptionalsAlmostNumericAndPositionalsi  zBTests negative number args when almost numeric options are presentr!  r  r  z-k4r  r*  r  z-k3r'   NFr  rS  r  Tz-k4 ar&   r'  r&   r   r   r  r    s    L 	CsEL1 wH	R$% !	rDE"#	b3% !	TT"#	"sd#$Ir   r  c                       ] tR tRt]! RRRR7      ]! R4      .tR.tR]! R	R
..RR7      3R]! R
..R	R7      3R]! R	R
..RR7      3.tRt	R# )!TestOptionalsAndPositionalsAppendi  r7   r  r  r  r,  r_  r8  rO  r  r  Nrf  	--bar a ba b --bar cr  r&   
r)   r*   r+   r,   r   r   r  r   r  r.   r&   r   r   r  r    sj    EX.G xH	c
|./	bseW#./	c
|56Ir   r  c                       ] tR tRt]! RRRR7      ]! R4      .tR.tR]! R	R
.RR7      3R]! R
.R	R7      3R]! R	R
.RR7      3.tRt	R# )!TestOptionalsAndPositionalsExtendi  r7   r  r  r  r_  r8  rO  r  r  Nrf  r  r  r  r&   r  r&   r   r   r  r    sd    EX.G xH	Szt,-	bcU,-	Szs34Ir   r  c                      ] tR tRt]! RRR7      ]! RRRR7      .tR.tR	.]! R	R
R7      3R.]! RR
R7      3R.]! RR
R7      3RR	.]! R
R	R7      3RR.]! R
RR7      3RR.]! R
RR7      3R.]! R
RR7      3R.]! R
RR7      3.tRt	R
# )$TestEmptyAndSpaceContainingArgumentsi  r!  r  r  r5  z--yyyr  rQ  r'   Nr  za badgerz	-a badgerz--yyy=a badgerz--yyy=-a badgerr&   r  r&   r   r   r  r    s     	CsD'$ vH
rB$ 
rJ$/0
[D12
R$"%&

	R$*56
	b4;78
	R$*56
	b4;78	Ir   r  c                      ] tR tRt]! RR7      t]! RRRRR7      ]! R	R
]^*R7      ]! RRRR7      .tRR.tR]	! R^*RR7      3R]	! R^*RR7      3R]	! R^*RR7      3R]	! RRRR7      3R]	! R^*RR7      3R]	! R^*RR7      3.t
RtR# ) TestPrefixCharacterOnlyArgumentsi  -+rt  -r!  r  rY  )rR  r  r/  r  r  )rR  r   r  z-+-r2  r*  r  r5  z+ -r'   NFr  z- Xr[  z+ -3Tz- ===z===r&   )r)   r*   r+   r,   r   r   r  r   r  r   r  r.   r&   r   r   r  r    s    -CcH5CcR0EL1
 e}H	R$"&'	b8rU+,	SB%()	dbE*+	TR4()	"ue,-Ir   r  c                       ] tR tRtRt]! RRR7      ]! RRR7      .t. tR]! R. R	7      3R]! . . R	7      3R
]! R.. R	7      3R]! R.R.R	7      3R]! RR.R	7      3R]! . R.R	7      3R]! R.R.R	7      3.t	Rt
R# )TestNargsZeroOrMorei2  r  r  r  r  r  r'   Nr  r"  r  z	-x a -- br  r  r  r&   r'  r&   r   r   r  r  2  s    It3/S1DEH	R$"	rB"~	ser"#	bC5SE*+	b4C5!"	bSE"#	2#'(Ir   r  c                      ] tR tRtRt]! R4      ]! RRR7      ]! R4      .t. ROtR]! R. R	R
7      3R]! R. RR
7      3R]! RRR.RR
7      3R]! R. ROR	R
7      3R]! R. ROR	R
7      3R]! R. ROR	R
7      3R]! RRR.R	R
7      3.t	Rt
R	# )TestNargsRemainderiB  z2Tests specifying a positional with nargs=REMAINDERr!  r  ...r  r0  r[  Nr  z-z Z XZz
-z Z X A BArj  z
X -z Z A Bz
X A -z Z B
X A B -z Zz	X Y --fooYr%  r&   )r'   r0  z-z Z)r0  r  r  rj  )r  r0  r  rj  )r  rj  r0  r  r'  r&   r   r   r  r  B  s    <s8SE%:CIF!H	b3"%&	2rS)*	rCC:56	rC#8DAB	rC#8DAB	rC#8DAB	b33.D9:Ir   r  c                   v   ] tR tRtRt]! R]R7      ]! R]RR7      ]! RR	R
7      .t. ROtR]	! RR. R7      3R]	! RR. R7      3R]	! RRR.R7      3R]	! RR. R7      3R]	! RR. R7      3R]	! RR. R7      3R]	! RRR.R7      3R]	! RRR.R7      3R]	! RRR.R7      3R]	! RRR.R7      3R]	! RRR.R7      3.t
RtR# )TestOptionLikeiR  z.Tests options that may or may not be argumentsr  r   z-3r  )r   rR  r2  r  r  r'   Nr  z-x 2.5      @z-x 2.5 ar  z-3.5      ?z-3-.5z-3 .5za -3.5za -x 1g      ?z-x 1 az-3 1 ar&   )r  z-y2.5r#  z-x -az-x -3z-x -3.5z-3 -3.5z-x -2.5z	-x -2.5 az-3 -.5za x -1z-x -1 az-3 -1 a      )r)   r*   r+   r,   r-   r   floatr   r  r   r  r.   r&   r   r   r  r  R  s   8 	DuDu3'Cs
0H
 
R$$"%&	2tr*+	R##/0	dcR()	"ttr*+	"tsb)*	2u-.	b44C5)*	2tu-.	2tu-.	2u-.Ir   r  c                      ] tR tRtRt]! RR]]P                  R7      ]! RR]]P                  R7      ]! RR	]P                  R
7      ]! RR]]P                  R7      ]! RR]]P                  R7      .t	. ROt
R]! 4       3R]! ^R7      3R]! ^^.R7      3R]! RR7      3R]! ^RR7      3R]! ^^.RR7      3R]! RR7      3R]! ^R7      3R]! . R7      3R]! ^^.R7      3.
tRtR# )TestDefaultSuppressim  z%Test actions with suppressed defaultsr7   r  r  r   r  rl  r  r  r*  r  z--qux--quuxr'   rb  r9  rc  rf  Tr  z1 --bazr7   rm  z	--baz 1 2r7   rl  rm  N)quxz--qux 1)quuxz
--quux 1 2r&   )r  r  z1 a)r)   r*   r+   r,   r-   r   r  r:   SUPPRESSr   r  r   r  r.   r&   r   r   r  r  m  s   / 	E30A0ABE30A0ABGL(2C2CDG3S(2C2CDHCc83D3DE "H	RT
	bQi	qqc"#	",	B1$'(	bQQCT23	",	B1I	22;	r1v'Ir   r  c                      ] tR tRtRt]! ]P                  R7      t]! RRR7      ]! RRR7      ]! R	R
R7      .t	R.t
R]! 4       3R]! RR7      3R]! RR.R7      3R	]! RR7      3R]! RRR7      3R]! RR.RR7      3.tRtR# )TestParserDefaultSuppressi  z4Test actions with a parser-level default of SUPPRESSargument_defaultr7   r  r  rl  r  r  r*  r+  r  r'   r  r9  rO  r  rf  Tr  r  r  r  r  r&   N)r)   r*   r+   r,   r-   r   r:   r  r   r   r  r   r  r.   r&   r   r   r  r    s    >H,=,=>EEGL)
 vH	RT
	bSk	s&'	",	B3D)*	bSse67Ir   r  c                   $   ] tR tRtRt]! ^*R7      t]! RRRR7      ]! RR	R
7      ]! RRR
7      ]! RRR7      .tR.tR]	! ^*^*^*^*R7      3R]	! R^*^*^*R7      3R]	! RR.^*^*R7      3R]	! ^*^*R^*R7      3R]	! R^*R^*R7      3R]	! RR.R^*R7      3.t
RtR# )TestParserDefault42i  z.Test actions with a parser-level default of 42r  	--versionversion1.0r,  r  r7   r  r  rl  r  r  r*  r+  r  r'   )r7   rl  rm  r  r  rO  r  Tr  r  r&   Nr  r&   r   r   r  r    s    8B/K	59EEGL)	 vH	RBBB34	bSbb"56	s2r:;	"r:;	B3BD"=>	bSserBCIr   r  c                   D  a a ] tR tRt oRtV 3R lt]! RR7      t]! R4      ]! R4      ]! RR	R
7      .t. ROt	R]
P                  ,           tR]! RRR.R7      3R]! RRRR.R7      3R]! R]R.R7      3R]! RR].R7      3R]! R]RR.R7      3R]! RR]R.R7      3. R O]! RRR.R7      3.t]
P                  '       dY   ]
P                  P!                  R4      t]P&                  ! ]4      t]R]! R]R.R7      3R]! RR].R7      3.,          tRtVtV ;t# RtRtVtV ;t# )!TestArgumentsFromFilei  "Test reading arguments from a filec                F  < \         \        V `  4        R \        P                  ! V P
                  4      R,           3RRRV P                  R,           3.pV F3  w  r#\        VR4      ;_uu_ 4       pVP                  V4       RRR4       K5  	  R#   + '       g   i     KJ  ; i)hello   
undecodablewbN)	recursives   -a
A
@hello)invalids   @no-such-path
)	r   r  r\   re   fsencoder  r  r~   r   r   
file_textsrn   textr   r   s   &    r   r\   TestArgumentsFromFile.setUp  s    #T02bkk$**-56% ,D,,u45

 %JDdD!!T

4  "! %!!!s   /BB @fromfile_prefix_chars-ar!  r  r  r  r'   r[  zhello world!zX YNr  )r  r!  r  z
X -a A Y Zr  r  @hello XzX @helloz-a B @recursive Y ZzX @recursive Z -a Brj     @z@undecodable XzX @undecodabler   r&   )r'   r  r[  z@invalidz@missing)r  r'   r[  r  )r)   r*   r+   r,   r-   r\   r   r   r   r  r   FS_NONASCIIr  r   r  TESTFN_UNDECODABLElstripr  re   fsdecodedecoded_undecodabler.   r/   r0   r1   s   @@r   r  r    sY    ,! 5D	CCs
 7HY222E	TSSE*+	rC33*56	R$%C512	R$#%12	SEc3Z @A	SCE3< @A	rB##78I ###2299$? kk+6rD,?C5IJrDC4G3HIJ
 	
		
 r   r  c                      a a ] tR tRt oRtV 3R lt ! R R]4      t]t]	! RR7      t
]	! RR	R
7      .t. tR]! . ROR7      3.tRtVtV ;t# )TestArgumentsFromFileConverteri  r  c                   < \         \        V `  4        R.pV F3  w  r#\        VR4      ;_uu_ 4       pVP	                  V4       RRR4       K5  	  R#   + '       g   i     KJ  ; i)r  r  N)r  s   hello world!
)r   r  r\   r~   r   r  s   &    r   r\   $TestArgumentsFromFileConverter.setUp  sV    ,d9;(

 %JDdD!!T

4  "! %!!!s   AA#c                   &   a  ] tR tRt o R tRtV tR# )>TestArgumentsFromFileConverter.FromFileConverterArgumentParseri  c              #  t   "   VP                  4        F  pVP                  4       '       g   K  Vx  K!  	  R # 5ira   )r	  strip)r   arg_lineargs   && r   convert_arg_line_to_argsWTestArgumentsFromFileConverter.FromFileConverterArgumentParser.convert_arg_line_to_args  s)     ~~'yy{{	 (s   68r&   N)r)   r*   r+   r,   r  r.   r/   rR   s   @r   FromFileConverterArgumentParserr	    s     	 	r   r  r  r  r  r  r  r  r  r&   )r  zworld!r[  )r)   r*   r+   r,   r-   r\   r   r  r   r   r   r   r  r   r  r.   r/   r0   r1   s   @@r   r  r    s\     ,!*D  3L5Cs H	R234IIr   r  c                      \         P                  ! 4       ;_uu_ 4        \         P                  ! R R\        \        4       \
        P                  ! V / VB uuRRR4       #   + '       g   i     R# ; i)ignoreFileType is deprecatedN)warningscatch_warningsfilterwarningsPendingDeprecationWarningr)   r:   FileTyper   s   *,r   r  r    sL    		 	 	"	"*B 98	E  $1&1 
#	"	"	"s   7A  A1	c                   &   a  ] tR tRt o R tRtV tR# )TestFileTypeDeprecationi  c                ,   V P                  \        4      ;_uu_ 4       p\        P                  ! 4        R R R 4       V P	                  R\        XP                  4      4       V P                  VP                  \        4       R #   + '       g   i     LW; i)Nr  )
assertWarnsr  r:   r  r  r  warningr  r   __file__)r   r  s   & r   testTestFileTypeDeprecation.test  s[    788B 9.BJJ@h/ 98s   BB	r&   N)r)   r*   r+   r,   r  r.   r/   rR   s   @r   r  r    s     0 0r   r  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestFileTypeRepri  c                R    \        R 4      pV P                  R\        V4      4       R# )r(  zFileType('r')Nr  r  reprr   r   s   & r   test_rTestFileTypeRepr.test_r  s    }$t*5r   c                T    \        R ^4      pV P                  R\        V4      4       R# )r  zFileType('wb', 1)Nr$  r&  s   & r   	test_wb_1TestFileTypeRepr.test_wb_1  s#    a ,d4j9r   c                V    \        R RR7      pV P                  R\        V4      4       R# )r(  latin_1r|   z!FileType('r', encoding='latin_1')Nr$  r&  s   & r   test_r_latinTestFileTypeRepr.test_r_latin  s#    i0<d4jIr   c                X    \        R RRR7      pV P                  R\        V4      4       R# )r{   big5r  )r}   errorsz/FileType('w', encoding='big5', errors='ignore')Nr$  r&  s   & r   test_w_big5_ignore#TestFileTypeRepr.test_w_big5_ignore  s(    fX>Jd	%r   c                X    \        R ^RR7      pV P                  R\        V4      4       R# )r(  replacer2  z"FileType('r', 1, errors='replace')Nr$  r&  s   & r   test_r_1_replace!TestFileTypeRepr.test_r_1_replace!  s%    Qy1=tDzJr   r&   N)r)   r*   r+   r,   r'  r*  r.  r3  r8  r.   r/   rR   s   @r   r"  r"    s&     6:J%
K Kr   r"  c                   ,   a  ] tR tRt o R tR tRtV tR# )StdStreamCompareri*  c                    \         P                  ! V4      V n        VR 8X  d   \        V n        R# VR8X  d   \
        V n        R# \        4       V n        R# )stdout.bufferstderr.bufferN)operator
attrgetterr   r   
backupattrr   r  )r   r   s   &&r   r   StdStreamComparer.__init__+  s=      **40?"1DO_$1DO$hDOr   c                p     WP                  \        4      8H  #   \         d    YP                  8H  u # i ; ira   )r   r   AttributeErrorrA  r   s   &&r   r   StdStreamComparer.__eq__9  s5    	,LL--- 	,OO++	,s    55)rA  r   Nr)   r*   r+   r,   r   r   r.   r/   rR   s   @r   r;  r;  *  s     ', ,r   r;  stdinr   r   zstdin.bufferr=  r>  c                   0   a  ] tR tRt o / tR tR tRtV tR# )RFileiH  c                    Wn         R # ra   rw   r   rw   s   &&r   r   RFile.__init__K      	r   c                H   WP                   9   d   V P                   V,          pM.VP                  4       ;q P                   V&   VP                  4        \        V\        4      '       g   VP                  R 4      pV P                  VP                  u;8H  ;'       d    V8H  # u # )ascii)seenreadcloser   r  r#   rw   r   r   r  s   && r   r   RFile.__eq__N  sv    II99U#D&+jjl2D99U#KKM$$$;;w'DyyEJJ..$....r   rK  N)	r)   r*   r+   r,   rQ  r   r   r.   r/   rR   s   @r   rI  rI  H  s     D/ /r   rI  c                   6  a a ] tR tRt oRtV 3R lt]! R]! 4       R7      ]! R]! R4      R7      .t. ROt	R]
! R	]! R4      R
7      3R]
! ]! R4      ]! R4      R
7      3R]
! ]! R4      ]! R4      R
7      3R]
! ]]R
7      3R]
! R	]! R4      R
7      3.tRtVtV ;t# )TestFileTypeRiX  8Test the FileType option/argument type for reading filesc                8  < \         \        V `  4        R F[  p\        \        P
                  P                  V P                  V4      RRR7      ;_uu_ 4       pVP                  V4       RRR4       K]  	  V P                  R4       R#   + '       g   i     K  ; i)r7   r{   r   r|   Nreadonlyrf  )
r   rW  r\   r~   re   rn   ro   rd   r   r   r   	file_namer   r   s   &  r   r\   TestFileTypeR.setUp[  sz    mT(*'Ibggll4==)<G- -04

9%- - ( 	!!*-- - -s   BBr  r  r  r(  r7   Nr!  r  
-x foo barrl  
bar -x foo-x - -rZ  r&   )r  r'   znon-existent-file.txt)r)   r*   r+   r,   r-   r\   r   r  r   r  r   rI  eq_stdinr  r.   r/   r0   r1   s   @@r   rW  rW  X  s     B. 	Dxz"F#' 3H	Te-.	rE%LuU|<=	rE%LuU|<=	2x01	R$U:%678IIr   rW  c                      a a ] tR tRt oRtV 3R lt]! R]! R4      RR7      .tR.t	R	]
! ]! R
4      R7      3.tRtVtV ;t# )TestFileTypeDefaultsip  z<Test that a file is not created unless the default is neededc                   < \         \        V `  4        \        \        P
                  P                  V P                  R 4      RRR7      pVP                  R 4       VP                  4        R# )goodr{   r   r|   N)
r   rd  r\   r~   re   rn   ro   rd   r   rS  )r   r   r   s   & r   r\   TestFileTypeDefaults.setUpr  sG    "D/1BGGLL7wO

6

r   r  r(  zno-file.txtr   r  r'   z-c goodrf  )r  r&   )r)   r*   r+   r,   r-   r\   r   r  r   r  r   rI  r  r.   r/   r0   r1   s   @@r   rd  rd  p  sH     F 	Dx}m< tHR%-012IIr   rd  c            	         a a ] tR tRt oRtV 3R lt]! R]! R4      R7      ]! R]! R4      R7      .tRR.t	R	]
! R
]! R	4      R7      3R]
! ]! R	4      ]! R4      R7      3R]
! ]! R	4      ]! R4      R7      3R]
! ]]R7      3.tRtVtV ;t# )TestFileTypeRBi  rX  c                  < \         \        V `  4        R F[  p\        \        P
                  P                  V P                  V4      RRR7      ;_uu_ 4       pVP                  V4       RRR4       K]  	  R#   + '       g   i     Kr  ; i)r7   r{   r   r|   Nrf  )	r   rj  r\   r~   re   rn   ro   rd   r   r[  s   &  r   r\   TestFileTypeRB.setUp  sj    nd)+'Ibggll4==)<G- -04

9%- - (- - -s   A77Br  rbr  r  r'   r7   Nr^  r_  rl  r`  ra  r&   )r)   r*   r+   r,   r-   r\   r   r  r   r  r   rI  	eq_bstdinr  r.   r/   r0   r1   s   @@r   rj  rj    s     B& 	Dx~&F$( bzH	Te-.	rE%LuU|<=	rE%LuU|<=	2		23	IIr   rj  c                   :   a  ] tR tRt o ]! 4       tR tR tRtV t	R# )WFilei  c                    Wn         R # ra   rK  rL  s   &&r   r   WFile.__init__  rN  r   c                   WP                   9  da   R pRVP                  9   d   VP                  R4      pVP                  V4       VP	                  4        V P                   P                  V4       V P                  VP                  8H  # )zCheck that file is writable.r  rP  )rQ  moder   r   rS  addrw   rT  s   && r   r   WFile.__eq__  sc    		!1Dejj {{7+KKKKMIIMM% yyEJJ&&r   rK  N)
r)   r*   r+   r,   r  rQ  r   r   r.   r/   rR   s   @r   rp  rp    s     5D' 'r   rp  c            
       8  a a ] tR tRt oRtV 3R lt]! R]! R4      R7      ]! R]! R4      R7      .t. ROt	R]
! R	]! R4      R
7      3R]
! R	]! R4      R
7      3R]
! ]! R4      ]! R4      R
7      3R]
! ]! R4      ]! R4      R
7      3R]
! ]]R
7      3.tRtVtV ;t# )TestFileTypeWi  z8Test the FileType option/argument type for writing filesc                h   < \         SV `  4        V P                  R 4       V P                  R4       R# rZ  writableNr   r\   r   r   r   r   s   &r   r\   TestFileTypeW.setUp  (    !!*-!!*-r   r  r{   r  r  r7   Nr^  r{  r_  rl  r`  ra  r&   )r  r'   rZ  r)   r*   r+   r,   r-   r\   r   r  r   r  r   rp  	eq_stdoutr  r.   r/   r0   r1   s   @@r   rx  rx    s     B. 	Dx}%F#' &H	Te-.	R$U:%678	rE%LuU|<=	rE%LuU|<=	2		23IIr   rx  c                      a a ] tR tRt oRtV 3R lt]! R]! R4      R7      ]! R]! R4      R7      .t. ROt	R]
! ]! R	4      ]! R
4      R7      3R]
! ]]R7      3.tRtVtV ;t# )TestFileTypeXi  zATest the FileType option/argument type for writing new files onlyc                h   < \         SV `  4        V P                  R 4       V P                  R4       R# rz  r|  r}  s   &r   r\   TestFileTypeX.setUp  r  r   r  r!  r  r  r_  r7   rl  r^  ra  r&   )r  r'   rZ  r{  r  r1   s   @@r   r  r    si     K. 	Dx}%F#' 2H	rE%LuU|<=	2		23IIr   r  c            	           ] tR tRtRt]! R]! R4      R7      ]! R]! R4      R7      .tRR.tR]	! R	]
! R4      R
7      3R]	! ]
! R4      ]
! R4      R
7      3R]	! ]
! R4      ]
! R4      R
7      3R]	! ]]R
7      3.tRtR	# )TestFileTypeWBi  z?Test the FileType option/argument type for writing binary filesr  r  r  r  r'   r7   Nr^  r_  rl  r`  ra  r&   )r)   r*   r+   r,   r-   r   r  r   r  r   rp  
eq_bstdoutr  r.   r&   r   r   r  r    s    I 	Dx~&F$( bzH	Te-.	rE%LuU|<=	rE%LuU|<=	2
45	Ir   r  c                       ] tR tRtRt]! R]! R4      R7      ]! R]! R4      R7      .tR]! ]	! R4      ]	! R	4      R
7      3R]! ]
]
R
7      3.tRtR# )TestFileTypeXBi  zHTest the FileType option/argument type for writing new binary files onlyr  xbr  r  r_  r7   rl  r^  ra  r&   N)r)   r*   r+   r,   r-   r   r  r   r   rp  r  r  r.   r&   r   r   r  r    sZ    N 	Dx~&F$(
 
rE%LuU|<=	2
45Ir   r  c                   0   a  ] tR tRt o RtR tR tRtV tR# )TestFileTypeOpenArgsi  z0Test that open (the builtin) is correctly calledc           
     D   \         pV! R 4      R3V! R^4      R3V! RRR7      R3V! RRR7      R3V! R^ RR	4      R3.p\        P                  ! R
4      ;_uu_ 4       pV F!  w  rEV! R4       VP                  ! R.VO5!   K#  	  RRR4       R#   + '       g   i     R# ; i)rm  Nr{   r6  r7  r  r1  r|   l1strictzbuiltins.openr7   )rm  NN)r{      NN)r{   r  Nr6  )r  r  r1  N)r{   r   r  r  )r  r   r>   assert_called_with)r   FTcasesmr   r   s   &     r   test_open_args#TestFileTypeOpenArgs.test_open_args  s    X-.QZ-.I&(BCv&(@AQh')AB
 ZZ((A#
U$$U2T2 $ )(((s   (BB	c                    V P                  \        4      ;_uu_ 4        \        R 4      ! R4       RRR4       R#   + '       g   i     R# ; i)r  z-testN)r
  r  r  r$   s   &r   test_invalid_file_type+TestFileTypeOpenArgs.test_invalid_file_type  s.    z**SM'" +***s	   :A	r&   N)	r)   r*   r+   r,   r-   r  r  r.   r/   rR   s   @r   r  r    s     :3# #r   r  c                   *   a  ] tR tRt o RtR tRtV tR# )!TestFileTypeMissingInitializationi	  zl
Test that add_argument throws an error if FileType class
object was passed instead of instance of FileType
c                R   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       pVP	                  R \         P
                  R7       RRR4       V P                  \         P
                  : R2\        XP                  4      4       R#   + '       g   i     LI; i)r  r  Nz: is a FileType class object, instance of it must be passed)	r:   r;   r
  r   r   r  r  r  r  r  s   &  r   r  &TestFileTypeMissingInitialization.test  st    ((*y))R8+<+<= * 	  #	
 *)s   "BB&	r&   Nr)   r*   r+   r,   r-   r  r.   r/   rR   s   @r   r  r  	  s     
	
 	
r   r  c                       ] tR tRtRt]! R]R7      ]! R]R7      .t. ROt	R]
! ^*RR7      3R	]
! R
RR7      3R]
! RRR7      3.tRtR# )TestTypeCallablei  z,Test some callables as option/argument typesz--eggsr  r  z--eggs=42 42g      E@)eggsr  z--eggs 2j -- -1.5y               @z1024.675Ng3333@r&   )r  42jz--eggs az	--eggs 2i      )r)   r*   r+   r,   r-   r   complexr  r   r  r   r  r.   r&   r   r   r  r    s^    6 	H7#F 5H	$/0	bbt45	RT12Ir   r  c                       ] tR tRtRt ! R R]4      t]! R]R7      ]! R]R7      .t. t	R]
! ]! R	4      ]! R
4      R7      3R]
! ]! R4      ]! R4      R7      3.tRtR# )TestTypeUserDefinedi*  z(Test a user-defined option/argument typec                   ,   a  ] tR tRt o R tR tRtV tR# )TestTypeUserDefined.MyTypei-  c                    Wn         R # ra   valuer   r  s   &&r   r   #TestTypeUserDefined.MyType.__init__/      Jr   c                `    \        V 4      V P                  3\        V4      VP                  38H  # ra   r   r  r   s   &&r   r   !TestTypeUserDefined.MyType.__eq__2  '    J

+UU[[/IIIr   r  NrF  rR   s   @r   MyTyper  -       		J 	Jr   r  r  r  r  r  r  r  r^  -xf grA  r  r&   N)r)   r*   r+   r,   r-   rT   r  r   r   r  r   r  r.   r&   r   r   r  r  *  sm    2J J 	DvF  H	2s&+67	"vc{56Ir   r  c                       ] tR tRtRt ! R R4      t]! R]R7      ]! R]R7      .t. tR]	! ]! R	4      ]! R
4      R7      3R]	! ]! R4      ]! R4      R7      3.t
RtR# )TestTypeClassicClassi@  zTest a classic class typec                   ,   a  ] tR tRt o R tR tRtV tR# )TestTypeClassicClass.CiC  c                    Wn         R # ra   r  r  s   &&r   r   TestTypeClassicClass.C.__init__E  r  r   c                `    \        V 4      V P                  3\        V4      VP                  38H  # ra   r  r   s   &&r   r   TestTypeClassicClass.C.__eq__H  r  r   r  NrF  rR   s   @r   Cr  C  r  r   r  r  r  r  r  r  r  r^  r  rA  r  r&   N)r)   r*   r+   r,   r-   r  r   r   r  r   r  r.   r&   r   r   r  r  @  sk    #J J 	DqF H	2#QsV,-	"qvAcF+,Ir   r  c                   *   a  ] tR tRt o RtR tRtV tR# )TestTypeRegistrationiV  z*Test a user-defined type by registering itc                   R  p\         P                  ! 4       pVP                  RRV4       VP                  RRR7       VP                  RRR7       V P	                  VP                  RP                  4       4      \        RRR	7      4       V P	                  VP                  R
P                  4       4      \        RRR	7      4       R# )c                     R V ,          # )zmy_type{%s}r&   strings   &r   get_my_type.TestTypeRegistration.test.<locals>.get_my_type[  s     6))r   r   my_typer  r  r  rb  Nz
my_type{1}r  z-x 1 42zmy_type{42})r:   r;   registerr   r  rK   r	  r   )r   r  rA   s   &  r   r  TestTypeRegistration.testY  s    	* ((*	;7Dy1Ci0**399;7dl3	5**9??+<=lm<	>r   r&   Nr  rR   s   @r   r  r  V  s     4> >r   r  c            	          ] tR tRtRt ! R R]P                  4      t ! R R]P                  4      t]	! RR]]
R	R
7      ]	! R]]R^R7      .t. tR]! R^R7      3R]! R	^*R7      3R]! R^R7      3R]! R^TR7      3.tRtR# )TestActionUserDefinedim  z*Test a user-defined option/argument actionc                   *   a  ] tR tRt o RR ltRtV tR# )$TestActionUserDefined.OptionalActionip  Nc                    V P                   R 8X  g   Q RV P                   ,          4       hVR8X  g   Q RV,          4       h\        RR7      pVR9   d	   ^Vn        M!VR9   d	   ^TVn        M\        RV,          4      hWR8X  g   Q RV: RV: 24       h \        TR T4       R
#   \         d   p\	        R	T,          4      hR
p?ii ; i)r  dest: %s-szflag: %s      ?r  	value: %s	expected , got zopt_action failed: %sN)      ?r  )       @)rR  r   rY  AssertionErrorr   r   r   rA   	namespacer  option_stringr  r   s   &&&&&  r   __call__-TestActionUserDefined.OptionalAction.__call__r  s    GyyF*BJ,BB*$,Hj=.HH, !dmN*)*K&e^)+K&(u)<=="/ L3>	3K L/ Ivu- " G)*AA*EFFGs   BB! !C,B>>Cr&   ra   r)   r*   r+   r,   r  r.   r/   rR   s   @r   OptionalActionr  p  s     	. 	.r   r  c                   *   a  ] tR tRt o RR ltRtV tR# )&TestActionUserDefined.PositionalActioni  Nc                    Ve   Q RV,          4       hV P                   R8X  g   Q RV P                   ,          4       h\        ^R7      pVR9   d	   RVn        M0VR9   d	   RVn        M!VR9   d	   RVn        M\        RV,          4      hWR8X  g   Q R	V: R
V: 24       h \        TRT4       R #   \         d   p\	        RT,          4      hR p?ii ; i)Nzoption_string: %srY  r  rY  r  r  r  r  r  r  zarg_action failed: %s)*   T   )r  )   )rR  r   r  r  r   r   r  s   &&&&&  r   r  /TestActionUserDefined.PositionalAction.__call__  s    G$, >/B/<0= >, yyH,Dj499.DD, !lH$'+K$c\',K$c\',K$(u)<=="/ L3>	3K L/ Ix/ " G)*AA*EFFGs   BB- -C8C

Cr&   ra   r  rR   s   @r   PositionalActionr    s     	0 	0r   r  r  r  r  )rR  r,  r   r  rY  r  )r,  r   r  r  z-s0.125r  )r  rY  r  z
-s 0.625 1r  z84 -s2r  r&   N)r)   r*   r+   r,   r-   r:   Actionr  r  r   r  r  r   r  r   r  r.   r&   r   r   r  r  m  s    4. .,08?? 04 	Dvn	&H-C	, H	BE!,-	rtB'(	ruQ/0	23r*+	Ir   r  c                   T   a  ] tR tRt o Rt ! R R]P                  4      tR tRt	V t
R# )TestActionRegistrationi  z5Test a user-defined action supplied by registering itc                   *   a  ] tR tRt o RR ltRtV tR# )TestActionRegistration.MyActioni  Nc                @    \        W P                  R V,          4       R# )zfoo[%s]N)r   rR  )r   rA   r  valuesr  s   &&&&&r   r  (TestActionRegistration.MyAction.__call__  s    Iyy)f*<=r   r&   ra   r  rR   s   @r   MyActionr    s     	> 	>r   r  c                @   \         P                  ! 4       pVP                  R RV P                  4       VP	                  RRR7       V P                  VP                  R.4      \        RR7      4       V P                  VP                  R.4      \        RR7      4       R	# )
r,  	my_actionrY  r+  rb  zfoo[1]r  r  zfoo[42]N)r:   r;   r  r  r   r  rK   r   r@   s   & r   r  TestActionRegistration.test  s{    ((*+t}}=H[9**C512X3FG**D62Bi4HIr   r&   N)r)   r*   r+   r,   r-   r:   r  r  r  r.   r/   rR   s   @r   r  r    s$     ?>8?? >
J Jr   r  c                   P    ] tR tRt]! RRR]R7      .tRtR]! . R
OR7      3.t	Rt
R	# )TestActionExtendi  r%  r  r  )r,  r  r   z--foo f1 --foo f2 f3 f4r9  r&   N)f1f2f3f4)r)   r*   r+   r,   r   r  r   r  r   r  r.   r&   r   r   r  r    s4    GHCc: H	"B+C$DEIr   r  c                      ] tR tRtRt]! R]R7      ]! R]R7      ]! R]R7      .t	. ROt
R]! RRRR	7      3R
]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRRR	7      3R]! RRR R	7      3R]! RRR R	7      3R]! RRR R	7      3R]! RRR!R	7      3.tRtR# )"TestNegativeNumberi  zTest parsing negative numbersz--intr  z--floatz	--complexz--int -1000 --float -1000.0N)r  r  r  z--int -1_000 --float -1_000.0z%--int -1_000_000 --float -1_000_000.0z--float -1_000.0z--float -1_000_000.0_0z--float -.5z--float -.5_000z--float -1e3z--float -1e-3z--complex -1jz--complex -1_000jz--complex -1_000.0jz--complex -1e3jz--complex -1e-3jr&   )z--float -_.45z--float -1__000.0z--float -1.0.0z--int -1__000z
--int -1.0z--complex -1__000.0jz--complex -1.0jjz--complex -_.45jig     @ig    .r  gMbP             y            @y       MbP)r)   r*   r+   r,   r-   r   r  r  r  r   r  r   r  r.   r&   r   r   r  r    s,   ' 	G#IE"Kg&
	H 
'uGT(RS	("gt*TU	0"]a2bc	RDFG	!2$j$#OP	t4>?	B4tTBC	E4@A	"VTBC	"T3?@	bTvFG	t4 JK	B4tVDE	RDgFGIr   r  c                   T   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V tR# )#TestArgumentAndSubparserSuggestionsi  z;Test error handling and suggestion when a user makes a typoc                (   \        R R7      pVP                  RRR.R7       V P                  \        4      ;_uu_ 4       pVP	                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)	Tsuggest_on_errorr7   rl  rm  r  NzZerror: argument foo: invalid choice: 'bazz', maybe you meant 'baz'? (choose from bar, baz)bazzr   r   r
  r   rK   r  r  r   r   rA   excinfos   &  r   *test_wrong_argument_error_with_suggestionsNTestArgumentAndSubparserSuggestions.test_wrong_argument_error_with_suggestions  sq    +TBEE5>:233wi( 4h$$	
 43   BB	c                (   \        R R7      pVP                  RRR.R7       V P                  \        4      ;_uu_ 4       pVP	                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)	Fr  r7   rl  rm  r  NBerror: argument foo: invalid choice: 'bazz' (choose from bar, baz)r  r  r  s   &  r   (test_wrong_argument_error_no_suggestionsLTestArgumentAndSubparserSuggestions.test_wrong_argument_error_no_suggestions  sq    +UCEE5>:233wi( 4P$$	
 43r  c                f   \        R R7      pVP                  R R7      pVP                  R4       VP                  R4       V P                  \        4      ;_uu_ 4       pVP                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)Tr  r  r7   rl  Nz_error: argument {foo,bar}: invalid choice: 'baz', maybe you meant 'bar'? (choose from foo, bar)r  	r   add_subparsers
add_parserr
  r   rK   r  r  r   r   rA   
subparsersr  s   &   r   /test_wrong_argument_subparsers_with_suggestionsSTestArgumentAndSubparserSuggestions.test_wrong_argument_subparsers_with_suggestions	  s    +TB**D*9
e$e$233wh' 4.$$	
 43   B  B0	c                f   \        R R7      pVP                  RR7      pVP                  R4       VP                  R4       V P                  \        4      ;_uu_ 4       pVP                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)	Fr  Tr  r7   rl  NzGerror: argument {foo,bar}: invalid choice: 'baz' (choose from foo, bar)r  r  r  s   &   r   -test_wrong_argument_subparsers_no_suggestionsQTestArgumentAndSubparserSuggestions.test_wrong_argument_subparsers_no_suggestions	  s    +UC**D*9
e$e$233wh' 4U$$	
 43r  c                $   \        4       pVP                  R RR.R7       V P                  \        4      ;_uu_ 4       pVP	                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)r7   rl  rm  r  Nr  r  r  r  s   &  r   *test_wrong_argument_no_suggestion_implicitNTestArgumentAndSubparserSuggestions.test_wrong_argument_no_suggestion_implicit	  so    +-EE5>:233wi( 4P$$	
 43   A??B	c                $   \        R R7      pVP                  R. R7       V P                  \        4      ;_uu_ 4       pVP	                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)Tr  r7   r  Nz:error: argument foo: invalid choice: 'bazz' (choose from )r  r  r  s   &  r   test_suggestions_choices_emptyBTestArgumentAndSubparserSuggestions.test_suggestions_choices_empty'	  sm    +TBE2.233wi( 4H$$	
 43r   c                (   \        R R7      pVP                  R^^.R7       V P                  \        4      ;_uu_ 4       pVP	                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)Tr  r7   r  N;error: argument foo: invalid choice: '3' (choose from 1, 2)r  r  r  s   &  r   test_suggestions_choices_int@TestArgumentAndSubparserSuggestions.test_suggestions_choices_int1	  sq    +TBEAq62233wf% 4I$$	
 43r  c                (   \        R R7      pVP                  R^R.R7       V P                  \        4      ;_uu_ 4       pVP	                  R4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)Tr  r7   r  r  Nr%  r&  r  r  s   &  r   $test_suggestions_choices_mixed_typesHTestArgumentAndSubparserSuggestions.test_suggestions_choices_mixed_types;	  sq    +TBEAs84233wf% 4I$$	
 43r  r&   N)r)   r*   r+   r,   r-   r	  r  r  r  r  r"  r'  r*  r.   r/   rR   s   @r   r   r     s5     E








 
r   r   c                   Z   a  ] tR tRt o Rt ! R R]P                  4      tR tR t	Rt
V tR# )	TestInvalidActioniF	  z Test invalid user defined Actionc                       ] tR tRtRtR# )#TestInvalidAction.ActionWithoutCalliI	  r&   Nr)   r*   r+   r,   r.   r&   r   r   ActionWithoutCallr/  I	  s    r   r1  c                    \         P                  ! 4       pVP                  R V P                  R7       V P	                  \
        VP                  R R.4       R# )r%  r+  rl  N)r:   r;   r   r1  r
  NotImplementedErrorrK   r@   s   & r   test_invalid_type#TestInvalidAction.test_invalid_typeL	  sG    ((*GD,B,BC-v/@/@7EBRSr   c                t   \         P                  ! R R7      pVP                  R4      p^Vn        V P	                  \
        RVP                  RR.4       RVn        V P	                  \
        RVP                  RR.4       \        Vn        V P	                  \         P                  RVP                  RR.4       R# )	FrE  r%  z1 is not callablerl  z\(\) is not callablez(argument --foo: invalid pow value: 'bar'Nr&   )	r:   r;   r   r   rH  r   rK   powrI  r   rA   r,  s   &  r   test_modified_invalid_action.TestInvalidAction.test_modified_invalid_actionR	  s    ((u=$$W-y*=%007E2B	Dy*A%007E2B	D x55I%007E2B	Dr   r&   N)r)   r*   r+   r,   r-   r:   r  r1  r4  r9  r.   r/   rR   s   @r   r-  r-  F	  s*     *HOO TD Dr   r-  c                      a a ] tR tRt oRtR tR&R ltV 3R ltR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t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(V ;t)# )'TestAddSubparsersik	  zTest the add_subparsers methodc                :    V P                   ! \        .VO5/ VB  R # ra   r
  r   r   s   &*,r   assertArgumentParserError+TestAddSubparsers.assertArgumentParserErroro	      -???r   c                   V'       d:   \        R RVVR7      pVP                  V^ ,          ^,          R,           RRR7       M"\        R RVR7      pVP                  RRRR7       VP                  R	\        R
R7       RR/pV'       d   RVR&   RVR&   MRVR&   VP                  ! R2/ VB pV P	                  \
        RVP                  4       \        RR7      pV'       d   RVR&   V'       d   RR.VR&   VP                  ! R3/ VB p	V	P                  R\        RR7       V	P                  R. R4ORR7       \        R R7      p
V'       d   R!V
R&   VP                  ! R5/ V
B pVP                  R". R6OR#R7       VP                  R$\        R%R&R'7       \        R(R)R*7      pV'       d   R+VR&   VP                  ! R7/ VB pVP                  R,\        R-R7       VP                  R.R/R0R17       V# )8PROGmain description)progdescriptionusagert  r7   r*  foo helpr,  r?  )rE  rF  rG  r%  rl  bar helpr   r?  r  FCOMMANDmetavarcommandstitlecommand helpr?  z(cannot have multiple subparser argumentsz1 descriptionrF  z1 help1alias11alias2aliasesr  w helpr!  x helpr>  z2 descriptionz2 helpr5  y helpr2  r  z help)r   r  r?  z3 descriptionzPROG --foo bar 3 t ...)rF  rG  z3 helptzt helpur  zu helpr  r?  r&   rb  r  )r  rb  r  r  r&  )
r   r   r  r  rH  r  dictr  r  r  )r   subparser_helprt  rT  rG  rA   subparsers_kwargsr  parser1_kwargsparser1parser2_kwargsparser2parser3_kwargsparser3s   &&&&&         r   r  TestAddSubparsers._get_parserr	  s    /);5)+F Q!#e+Lz   S 0);5JF:   ?J 	 	0 (/+4i()3g&(6f%**?->?
zI%44	6
 /:%-N6")2I(>N9%''>~>T(;S/I /:%-N6"''>~>T?JSwcI /$<>%-N6"''>~>Ss:SH= r   c                |   < \         SV `  4        V P                  4       V n        V P                  R R7      V n        R# )T)r_  N)r   r\   r  rA   command_help_parserr}  s   &r   r\   TestAddSubparsers.setUp	  s2    &&(#'#3#34#3#H r   c                    R F9  pVP                  4       pV P                  V P                  P                  V4       K;  	  R# )r'   N)r'   r  za az0.5 az0.5 10.5 1 -yz0.5 2 -w)r	  r?  rA   rK   )r   r  r   s   &  r   test_parse_args_failures*TestAddSubparsers.test_parse_args_failures	  s4    1H>>#D**4;;+A+A4H1r   c           
        R F  w  rpV P                  V4      ;_uu_ 4        VP                  4       pV P                  \        4      ;_uu_ 4       pV P                  P                  V4       RRR4       V P                  XP                  P                  ^ ,          R4       V P                  VP                  P                  ^,          V RV R24       RRR4       K  	  R#   + '       g   i     L~; i  + '       g   i     EK  ; i)r'   Nr   r(   ))r'   z(usage: PROG [-h] [--foo] bar {1,2,3} ...6PROG: error: the following arguments are required: barrl  z%usage: PROG bar 1 [-h] [-w W] {a,b,c}z:PROG bar 1: error: the following arguments are required: xz0.5 3zusage: PROG --foo bar 3 t ...z:PROG bar 3: error: the following arguments are required: t)	rL   r	  r
  r   rA   rK   r  r  r   )r   r  	usage_str	error_strr   r  s   &     r    test_parse_args_failures_details2TestAddSubparsers.test_parse_args_failures_details	  s    
/
*H h''~~'&&':;;rKK**40 <  !2!21!5|D  !2!21!5)BykQS7TU ('
/
 <; (''s$   .C5C",A(C5"C2-C55Dc           
     "   V P                  R R7      pR F  w  r#pV P                  V4      ;_uu_ 4        VP                  4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  ^ ,          R4       V P                  VP                  P                  ^,          V RV R24       RRR4       K  	  R#   + '       g   i     L~; i  + '       g   i     K  ; i)z?PROG [--foo] bar 1 [-w W] {a,b,c}
       PROG --foo bar 3 t ...)rG  Nr   r(   ))r'   zFusage: PROG [--foo] bar 1 [-w W] {a,b,c}
       PROG --foo bar 3 t ...rp  rq  rr  )	r  rL   r	  r
  r   rK   r  r  r   )r   rA   r  rs  rt  r   r  s   &      r   -test_parse_args_failures_details_custom_usage?TestAddSubparsers.test_parse_args_failures_details_custom_usage	  s    !! )A! B/
*H h''~~'&&':;;r%%d+ <  !2!21!5|D  !2!21!5)BykQS7TU ('/
 <; (''s$   .C="C*4A(C=*C:5C==Dc           
     >   V P                  V P                  P                  R P                  4       4      \	        RR^RR7      4       V P                  V P                  P                  RP                  4       4      \	        RRRR	R.R
7      4       V P                  V P                  P                  RP                  4       4      \	        RRRRR7      4       V P                  V P                  P                  RP                  4       4      \	        RR^. ROR7      4       R# )0.5 1 b -w 7Fr  r  r7   rl  r{   r!  z0.25 --foo 2 -y 2 3j -- -1jTr  r  y              @)r7   rl  r  r2  z--foo 0.125 1 cr  Nr  z-1.5 3 11 -- a --foo 7 -- b)r7   rl  rY  rZ  r  r  )r  r%  r  --r  )r  rA   rK   r	  r   r$   s   &r   test_parse_args!TestAddSubparsers.test_parse_args	  s    KK"">#7#7#9:5cQ#.	
 	KK""#@#F#F#HI4TSRI6	
 	KK""#4#:#:#<=4Udc2	
 	KK""#@#F#F#HI5db,JK	
r   c           
        V P                  V P                  P                  R P                  4       4      \	        RR^RR7      . 34       V P                  V P                  P                  RP                  4       4      \	        RR^RR7      R.34       V P                  V P                  P                  RP                  4       4      \	        RR^RR7      R.34       V P                  V P                  P                  RP                  4       4      \	        RR^RR7      R	R
.34       V P                  V P                  P                  RP                  4       4      \	        RR^RR7      . RO34       R# )r{  Fr  r  r|  z0.5 -p 1 b -w 7-p0.5 1 b -w 7 -pz0.5 1 b -q -rs -w 7-qz-rsz0.5 -W 1 b -X Y -w 7 ZN)z-Wz-Xr  r  )r  rA   parse_known_argsr	  r   r$   s   &r   test_parse_known_args'TestAddSubparsers.test_parse_known_args	  sC   KK(()=)=)?@Esa3/4	
 	KK(():)@)@)BCEsa3/$8	
 	KK(():)@)@)BCEsa3/$8	
 	KK(()>)D)D)FGEsa3/$?	
 	KK(()A)G)G)IJEsa3/1GH	
r   c                v    ! R  R4      pV P                  V P                  P                  RP                  4       VR7      VR.34       V P	                  VP
                  R4       V P                  VP                  R4       V P                  VP                  ^4       V P                  VP                  R4       R# )	c                       ] tR tRtRtR# )ETestAddSubparsers.test_parse_known_args_to_class_namespace.<locals>.Ci
  r&   Nr0  r&   r   r   r  r  
      r   r  r  )r  r  Fr  r  N)	r  rA   r  r	  assertIsr7   rl  r{   r!  )r   r  s   & r   (test_parse_known_args_to_class_namespace:TestAddSubparsers.test_parse_known_args_to_class_namespace
  s    	 	KK(():)@)@)Ba(PK	
 	aeeU#$a c"r   c           
     <   \        4       pVP                  R 4       VP                  R4       VP                  4       pVP                  R4      pVP                  R4       VP                  R4       V P	                  VP                  . RO4      \        RRRRR7      4       V P	                  VP                  . R	O4      \        RRRRR7      4       V P                  VP
                  . R
O4       V P	                  VP                  . RO4      \        RRRRR7      4       V P	                  VP                  . RO4      \        RRRRR7      4       V P	                  VP                  . RO4      \        RRRRR7      4       V P                  VP
                  . RO4       R# )r  r  rl  --foz--foonewrm  N)r  r  fofoonew)r  rm  rl  )--foonrm  rl  )r  rm  rl  )rl  r  rm  )rl  r%  rm  )rl  r  rm  )rl  r  rm  )r   r   r  r  r  rK   r   r?  r   rA   r  rb  s   &   r   test_abbreviation#TestAddSubparsers.test_abbreviation
  se   +-J'J'**,
''.V$Z(**+CD5$tL	N**+CD4$tL	N&&v'8'8:PQ**+AB4tL	N**+BC4eL	N**+CD4eL	N&&v'8'8:RSr   c                   \        4       pVP                  R RR^ R7       VP                  RRR^ R7       V P                  VP                  R R.4      \	        ^^ R7      R.34       V P                  VP                  RR .4      \	        ^^ R7      R.34       V P                  VP                  R.4      \	        ^^ R7      R.34       V P                  VP                  R	.4       V P                  VP                  R
.4      \	        ^ ^ R7      R
.34       V P                  VP                  R.4      \	        ^ ^ R7      R.34       V P                  VP                  R.4      \	        ^^ R7      R.34       V P                  VP                  R.4       V P                  VP                  R.4      \	        ^^ R7      R.34       V P                  VP                  R.4      \	        ^^R7      R.34       V P                  VP                  R.4       V P                  VP                  R.4       V P                  VP                  R.4       V P                  VP                  R.4      \	        ^^R7      R.34       R# )z-kz--knownr	  r  r  z--newz-u)knownnewz-kuz-k=uz-ukz-u=kz	-kunknownz-unknownz
-k=unknownz
-ku=nknownz	-u=nknownz-knewz-ewz-kn=ewz-k-newz-kn-ewz-kne-wz-e-wN)r   r   r  r  r   r?  r@   s   & r   -test_parse_known_args_with_single_dash_option?TestAddSubparsers.test_parse_known_args_with_single_dash_option-
  sR   +-D)GQGD''1E00$>1!,tf5	700$>1!,tf5	700%91!,tf5	7&&v'>'>I00%91!,ug6	800&:1!,vh7	900+?1!,zl;	=&&v'>'>O00,@1!,{m<	>00';1!,ug6	8&&v'>'>
K&&v'>'>
K&&v'>'>
K00(<1!,vh7	9r   c                   \        4       pVP                  R RR7       VP                  RR7      pVP                  R4      pVP                  R4       V P	                  \        RRRR	7      VP                  R
P                  4       4      4       R# )r%  r*  r+  rl  rQ  rb  rm  Fr  r  rc  N)r   r   r  r  r  r   rK   r	  r  s   &   r   	test_destTestAddSubparsers.test_destI
  s{    +-GL9***6
'',U#3C8**5;;=9	;r   c                    VP                  R .4      pV P                  VP                  R 4       V P                  VP                   R4       R# )runNr&   )rK   r  commandr?  )r   rA   rets   && r   _test_required_subparsers+TestAddSubparsers._test_required_subparsersR
  s@    (e, 	&&v'8'8"=r   c                    \        4       pVP                  R R7      pRVn        VP                  R4       V P	                  V4       R# )r  rQ  Tr  N)r   r  r  r  r  r   rA   r  s   &  r   &test_required_subparsers_via_attribute8TestAddSubparsers.test_required_subparsers_via_attributeZ
  sA    +-**	*:
"
e$&&v.r   c                    \        4       pVP                  R RR7      pVP                  R4       V P                  V4       R# )r  TrR  r  r  N)r   r  r  r  r  s   &  r   "test_required_subparsers_via_kwarg4TestAddSubparsers.test_required_subparsers_via_kwarga
  s;    +-**	D*I
e$&&v.r   c                    \        4       pVP                  R R7      pVP                  R4       VP                  R4      pV P	                  VP
                  4       R# )r  rQ  r  Nr&   r   r  r  rK   assertIsNoner  r   rA   r  r  s   &   r    test_required_subparsers_default2TestAddSubparsers.test_required_subparsers_defaultg
  sM    +-**	*:
e$##++&r   c                b   \        4       pVP                  R R7      pVP                  R4       VP                  R4       V P                  \        4      ;_uu_ 4       pVP                  R4       RRR4       V P                  XP                  P                  R4       R#   + '       g   i     L8; i)Tr  r7   rl  Nz8error: the following arguments are required: {foo,bar}
$r&   )	r   r  r  r
  r   rK   rN   r  r   r  s   &   r   -test_required_subparsers_no_destination_error?TestAddSubparsers.test_required_subparsers_no_destination_erroro
  s    +-**D*9
e$e$233wb! 4$$G	
 43s   BB.	c                    \        4       pVP                  R RR7      pVP                  R4       VP                  R4      pV P	                  VP
                  4       R# )r  Fr  r  Nr&   r  r  s   &   r   test_optional_subparsers*TestAddSubparsers.test_optional_subparsers{
  sO    +-**	E*J
e$##++&r   c                    V P                  V P                  P                  4       R 4       V P                  V P                  P                  4       \        P
                  ! R4      4       R# ))usage: PROG [-h] [--foo] bar {1,2,3} ...
a?              usage: PROG [-h] [--foo] bar {1,2,3} ...

            main description

            positional arguments:
              bar         bar help
              {1,2,3}     command help

            options:
              -h, --help  show this help message and exit
              --foo       foo help
            N)r  rA   r@  rA  textwrapdedentr$   s   &r   	test_helpTestAddSubparsers.test_help
  sQ    113E	G002HOO E 5 	r   c                    V P                  R R7      pV P                  VP                  4       R4       V P                  VP                  4       \        P
                  ! R4      4       R# )z+:-r  z)usage: PROG [-h] [++foo] bar {1,2,3} ...
a?              usage: PROG [-h] [++foo] bar {1,2,3} ...

            main description

            positional arguments:
              bar         bar help
              {1,2,3}     command help

            options:
              -h, --help  show this help message and exit
              ++foo       foo help
            Nr  r  r@  rA  r  r  r@   s   & r   test_help_extra_prefix_chars.TestAddSubparsers.test_help_extra_prefix_chars
  s\    !!u!5,,.E	G++-x @ 0 	r   c                    \        R RR7      pVP                  RRRR7       V P                  VP                  4       \        P
                  ! R4      4       R# )	rC  rD  rE  rF  z--non-breakingr  uR   help message containing non-breaking spaces shall not wrap at non-breaking spacesrI  u7              usage: PROG [-h] [--non-breaking]

            main description

            options:
              -h, --help      show this help message and exit
              --non-breaking  help message containing non-breaking spaces shall not
                              wrap at non-breaking spaces
        Nr   r   r  rA  r  r  r@   s   & r   test_help_non_breaking_spaces/TestAddSubparsers.test_help_non_breaking_spaces
  s[    +%79]; 	 	< 	++-x 	@ 	0 		r   c                X   \        R RR7      pVP                  RRR7       V P                  VP                  4       \        P
                  ! R4      4       \        R RR7      pVP                  R. RR7       V P                  VP                  4       \        P
                  ! R	4      4       R
# )rC  rD  r  r7   z    r?  z            usage: PROG [-h] foo

            main description

            positional arguments:
              foo         

            options:
              -h, --help  show this help message and exit
        z%(choices)sr>  z            usage: PROG [-h] {}

            main description

            positional arguments:
              {}          

            options:
              -h, --help  show this help message and exit
        Nr  r@   s   & r   test_help_blank!TestAddSubparsers.test_help_blank
  s    +%79 	 	 	++-x 	@ 	0 		 ,%792 	 	  	++-x 	@ 	0 		r   c                    V P                  R R7      pV P                  VP                  4       R4       V P                  VP                  4       \        P
                  ! R4      4       R# )rr  r  z)usage: PROG [+h] [++foo] bar {1,2,3} ...
a?              usage: PROG [+h] [++foo] bar {1,2,3} ...

            main description

            positional arguments:
              bar         bar help
              {1,2,3}     command help

            options:
              +h, ++help  show this help message and exit
              ++foo       foo help
            Nr  r@   s   & r    test_help_alternate_prefix_chars2TestAddSubparsers.test_help_alternate_prefix_chars
  s\    !!u!5,,.E	G++-x @ 0 	r   c                    V P                  V P                  P                  4       R 4       V P                  V P                  P                  4       \        P
                  ! R4      4       R# )r  a              usage: PROG [-h] [--foo] bar {1,2,3} ...

            main description

            positional arguments:
              bar         bar help
              {1,2,3}     command help
                1         1 help
                2         2 help
                3         3 help

            options:
              -h, --help  show this help message and exit
              --foo       foo help
            N)r  ri  r@  rA  r  r  r$   s   &r   test_parser_command_help*TestAddSubparsers.test_parser_command_help
  sU    11>>@E	G11==?! * 	r   c                    V P                  \        R 4      ;_uu_ 4       pV! V/ VB  RRR4       V P                  XP                  P                  V4       R#   + '       g   i     L8; i)badly formed help stringN)rH  r  assertIsInstancer  __context__)r   context_typerF   r   r   r  s   &&&*, r   assert_bad_help!TestAddSubparsers.assert_bad_help  sO    ##J0JKKr$!&! Lbll66E LKs   	AA(	c                   \        R R7      pV P                  \        VP                  RR7       \        R R7      pV P                  \        VP                  RR7       \        R R7      pV P                  \
        VP                  RR7       R# )rC  rE  %Y-%m-%dr  %(spam)s%(prog)dN)r   r  r  r  KeyErrorr   r@   s   & r   test_invalid_subparsers_help.TestAddSubparsers.test_invalid_subparsers_help  sq    +8Z)>)>ZP+8Xv'<'<:N+8Y(=(=JOr   c                   \        R R7      pVP                  4       pV P                  \        VP                  RRR7       V P                  \
        VP                  RRR7       V P                  \        VP                  RRR7       R# )rC  r  rb  r  r  r  r  N)r   r  r  r  r  r  r   r  s   &  r   test_invalid_subparser_help-TestAddSubparsers.test_invalid_subparser_help  s    +8**,
Z)>)>", 	 	.Xz'<'<c", 	 	.Y
(=(=s", 	 	.r   c                   \        R RR7      pVP                  RRRR7       VP                  RRR	7       VP                  R
RRR7      pVP                  R4      pVP                  R4      pV P	                  VP                  4       R4       V P	                  VP                  4       \        P                  ! R4      4       R# )rC  rD  r  r%  r*  rH  rI  rl  rJ  r  subcommandsrP  zadditional textrO  rF  r?  rb  r  z'usage: PROG [-h] [--foo] bar {1,2} ...
av              usage: PROG [-h] [--foo] bar {1,2} ...

            main description

            positional arguments:
              bar         bar help

            options:
              -h, --help  show this help message and exit
              --foo       foo help

            subcommands:
              command help

              {1,2}       additional text
            N)	r   r   r  r  r  r@  rA  r  r  )r   rA   r  rb  rd  s   &    r   test_subparser_title_help+TestAddSubparsers.test_subparser_title_help  s    +8JLGLzJE
3**7E0A + C
 '','',,,.C	E++-x @ 0 	r   c                   V P                  \        4      ;_uu_ 4       pV P                  P                  VP	                  4       4       R R R 4       V P                  VXP                  P                  4       R #   + '       g   i     L8; ira   )r
  r   rA   rK   r	  r  r  r   )r   r  expected_helpr  s   &&& r   _test_subparser_help&TestAddSubparsers._test_subparser_help7  sW    233rKK""8>>#34 4(;(;< 43s   *A88B	c                R    V P                  R \        P                  ! R4      4       R# )z5.0 1 -ha              usage: PROG bar 1 [-h] [-w W] {a,b,c}

            1 description

            positional arguments:
              {a,b,c}     x help

            options:
              -h, --help  show this help message and exit
              -w W        w help
            Nr  r  r  r$   s   &r   test_subparser1_help&TestAddSubparsers.test_subparser1_help<  "    !!*hoo ? / 	r   c                R    V P                  R \        P                  ! R4      4       R# )z5.0 2 -ha              usage: PROG bar 2 [-h] [-y {1,2,3}] [z ...]

            2 description

            positional arguments:
              z           z help

            options:
              -h, --help  show this help message and exit
              -y {1,2,3}  y help
            Nr  r$   s   &r   test_subparser2_help&TestAddSubparsers.test_subparser2_helpJ  r  r   c           
     "   V P                  R R7      pV P                  VP                  RP                  4       4      \	        RRRRR7      . 34       V P                  VP                  RP                  4       4      \	        RRRRR7      . 34       R# )	TrT  z0.5 1alias1 bFr  Nr  r|  z0.5 1alias2 b)r  r  r  r	  r   r@   s   & r   test_alias_invocation'TestAddSubparsers.test_alias_invocationX  s    !!$!/##O$9$9$;<Esdc2B7	
 	##O$9$9$;<Esdc2B7	
r   c                ~    V P                  R R7      pV P                  VP                  RP                  4       4       R# )Tr  z0.5 1alias3 bN)r  r?  rK   r	  r@   s   & r   test_error_alias_invocation-TestAddSubparsers.test_error_alias_invocationc  s8    !!$!/&&v'8'8'6'<'<'>	@r   c                    V P                  R R R7      pRV n        V P                  VP                  4       \        P
                  ! R4      4       R# )T)rT  r_  Na	              usage: PROG [-h] [--foo] bar COMMAND ...

            main description

            positional arguments:
              bar                   bar help

            options:
              -h, --help            show this help message and exit
              --foo                 foo help

            commands:
              COMMAND
                1 (1alias1, 1alias2)
                                    1 help
                2                   2 help
                3                   3 help
            )r  maxDiffr  rA  r  r  r@   s   & r   test_alias_help!TestAddSubparsers.test_alias_helph  sH    !!$t!D++-x @ 0 	r   )ri  r  rA   )FNFN)*r)   r*   r+   r,   r-   r?  r  r\   rm  ru  rx  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r.   r/   r0   r1   s   @@r   r<  r<  k	  s     (@9vI
IV&V,
&
,
#T,98;>//'

'"&$ D$*F
P.<=
	
@
 r   r<  c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )TestPositionalsGroupsi  z@Tests that order of group positionals matches construction orderc                   \        4       pVP                  R 4       VP                  R4      pVP                  R4       VP                  R4       \        RRRR7      pVP	                  RP                  4       4      pV P                  W44       R	# )
r7   r  rl  rm  rb  r  r  r  1 2 3N)r   r   r   r   rK   r	  r  r   rA   r   expectedr   s   &    r   test_nongroup_first)TestPositionalsGroups.test_nongroup_first  sv    +-E"))#.5!E"#3C0""7==?3*r   c                   \        4       pVP                  R 4      pVP                  R4       VP                  R4       VP                  R4       \        RRRR7      pVP	                  RP                  4       4      pV P                  W44       R	# )
xxxr7   rl  rm  rb  r  r  r  r  Nr   r   r   r   rK   r	  r  r  s   &    r   test_group_first&TestPositionalsGroups.test_group_first  sv    +-))%05!E"E"#3C0""7==?3*r   c                d   \        4       pVP                  R 4      pVP                  R4       VP                  R4       VP                  R4       VP                  R4      pVP                  R4       \        RRRR	R
7      pVP	                  RP                  4       4      pV P                  W44       R# )r  r7   rl  rm  r1  frellrb  r  r  r  )r7   rl  rm  r  z1 2 3 4Nr	  r  s   &    r   test_interleaved_groups-TestPositionalsGroups.test_interleaved_groups  s    +-))%0E"5!E"))%07##3Cs;""9??#45*r   r&   N)
r)   r*   r+   r,   r-   r  r
  r  r.   r/   rR   s   @r   r   r     s     J++
+ 
+r   r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestGroupConstructori  c                >   \        4       pR pV P                  \        4      ;_uu_ 4       pVP                  RR7       RRR4       V P	                  V\        XP                  4      4       V P	                  VP                  \        4       R#   + '       g   i     LW; i)jThe use of the undocumented 'prefix_chars' parameter in ArgumentParser.add_argument_group() is deprecated.r  r  N	r   r  DeprecationWarningr   r  r  r  r   r  r   rA   r  r  s   &   r   test_group_prefix_chars,TestGroupConstructor.test_group_prefix_chars  sv    +-A 	 011R%%4%8 2c"**o.h/ 21   BB	c                >   \        4       pR pV P                  \        4      ;_uu_ 4       pVP                  RR7       RRR4       V P	                  V\        XP                  4      4       V P	                  VP                  \        4       R#   + '       g   i     LW; i)r  r  r  Nr  r  s   &   r   test_group_prefix_chars_default4TestGroupConstructor.test_group_prefix_chars_default  sx     ,-A 	 011R%%3%7 2c"**o.h/ 21r  c                    \         P                  ! 4       pVP                  4       pV P                  \        R VP                  4       R# )z argument groups cannot be nestedN)r:   r;   r   rH  r  r   rA   r  s   &  r   test_nested_argument_group/TestGroupConstructor.test_nested_argument_group  s:    ((*%%'z!C!"!5!5	7r   r&   N)	r)   r*   r+   r,   r  r  r  r.   r/   rR   s   @r   r  r    s     	007 7r   r  c                      a a ] tR tRt oRtR tV 3R ltR tR tR t	R t
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V ;t# )TestParentParsersi  z5Tests that parsers can be created with parent parsersc                :    V P                   ! \        .VO5/ VB  R # ra   r>  r   s   &*,r   r?  +TestParentParsers.assertArgumentParserError  rA  r   c                B  < \         SV `  4        \        R R7      V n        V P                  P	                  R4       V P                  P                  R4      pVP	                  R4       V P                  P	                  R4       \        R R7      V n        V P                  P	                  R4       V P                  P	                  R4       V P                  P                  R4      pVP	                  R	4       \        R R7      V n        V P                  P	                  R4       \        R R7      V n        V P                  P	                  R4       \        R R7      V n	        V P                  P                  4       pVP	                  R
RR7       VP	                  RRR7       R# )Fru  z--wr!  r5  r2  r  r  r  z--dr  r*  r+  N)r   r\   r   wxyz_parentr   r   abcd_parentw_parentz_parentab_mutex_parentadd_mutually_exclusive_group)r   x_groupc_groupr   r   s   &   r   r\   TestParentParsers.setUp  sC   5uE%%e,""55c:T"%%c*5uE%%c*%%d+""55c:U#2EB""5)2EB""3'  :5I$$AAC4545r   c           	         \        V P                  .R 7      pV P                  VP                  RP	                  4       4      \        RRRR7      4       R# )parentsz-y 1 2 --w 3r  rb  r  r{   r  r2  N)r   r'  r  rK   r	  r   r@   s   & r   test_single_parent$TestParentParsers.test_single_parent  sE    +T5E5E4FG**>+?+?+ABcSC0	2r   c                    V P                  V P                  P                  4       \        V P                  .R 7      pV P                  VP                  4       R# r1  N)_test_mutex_abr+  rK   r   r@   s   & r   test_single_parent_mutex*TestParentParsers.test_single_parent_mutex  sC    D00;;<+T5I5I4JKF--.r   c                    V P                   .p\        R VR7      p\        V.R7      pV P                  VP                  4       R# )F)ru  r2  r1  N)r+  r   r8  rK   r   r2  rA   s   &  r   test_single_grandparent_mutex/TestParentParsers.test_single_grandparent_mutex  s<    ''(+UGL+VH=F--.r   c                   V P                  V! . 4      \        R R R7      4       V P                  V! R.4      \        RR R7      4       V P                  V! R.4      \        R RR7      4       V P                  VRR.4       V P                  VRR.4       V P                  VR.4       V P                  VRR.4       V P                  VRR.4       R# )Fr  r  r  Tr  r  N)r  r   r?  )r   rK   s   &&r   r8   TestParentParsers._test_mutex_ab  s    Beu)=>TF+R$%-@ATF+R%4-@A&&zD$<@&&zD$<@&&zD6:&&zD$<@&&zD$<@r   c                    V P                   V P                  .p\        VR 7      pV P                  VP	                  RP                  4       4      \        RRRRRRR7      4       R# )r1  z--d 1 --w 2 3 4r  Nrb  r  r  )r  r  r  r{   r  r2  )r(  r'  r   r  rK   r	  r   r<  s   &  r   test_multiple_parents'TestParentParsers.test_multiple_parents  sZ    ##T%5%56+G<**+<+B+B+DEcTSC43G	Ir   c                p   V P                   V P                  .p\        VR 7      pV P                  VP	                  RP                  4       4      \        RRRRRR7      4       V P                  VP                  RP                  4       4       V P                  VP                  R	P                  4       4       R# )
r1  z
-a --w 2 3TFr  Nr  )r  r  r{   r  r2  z-a --w 2 3 -bz-a -b --w 2 3)r+  r'  r   r  rK   r	  r   r?  r<  s   &  r   test_multiple_parents_mutex-TestParentParsers.test_multiple_parents_mutex  s    '')9)9:+G<**<+=+=+?@desdcB	D&&446	8&&446	8r   c                    V P                  \        P                  \        P                  V P                  V P
                  .R 7       R# r7  )r
  r:   rI  r;   r)  r'  r$   s   &r   test_conflicting_parents*TestParentParsers.test_conflicting_parents  s9    ""##]]D$4$45 	 	7r   c                    V P                  \        P                  \        P                  V P                  V P
                  .R 7       R# r7  )r
  r:   rI  r;   r(  r+  r$   s   &r   test_conflicting_parents_mutex0TestParentParsers.test_conflicting_parents_mutex  s;    ""##%%t';';< 	 	>r   c           	         V P                   V P                  .p\        VR 7      pV P                  VP	                  RP                  4       4      \        RRRR7      4       R# )r1  rc  Nr  r3  )r'  r*  r   r  rK   r	  r   r<  s   &  r   test_same_argument_name_parents1TestParentParsers.test_same_argument_name_parents!  sM    ##T]]3+G<**5;;=9ddc2	4r   c           
        \        4       pVP                  4       pVP                  R V P                  .R7      pVP	                  R4       V P                  VP                  RP                  4       4      \        RRRRR7      4       R	# )
rl  r1  r   zbar -b 1 --d 2 3 4r  rb  r  r  )r  r  r  r   N)	r   r  r  r(  r   r  rK   r	  r   )r   rA   r  abcde_parsers   &   r   test_subparser_parents(TestParentParsers.test_subparser_parents'  sw    +-**,
!,,UT=M=M<N,O!!#&**+?+E+E+GHcSC37	9r   c                   \        4       pVP                  4       pV P                  .pVP                  R VR7      pVP	                  R4      pVP                  R4       V P                  V P                  .pVP                  RVR7      pVP                  R4       V P                  VP                  RP                  4       4      \        RRR	R
7      4       V P                  VP                  RP                  4       4      \        RRRRRR	R7      4       V P                  VP                  RP                  4       4       V P                  VP                  RP                  4       4       R# )r7   r1  r.  r  rl  r   zfoo -a 4TFr  r  zbar -b  --w 2 3 4r  Nr  )r  r  r{   r  r2  r   zfoo -a -b 4zbar -b -a 4)r   r  r+  r  r   r   r'  r  rK   r	  r   r?  )r   rA   r  r2  
abc_parserr.  wxyzabe_parsers   &      r   test_subparser_parents_mutex.TestParentParsers.test_subparser_parents_mutex/  s>   +-**,
''(**5'*B
//	:S!##T%9%9:#..ug.F##C(**:+;+;+=>des3	5**+>+D+D+FGetsdcSI	K&&}224	6&&}224	6r   c                    V P                   V P                  .p\        R VR7      pVP                  4       pV P	                  V\
        P                  ! R4      4       R# )rC  rE  r2  aH              usage: PROG [-h] [-b B] [--d D] [--w W] [-y Y] a z

            positional arguments:
              a
              z

            options:
              -h, --help  show this help message and exit
              -b B
              --w W

            c:
              --d D

            x:
              -y Y
        N)r(  r'  r   rA  r  r  r  )r   r2  rA   parser_helps   &   r   test_parent_help"TestParentParsers.test_parent_helpB  sR    ##T%5%56+I((*hoo 7 ' 	r   c                   \        R R7      pVP                  RRR7      pVP                  R4       VP                  R4       VP                  4       pVP                  R4       VP                  R4       \        R	V.R
7      pV P	                  \
        VP                  . RO4       VP                  4       pV P                  V\        P                  ! R4      4       R# )Fr&  r  gdrO  rF  r  r  r5  r0  rC  r[  z            usage: PROG [-h] [-w W] [-x X] [-y Y | -z Z]

            options:
              -h, --help  show this help message and exit
              -y Y
              -z Z

            g:
              gd

              -w W
              -x X
        Nr5  r  r0  r  r   r   r   r,  r
  r   rK   rA  r  r  r  r   parentr  r  rA   r\  s   &     r   test_groups_parents%TestParentParsers.test_groups_parentsY  s    +U;%%CT%B	t	t//1	t	t+&J-v/@/@"	$ ((*hoo 7 ' 	r   c                @    V P                  \        \        ^.R7       R# )r  r1  N)r
  r   r   r$   s   &r   test_wrong_type_parents)TestParentParsers.test_wrong_type_parentsv  s    )%?!Mr   c                   \        R R7      pVP                  RRR7      pVP                  R4       VP                  R4       VP                  4       pVP                  R4       VP                  R4       \        R	V.R
7      pV P	                  \
        VP                  . RO4       VP                  4       pV P                  V\        P                  ! R4      4       R# )Fr&  r  r`  ra  r  r  r5  r0  rC  r[  z            usage: PROG [-h] [-w W] [-x X] [-y Y | -z Z]

            options:
              -h, --help  show this help message and exit

            g:
              gd

              -w W
              -x X
              -y Y
              -z Z
        Nrb  rc  rd  s   &     r   test_mutex_groups_parents+TestParentParsers.test_mutex_groups_parentsy  s    +U;%%CT%B	t	t**,	t	t+&J-v/@/@"	$ ((*hoo 7 ' 	r   )r+  r(  r)  r'  r*  )r)   r*   r+   r,   r-   r?  r\   r4  r9  r=  r8  rC  rF  rI  rL  rO  rS  rX  r]  rf  ri  rl  r.   r/   r0   r1   s   @@r   r"  r"    sf     ?@642
/
/AI87>496&.:N r   r"  c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# ) TestMutuallyExclusiveGroupErrorsi  c                d    \        4       pV P                  pV! \        VP                  R R7       R# )r7   )rO  N)r   r
  r   r,  )r   rA   raisess   &  r   test_invalid_add_argument_group@TestMutuallyExclusiveGroupErrors.test_invalid_add_argument_group  s'    +-""y&==UKr   c                "   \        4       pVP                  4       pVP                  pV P                  pV! \        VR RR7       V! \        VR4       V! \        VRRR7       V! \        VR^R7       V! \        VR\
        P                  R7       R# )r%  Tr  rl  r  r  N)r   r,  r   r
  r  r:   PARSER)r   rA   r   r   rq  s   &    r   test_invalid_add_argument:TestMutuallyExclusiveGroupErrors.test_invalid_add_argument  sv    +-335))""z<4@z</z<c:z<a8z<hooFr   c                b   \        R R7      pVP                  4       pVP                  RRR7       VP                  RRR7       VP                  4       pVP                  RRR7       VP                  RRR7       R	pV P                  VP	                  4       \
        P                  ! V4      4       R
# )rC  r  r%  r*  r+  r_  r  z--soupz--nutsz            usage: PROG [-h] [--foo | --bar] [--soup | --nuts]

            options:
              -h, --help  show this help message and exit
              --foo
              --bar
              --soup
              --nuts
              Nr   r,  r   r  rA  r  r  )r   rA   group1group2r  s   &    r   r  *TestMutuallyExclusiveGroupErrors.test_help  s    +8446GL9GM:446H\:H];	 	++-xx/HIr   c                   \        R R7      pVP                  RR7      pVP                  R4       VP                  RRR7       RpV P                  VP	                  4       \
        P                  ! V4      4       \        R R7      pVP                  RR7      pVP                  RRR7       VP                  R4       V P                  VP	                  4       \
        P                  ! V4      4       R	# )
rC  r  Tr  r%  rl  r  r  z            usage: PROG [-h] (--foo FOO | bar)

            positional arguments:
              bar

            options:
              -h, --help  show this help message and exit
              --foo FOO
              Nry  )r   rA   r   r  s   &   r   test_optional_order4TestMutuallyExclusiveGroupErrors.test_optional_order  s    +833T3B7#5,	 	++-xx/HI+833T3B5,7#++-xx/HIr   c           	        R V n         \        RR7      pVP                  RRR7      pVP                  R4      pVP	                  4       pVP                  RR\        P                  R	7       VP                  R
R\        P                  R	7       RpRpVP                  V4       RV RV RV RV R2	pV P                  VP                  4       \        P                  ! V4      4       R # )NrC  r  rN  r  )rO  rR  r7   r  r*  rI  --quietz>            usage: PROG foo [-h]
                            [ zj]

            options:
              -h, --help            show this help message and exit
              z
              z--longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglongڀLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG)r  r   r  r  r,  r   r:   r  r  rA  r  r  )r   rA   rN  cmd_foor   longoptlongmetar  s   &       r   Ctest_help_subparser_all_mutually_exclusive_group_members_suppresseddTestMutuallyExclusiveGroupErrors.test_help_subparser_all_mutually_exclusive_group_members_suppressed  s    +8((z	(J%%e,446;|(BSBST9\@Q@QR"W%%Yaz 2 iq
 # 	,,.0IJr   c                    \         P                  ! 4       pVP                  4       pV P                  \        4      ;_uu_ 4        VP                  R .4       RRR4       R#   + '       g   i     R# ; i)rE   N)r:   r;   r,  r
  r  rK   r   rA   r   s   &  r   test_empty_group1TestMutuallyExclusiveGroupErrors.test_empty_group  sN    ((*335z**tf% +***s   A  A1	c                    \         P                  ! R R7      pVP                  4       pVP                  R4       V P	                  \
        RVP                  4       R# )rC  r  --spamz*mutually exclusive groups cannot be nestedN)r:   r;   r,  r   rH  r  r  s   &  r   test_nested_mutex_groups9TestMutuallyExclusiveGroupErrors.test_nested_mutex_groups  sH    ((f5//1	x zK ==	?r   )r  N)r)   r*   r+   r,   rr  rv  r  r~  r  r  r  r.   r/   rR   s   @r   ro  ro    s2     L
	GJ(J.K*&? ?r   ro  c                   x   a  ] tR tRt o R tR tR tR t]R 4       t	]R 4       t
]R 4       t]R	 4       tR
tV tR# )MEMixini  c           	        V P                  R R7      P                  p\        pV P                   FF  pV P	                  VR7      ;_uu_ 4        V P                  W!VP                  4       4       RRR4       KH  	  R#   + '       g   i     K]  ; iFr  r  N
get_parserrK   r   r  rL   r
  r	  r   rK   r   args_strings   &   r   test_failures_when_not_required'MEMixin.test_failures_when_not_required  sg    __e_4??
#==K;//!!%[5F5F5HI 0/ )///s   !A;;Bc           	     .   V P                  R R7      P                  p\        pV P                  R.,            FF  pV P	                  VR7      ;_uu_ 4        V P                  W!VP                  4       4       RRR4       KH  	  R#   + '       g   i     K]  ; i)Tr  r'   r  Nr  r  s   &   r   test_failures_when_required#MEMixin.test_failures_when_required  sq    __d_3>>
#==B4//K;//!!%[5F5F5HI 0/ 0///s   !BBc                J   V P                  R R7      P                  pV P                  V P                  ,           pV FO  w  r4V P	                  VR7      ;_uu_ 4        V! VP                  4       4      pV P                  WT4       RRR4       KQ  	  R#   + '       g   i     Kf  ; ir  )r  rK   r  successes_when_not_requiredrL   r	  r  )r   rK   r  r  r  	actual_nss   &     r    test_successes_when_not_required(MEMixin.test_successes_when_not_required  s}    __e_4??
NNT%E%EE	(1$K;//&{'8'8':;	  8 0/ )2///s   (BB"c                $   V P                  R R7      P                  pV P                   FO  w  r#V P                  VR7      ;_uu_ 4        V! VP	                  4       4      pV P                  WC4       RRR4       KQ  	  R#   + '       g   i     Kf  ; i)Tr  r  N)r  rK   r  rL   r	  r  )r   rK   r  r  r  s   &    r   test_successes_when_required$MEMixin.test_successes_when_required  sm    __d_3>>
(,$K;//&{'8'8':;	  8 0/ )7///s   (A>>Bc                    V P                  R R7      P                  pV P                  pV P                  V! 4       \        P
                  ! V4      4       R# Fr  N)r  r@  usage_when_not_requiredr  r  r  r   r@  expected_usages   &  r   test_usage_when_not_required$MEMixin.test_usage_when_not_required  s>    6CC55)HIr   c                    V P                  R R7      P                  pV P                  pV P                  V! 4       \        P
                  ! V4      4       R# Tr  N)r  r@  usage_when_requiredr  r  r  r  s   &  r   test_usage_when_required MEMixin.test_usage_when_required!  s>    5BB11)HIr   c                    V P                  R R7      P                  pV P                  V P                  ,           pV P	                  V! 4       \
        P                  ! V4      4       R# r  )r  rA  r  r?  r  r  r  r   rA  r?  s   &  r   test_help_when_not_required#MEMixin.test_help_when_not_required'  sG    oouo5AA++dii7(=>r   c                    V P                  R R7      P                  pV P                  V P                  ,           pV P	                  V! 4       \
        P                  ! V4      4       R# r  )r  rA  r  r?  r  r  r  r  s   &  r   test_help_when_requiredMEMixin.test_help_when_required-  sG    ooto4@@''$))3(=>r   r&   N)r)   r*   r+   r,   r  r  r  r  r   r  r  r  r  r.   r/   rR   s   @r   r  r    so     JJ99 J J
 J J
 ? ?
 ? ?r   r  c            	          a  ] tR tRt o RR ltRR.tR]! RRR7      3R	]! R
RR7      3R]! RRR7      3R]! RR
R7      3.tR]! RRR7      3.tRt	Rt
RtRtV tR# )TestMutuallyExclusiveSimplei4  Nc                    \        R R7      pVP                  VR7      pVP                  RRR7       VP                  RRRR	R
7       V# )rC  r  r  r_  rJ  r  r  r  r  baz help)r  r/  r?  r   r,  r   r   r  rA   r   s   &&  r   r  &TestMutuallyExclusiveSimple.get_parser6  sN    +833X3F747#SzJr   --bar X --baz Yz--bar X --baz--bar Xr[  rl  rm  z--bar X --bar Zr  --baz Yr  r  r'   z;        usage: PROG [-h] [--bar BAR | --baz [BAZ]]
        z;        usage: PROG [-h] (--bar BAR | --baz [BAZ])
        z
        options:
          -h, --help   show this help message and exit
          --bar BAR    bar help
          --baz [BAZ]  baz help
        r&   ra   r)   r*   r+   r,   r  r  r   r  r  r  r  r?  r.   r/   rR   s   @r   r  r  4  s      "?3H	B3D)*	B3D12	B4S)*	"3'(	I 
RDd#$#Dr   r  c                      a  ] tR tRt o RR ltR.tR]! RRRRR7      3R]! R	RRRR7      3R
]! RRRRR7      3R]! RR	RRR7      3.tR]! RRRRR7      3.tRt	Rt
RtRtV tR# )TestMutuallyExclusiveLongiW  Nc                    \        R R7      pVP                  RRR7       VP                  RRR7       VP                  VR7      pVP                  RR	R7       VP                  R
RR7       V# )rC  r  z--abcdez
abcde helpr  z--fghijz
fghij helpr  z--klmnoz
klmno helpz--pqrstz
pqrst helpr   r   r,  r  s   &&  r   r  $TestMutuallyExclusiveLong.get_parserY  sp    +8IL9IL933X3F9<89<8r   z--klmno X --pqrst Yz	--klmno Xr[  )abcdefghijklmnopqrstz--abcde Y --klmno Xr  z	--pqrst Xz--pqrst X --fghij Yr'   zi    usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ] [--klmno KLMNO |
                --pqrst PQRST]
    zi    usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ] (--klmno KLMNO |
                --pqrst PQRST)
    z
    options:
      -h, --help     show this help message and exit
      --abcde ABCDE  abcde help
      --fghij FGHIJ  fghij help
      --klmno KLMNO  klmno help
      --pqrst PQRST  pqrst help
    r&   ra   r  rR   s   @r   r  r  W  s      &&H	bt4s$GH	SCt<	>	bt4t3GH	TD<	>I 
Rd$d$?@#Dr   r  c                      a  ] tR tRt o R tR.tR]! RRR7      3R]! R	RR7      3R
]! RRR7      3.tR]! RRR7      3.tRt	Rt
RtRtV tR# )$TestMutuallyExclusiveFirstSuppressedi  c                    \        R R7      pVP                  VR7      pVP                  R\        P                  R7       VP                  RRRR7       V# )	rC  r  r  r  r  r5  r  rW  rI  r   r,  r   r:   r  r  s   &&  r   r  /TestMutuallyExclusiveFirstSuppressed.get_parser  sR    +833X3F4h&7&784HEr   z-x X -yz-x Xr[  Tr  z	-x X -x Yr  r5  NFr'   z&        usage: PROG [-h] [-y]
        z$        usage: PROG [-h] -y
        zm
        options:
          -h, --help  show this help message and exit
          -y          y help
        r&   r  rR   s   @r   r  r    sw      {H	cT"#	b3$'(	rDE"#I 
R$$ #Dr   r  c            
          a  ] tR tRt o R t. ROtR]! RRRR7      3R]! RRRR7      3R	]! RRR
R7      3R]! RRRR7      3.tR]! RRRR7      3.tR;t	t
RtRtV tR# )#TestMutuallyExclusiveManySuppressedi  c                    \        R R7      pVP                  VR7      pVP                  pV! RR\        P                  R7       V! RR\        P                  R7       V! R\        P                  R	7       V# )
rC  r  r  r  r*  rI  rX  r  z	--bladderr  r  )r   r  rA   r   ru  s   &&   r   r  .TestMutuallyExclusiveManySuppressed.get_parser  sc    +833X3F  H\0A0ABJ}83D3DEKh//0r   r  TN)r  rY  bladderrX  Fz--bladder Brj  z--spam --spamr'   z!        usage: PROG [-h]
        P
        options:
          -h, --help  show this help message and exit
        r&   )z--spam --badgerz--badger --bladder Bz--bladder B --spamr)   r*   r+   r,   r  r  r   r  r  r  r  r?  r.   r/   rR   s   @r   r  r    s     H 
24d;<	RU5$?@	dC@A	"$tTBC	I 
RU467#5 1Dr   r  c            
          a  ] tR tRt o R t. ROtR]! RR. R7      3R]! RR	. R7      3R
]! RRR
.R7      3R]! RR. ROR7      3.tR]! RR. R7      3.tRt	Rt
RtRtV tR# )*TestMutuallyExclusiveOptionalAndPositionali  c                    \        R R7      pVP                  VR7      pVP                  RRRR7       VP                  RRR	7       VP                  R
RRR7       V# )rC  r  r  r%  r*  FOOrI  r  SPAMr  rY  r  BADGERr[  r  r  s   &&  r   r  5TestMutuallyExclusiveOptionalAndPositional.get_parser  sa    +833X3F7<eD8&183X>r   r%  TNr7   r  rY  z--spam SFSr[  zX Y Zr'   zD        usage: PROG [-h] [--foo | --spam SPAM | badger ...]
        zD        usage: PROG [-h] (--foo | --spam SPAM | badger ...)
        z
        positional arguments:
          badger       BADGER

        options:
          -h, --help   show this help message and exit
          --foo        FOO
          --spam SPAM  SPAM
        r&   )z--foo --spam Sz
--spam S XzX --foozX Y Z --spam S	--foo X Yr[  r  r  r  rR   s   @r   r  r    s     H 
"D45	REB78	bUse45	"T/BC	I 
RER01#	Dr   r  c                   >  a  ] tR tRt o R t. ROtR]! RRRRRR7      3R]! RRRRRR7      3R]! RRRRRR7      3R	]! RRRRRR7      3R
]! RRRRRR7      3R]! RRRRRR7      3.tR]! RRRRRR7      3R]! RRRRRR7      3R]! RRRRRR7      3.tR;t	t
RtRtV tR# )#TestMutuallyExclusiveOptionalsMixedi  c                
   \        R R7      pVP                  RRRR7       VP                  VR7      pVP                  RRRR7       VP                  R	RR
R7       VP                  RRRR7       VP                  RRRR7       V# )rC  r  r  r*  rV  rI  r  r  a helpr  b helpr5  rW  r  c helpr  r  s   &&  r   r  .TestMutuallyExclusiveOptionalsMixed.get_parser  s    +8DHE33X3F48D48DDHE48Dr   r  TFr  r  r  r!  r  r  r  z-a -xz-y -bz-x -y -cr'   r  r5  z:        usage: PROG [-h] [-x] [-a] [-b] [-y] [-c]
        z
        options:
          -h, --help  show this help message and exit
          -x          x help
          -a          a help
          -b          b help
          -y          y help
          -c          c help
        r&   N)z-a -b-b -cz-a -cz-a -b -cr  rR   s   @r   r  r    s      7H	rDEUeu=>	rETUeu=>	rEUdeu=>	"tu?@	"u$?@	R%5DDDABI 
R%5EUe<=	rEUetu=>	rEUeu=>#5 1	Dr   r  c                      a  ] tR tRt o RR ltRR.tR]! RRR7      3R	]! RR
R7      3.tR]! RRR7      3.tRt	Rt
RtRtV tR# )TestMutuallyExclusiveInGroupi  Nc                    \        R R7      pVP                  RRR7      pVP                  VR7      pVP                  RRR7       VP                  R	R
R7       V# )rC  r  zTitled groupzGroup descriptionra  r  r_  rJ  r  r  r  )r   r   r,  r   )r   r  rA   titled_groupmutex_groups   &&   r   r  'TestMutuallyExclusiveInGroup.get_parser   sk    +800 .A 1 C 55x5H 	  z :  z :r   r  z--baz X --bar Yr  r[  r  r  r  r'   z9        usage: PROG [-h] [--bar BAR | --baz BAZ]
        z9        usage: PROG [-h] (--bar BAR | --baz BAZ)
        z
        options:
          -h, --help  show this help message and exit

        Titled group:
          Group description

          --bar BAR   bar help
          --baz BAZ   baz help
        r&   ra   r  rR   s   @r   r  r    sl      "#45H	B3D)*	B4S)*I
 
RDd#$#
Dr   r  c                     a  ] tR tRt o R t. ROtR]! RRRRRR7      3R]! R	R
RRRR7      3R]! R	RR
RRR7      3R]! RRRRR
R7      3R]! R	R
RRR
R7      3.tR]! R	RRRRR7      3R]! R	RRRR
R7      3.tR;t	t
RtRtV tR	# )1TestMutuallyExclusiveOptionalsAndPositionalsMixediF  c                   \        R R7      pVP                  RRR7       VP                  RRRR7       VP                  VR	7      pVP                  R
RRR7       VP                  RRRR7       VP                  RRRR7       V# )rC  r  r!  rV  r  r5  r*  rW  rI  r  r  r  r  r[  r  r  r  r  r  r  s   &&  r   r  <TestMutuallyExclusiveOptionalsAndPositionalsMixed.get_parserH  s    +8Ch/DHE33X3F3c948D48Dr   zX Ar  Fr[  r  zX -bNTzX -czX A -yzX -y -bzX -yz6        usage: PROG [-h] [-y] [-b] [-c] x [a]
        a   
        positional arguments:
          x           x help
          a           a help

        options:
          -h, --help  show this help message and exit
          -y          y help
          -b          b help
          -c          c help
        r&   )zX A -br  z-c X Ar  rR   s   @r   r  r  F  s      -H	SEUcU;<	ddese<=	detse<=	2u=>	B#>?I 
b45ESE:;	deut<=#
5 1Dr   r  c                      a  ] tR tRt o RR ltRR.tR]! RRR7      3R	]! RRR7      3R
]! RRR7      3.tR]! RRR7      3.tRt	Rt
RtRtV tR# )%TestMutuallyExclusiveOptionalOptionalip  Nc                    \        R R7      pVP                  VR7      pVP                  R4       VP                  RRR7       V# )rC  r  r  r%  r_  r  r  r  r  s   &&  r   r  0TestMutuallyExclusiveOptionalOptional.get_parserq  sE    +833X3F7#7#.r   --foo X --bar Yz--foo X --bar--foo Xr[  rf  r  r_  r'   z;        usage: PROG [-h] (--foo FOO | --bar [BAR])
        z;        usage: PROG [-h] [--foo FOO | --bar [BAR]]
        z{
        options:
          -h, --help   show this help message and exit
          --foo FOO
          --bar [BAR]
        r&   ra   r  rR   s   @r   r  r  p  s      	H
 
B3D)*	B4S)*	"4()I 
RDd#$#Dr   r  c                      a  ] tR tRt o RR ltRR.tR]! RRR	7      3R
]! RRR	7      3R]! RRR	7      3.tR]! RRR	7      3.tRt	Rt
RtRtV tR# )(TestMutuallyExclusiveOptionalWithDefaulti  Nc                    \        R R7      pVP                  VR7      pVP                  R4       VP                  R\        RR7       V# )rC  r  r  r%  r_  Trh  r   r,  r   boolr  s   &&  r   r  3TestMutuallyExclusiveOptionalWithDefault.get_parser  sG    +833X3F7#7t<r   r  z--foo X --bar=r  r[  Trf  r  z--bar=Fr'   z9        usage: PROG [-h] (--foo FOO | --bar BAR)
        z9        usage: PROG [-h] [--foo FOO | --bar BAR]
        zx
        options:
          -h, --help  show this help message and exit
          --foo FOO
          --bar BAR
        r&   ra   r  rR   s   @r   r  r    s      	H
 
B3D)*	B4T*+	2$E*+I 
RDd#$#Dr   r  c                      a  ] tR tRt o RR ltR.tR]! RRR7      3R]! RRR7      3.tR	]! RRR7      3.tR
t	Rt
RtRtV tR# )*TestMutuallyExclusivePositionalWithDefaulti  Nc                    \        R R7      pVP                  VR7      pVP                  R4       VP                  RR\        RR7       V# )rC  r  r  r%  rl  r  Tr  r  r  s   &&  r   r  5TestMutuallyExclusivePositionalWithDefault.get_parser  sI    +833X3F7#5$Er   r  r  r[  Trf  r'   z3        usage: PROG [-h] (--foo FOO | bar)
        z3        usage: PROG [-h] [--foo FOO | bar]
        z
        positional arguments:
          bar

        options:
          -h, --help  show this help message and exit
          --foo FOO
        r&   ra   r  rR   s   @r   r  r    sm      	H 
B3D)*	bTt$%I
 
RDd#$#Dr   r  c                   6   a a ] tR tRt oRV 3R lltRtVtV ;t# )MEPBasei  c                b   < \         \        V `  VR 7      p\        VP                  RV.R7      pV# )r  F)rE  ru  r2  )r   r	  r  r   rE  )r   r  re  rA   r   s   &&  r   r  MEPBase.get_parser  s4    w0(0C+uvh@r   r&   ra   )r)   r*   r+   r,   r  r.   r/   r0   r1   s   @@r   r	  r	    s      r   r	  c                       ] tR tRtRtR# )&TestMutuallyExclusiveGroupErrorsParenti  r&   Nr0  r&   r   r   r  r        r   r  c                       ] tR tRtRtR# )!TestMutuallyExclusiveSimpleParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                       ] tR tRtRtR# )TestMutuallyExclusiveLongParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                       ] tR tRtRtR# )*TestMutuallyExclusiveFirstSuppressedParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                       ] tR tRtRtR# ))TestMutuallyExclusiveManySuppressedParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                       ] tR tRtRtR# )0TestMutuallyExclusiveOptionalAndPositionalParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                       ] tR tRtRtR# ))TestMutuallyExclusiveOptionalsMixedParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                       ] tR tRtRtR# )7TestMutuallyExclusiveOptionalsAndPositionalsMixedParenti  r&   Nr0  r&   r   r   r  r    r  r   r  c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )TestSetDefaultsi  c                   \        4       pVP                  R R7       VP                  R^R7       V P                  \        R R^R7      VP	                  . 4      4       V P                  \        R R^R7      VP	                  . \        4       4      4       V P                  \        RR^R7      VP	                  . \        RR7      4      4       V P                  \        RR^R7      VP	                  . \        R^R7      4      4       R# )r7   r   rl  )r  r2  r  rm  )r!  r2  Nr   set_defaultsr  r   rK   r@   s   & r   test_set_defaults_no_args)TestSetDefaults.test_set_defaults_no_args  s    +-e$eq)eu2**2.	0eu2**2rt4	6eu2**2rE{;	=eu2**2rEQ/?@	Br   c           
        \        4       pVP                  R RR7       VP                  RRR7       V P                  \	        RRR7      VP                  . 4      4       V P                  \	        RRR7      VP                  . \	        4       4      4       V P                  \	        RRR7      VP                  . \	        RR7      4      4       V P                  \	        RRR7      VP                  R	P                  4       4      4       V P                  \	        RRR7      VP                  R	P                  4       \	        4       4      4       V P                  \	        RRR7      VP                  R	P                  4       \	        RR7      4      4       R
# )r7   rl  r  r  xfooxr  rm  r   rb  r  N)r   r!  r   r  r   rK   r	  r@   s   & r   test_set_defaults_with_args+TestSetDefaults.test_set_defaults_with_args  s6   +-eu-D'2g/**2.	0g/**2rt4	6eu-**2rE{;	=cU+**6<<>:	<cU+**6<<>24@	BcU+**6<<>2;G	Ir   c                   \        4       pVP                  R R7       VP                  4       pVP                  R4      pVP                  RR7       V P	                  \        R RR7      VP                  RP                  4       4      4       R# )r7   r   r  rl  r  r  N)r   r!  r  r  r  r   rK   r	  )r   rA   r  parser_as   &   r   test_set_defaults_subparsers,TestSetDefaults.test_set_defaults_subparsers0  su    +-e$**,
((-&eu-**399;7	9r   c                    \        R R7      pVP                  RR7       \        V.R7      pV P                  \        RR7      VP	                  . 4      4       R# )Fr&  r7   r   r1  Nr   )r   re  rA   s   &  r   test_set_defaults_parents)TestSetDefaults.test_set_defaults_parents9  sH    +U;e$+VH=ef&7&7&;<r   c                   \         P                  ! 4       pVP                  4       P                  R 4      pVP	                  ^R7       VP	                  ^R7       V P                  \        ^R7      VP                  R .4      4       R# )r[  r9  N)r:   r;   r  r  r!  r  r   rK   )r   rA   xparsers   &  r   )test_set_defaults_on_parent_and_subparser9TestSetDefaults.test_set_defaults_on_parent_and_subparser?  sl    ((*'')44S9"#F$5$5se$<=r   c           	        \        4       pVP                  R RRRR7       VP                  R4       VP                  RRR7       VP                  R	R
R7       VP                  RR
RR7       V P                  \	        R RRRR7      VP                  . 4      4       VP                  RRRRR7       V P                  \	        RRRRR7      VP                  . 4      4       R# )Wr[  r  r  r  r  r  XXr  r  r  r  r2  ZZr  WWYYN)r   r!  r   r  r   rK   r@   s   & r   &test_set_defaults_same_as_add_argument6TestSetDefaults.test_set_defaults_same_as_add_argumentF  s    +-cSC37D!D$/Cs+CsD9 	cTSD9**2.	0 	dcTS9dcTS9**2.	0r   c           	        \        4       pVP                  R RRRR7       VP                  R4      pVP                  R4       VP                  RRR	7       VP                  R
RR7       VP                  RRRR7       V P	                  \        R RRRR7      VP                  . 4      4       VP                  RRRRR7       V P	                  \        RRRRR7      VP                  . 4      4       R# )r4  r[  r  r  r  r7   r  r  r5  r  r  r  r  r2  r6  r  r7  r8  N)r   r!  r   r   r  r   rK   r  s   &  r   ,test_set_defaults_same_as_add_argument_group<TestSetDefaults.test_set_defaults_same_as_add_argument_groupW  s    +-cSC37))%04 4.3c*3c48 	cTSD9**2.	0 	dcTS9dcTS9**2.	0r   r&   N)r)   r*   r+   r,   r"  r&  r*  r-  r1  r9  r<  r.   r/   rR   s   @r   r  r    s/     BI"9=>0"0 0r   r  c                   &   a  ] tR tRt o R tRtV tR# )TestGetDefaultin  c                   \        4       pV P                  VP                  R 4      4       V P                  VP                  R4      4       VP                  R4       V P                  VP                  R 4      4       V P                  VP                  R4      4       VP                  R\        ^*R7       V P                  VP                  R 4      4       V P                  ^*VP                  R4      4       VP                  RR7       V P                  RVP                  R 4      4       V P                  ^*VP                  R4      4       R# )r7   rl  r%  r_  rh  rY  r9  N)r   r  get_defaultr   r  r  r!  r@   s   & r   test_get_defaultTestGetDefault.test_get_defaultp  s   +-&,,U34&,,U34G$&,,U34&,,U34G#r:&,,U34V//67)6#5#5e#<=V//67r   r&   N)r)   r*   r+   r,   rB  r.   r/   rR   s   @r   r?  r?  n  s     8 8r   r?  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestNamespaceContainsSimplei  c                x    \         P                  ! 4       pV P                  R V4       V P                  RV4       R# )r'   r!  N)r:   	NamespaceassertNotInr   nss   & r   
test_empty&TestNamespaceContainsSimple.test_empty  s0    !R b!r   c                    \         P                  ! ^^R7      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       R# )r  r  r'   r!  r  xxr2  N)r:   rG  rH  r  rI  s   & r   test_non_empty*TestNamespaceContainsSimple.test_non_empty  s`    !q)R c2c2r"b!r   r&   N)r)   r*   r+   r,   rK  rO  r.   r/   rR   s   @r   rE  rE    s     "
" "r   rE  c                   &   a  ] tR tRt o R tRtV tR# )TestHelpFormattingMetaclassi  c                ^    VR 8X  d   R#  ! R R\         4      pR F  w  rVV! WV4       K  	  R# )HelpTestCaseNc                   b   a  ] tR tRt o R tR tR t]R 4       t]R 4       t	]R 4       t
RtV tR	# )
6TestHelpFormattingMetaclass.__init__.<locals>.AddTestsi  c                    W n         W0n        V P                  V P                  V P                  3 F/  pVP
                  : R V: 2pV3R lp WVn        \        WV4       K1  	  R#   \         d     Li ; i)r   c                     V! V 4       R # ra   r&   r   s   &&r   test_wrapperUTestHelpFormattingMetaclass.__init__.<locals>.AddTests.__init__.<locals>.test_wrapper  r   r   N)func_suffixstd_nametest_format
test_printtest_print_filer)   r   r   )r   
test_classr[  r\  r   r   rY  s   &&&&   r   r   ?TestHelpFormattingMetaclass.__init__.<locals>.AddTests.__init__  sw    #.  ("&"2"2"&//"&"6"6"8I ,5+=+={ KI5> (09- J<@"8 % s   A%%A32A3c                x   \         P                  ! VP                  P                  / VP                  P                  B p\        VR . 4       F)  pVP                  ! VP                  / VP                  B  K+  	  \        VR. 4      pV FZ  w  rVVP                  ! VP                  / VP                  B pV F)  pVP                  ! VP                  / VP                  B  K+  	  K\  	  \        VR. 4      pV'       d@   VP                  4       p	V F)  p
V	P                  ! V
P                  / V
P                  B  K+  	  V# )r   argument_group_signaturessubparsers_signatures)
r:   r;   r   r   r   r   r   r   r  r  )r   r  rA   argument_sig
group_sigs	group_sigargument_sigsr   subparsers_sigsr  subparser_sigs   &&         r   r  BTestHelpFormattingMetaclass.__init__.<locals>.AddTests._get_parser  s=   !00,,116--446 %,F4I2$NL''):): ?*6*=*=? %O %V-H"M
0:,I"55y~~ J8A8H8HJE(5**L,=,= B-9-@-@B )6 1; #*&2I2"N"!'!6!6!8J)8"--}/A/A G1>1E1EG *9 r   c                    \        WP                  4      p\        P                  ! V4      pR Vn        VP                  W24       R # ra   )r   r[  r  r  r  r  )r   r  parser_textexpected_texts   &&& r   _test<TestHelpFormattingMetaclass.__init__.<locals>.AddTests._test  s5     '0@0@ A ( >!%""=>r   c                    V P                  V4      p\        VR V P                  ,          4      pV P                  W! 4       4       R# )z	format_%sN)r  r   r[  ro  )r   r  rA   formats   &&  r   r]  BTestHelpFormattingMetaclass.__init__.<locals>.AddTests.test_format  s9    ))&1 t7G7G)GH

668,r   c                   V P                  V4      p\        VR V P                  ,          4      p\        \        V P                  4      p\        \        V P                  \        4       4        V! 4        \        \        V P                  4      P                  4       p\        \        V P                  V4       V P                  W4       R#   \        \        T P                  T4       i ; izprint_%sN)	r  r   r[  r   r\  r   r   r"   ro  )r   r  rA   print_
old_streamrm  s   &&    r   r^  ATestHelpFormattingMetaclass.__init__.<locals>.AddTests.test_print  s    ))&1 d6F6F)FG$S$--8
T]]KM:<H")#t}}"="F"F"HKC
;

6/ C
;s   -/C
 
C'c                    V P                  V4      p\        VR V P                  ,          4      p\        4       pV! V4       VP	                  4       pV P                  W4       R# ru  )r  r   r[  r   r"   ro  )r   r  rA   rv  sfilerm  s   &&    r   r_  FTestHelpFormattingMetaclass.__init__.<locals>.AddTests.test_print_file  sO    ))&1 d6F6F)FG#u#nn.

6/r   )r[  r\  N)r)   r*   r+   r,   r   r  ro  r   r]  r^  r_  r.   r/   rR   s   @r   r  rV    sQ     A",? !- !-
 !
0 !
0 !0 !0r   r  ))rG  r   )r?  r   )r  )r  rw   r  r  r  r[  r\  s   &&&&   r   r   $TestHelpFormattingMetaclass.__init__  s5    >!I	0v I	0X&:!KSx0&:r   r&   Nr   rR   s   @r   rR  rR    s     R1 R1r   rR  rT  c            	           ] tR tRtRt]! RRRR7      t]! RRR	R
R7      ]! RRRR7      ]! RRR7      ]! RRR7      ]! RRR7      .t. tRt	]	R,           t
RtRtR# )TestHelpBiggerOptionalsi  ;Make sure that argument help aligns when options are longerrC  DESCRIPTIONEPILOGrE  rF  epilogr  r  r  0.1r  r  r*  X HELPrI  --yY HELPr  r7   FOO HELPrl  BAR HELPz;        usage: PROG [-h] [-v] [-x] [--y Y] foo bar
        aW  
        DESCRIPTION

        positional arguments:
          foo            FOO HELP
          bar            BAR HELP

        options:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
          -x             X HELP
          --y Y          Y HELP

        EPILOG
            0.1
        r&   Nr)   r*   r+   r,   r-   r   r   r   rc  rG  r?  r  r.   r&   r   r   r~  r~    s    EM"*, 	D+i?DH5E!E
#E
# !#E   D Gr   r~  c                      a  ] tR tRt o RtR t]P                  t]P                  t]P                  t	Rt
]
R,           t]P                  tRtV tR# )TestShortColumnsi  zTest extremely small number of columns.

TestCase prevents "COLUMNS" from being too small in the tests themselves,
but we don't want any exceptions thrown in such cases. Only ugly representation.
c                r    V P                  \        P                  ! 4       4      pVP                  R R4       R# )rW   r  N)rX   r   rY   r  rZ   s   & r   r\   TestShortColumns.setUp  s)    	 = = ?@	4 r   z        usage: PROG
               [-h]
               [-v]
               [-x]
               [--y Y]
               foo
               bar
        a  
        DESCRIPTION

        positional arguments:
          foo
            FOO HELP
          bar
            BAR HELP

        options:
          -h, --help
            show this
            help
            message and
            exit
          -v, --version
            show
            program's
            version
            number and
            exit
          -x
            X HELP
          --y Y
            Y HELP

        EPILOG
    r&   N)r)   r*   r+   r,   r-   r\   r~  r   r   rc  rG  r?  r  r.   r/   rR   s   @r   r  r    sZ     
! #:"J"J"9"M"M"9"S"SE   D: #:"A"AGr   r  c            	           ] tR tRtRt]! RRRR7      t]! RRR	R
R7      ]! RRRR7      ]! RRR7      ]! RRR7      ]! RRR7      .t]! RRR7      ]! RRR7      ]! RRRR7      .3.tR t	]	R!,           t
R"tR#tR$# )%TestHelpBiggerOptionalGroupsiL  r  rC  r  r  r  r  r  r  r  r  r  r*  r  rI  r  r  r  r7   r  rl  r  zGROUP TITLEzGROUP DESCRIPTIONrQ  rm  zBAZ HELPr0  r  zZ HELPr[  zN        usage: PROG [-h] [-v] [-x] [--y Y] [-z Z [Z ...]] foo bar baz
        a  
        DESCRIPTION

        positional arguments:
          foo            FOO HELP
          bar            BAR HELP

        options:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
          -x             X HELP
          --y Y          Y HELP

        GROUP TITLE:
          GROUP DESCRIPTION

          baz            BAZ HELP
          -z Z [Z ...]   Z HELP

        EPILOG
    r  r&   Nr  r&   r   r   r  r  L  s    EM"*, 	D+i?DH5E!E
#E
# 
](;	<J'Ch/?1 	2!
E   D,Gr   r  c                       ] tR tRtRt]! RRR7      t]! RRRR	7      ]! R
RR7      ]! RRR7      ]! RRR7      .t. tRt	]	R,           t
RtRtR# )TestHelpBiggerPositionalsi{  z4Make sure that help aligns when arguments are longerUSAGEr  rG  rF  r  r*  r  rI  r  r  r  ekiekiekifekangzEKI HELPrl  r          usage: USAGE
        a  
        DESCRIPTION

        positional arguments:
          ekiekiekifekang  EKI HELP
          bar              BAR HELP

        options:
          -h, --help       show this help message and exit
          -x               X HELP
          --y Y            Y HELP
        r'   r&   Nr  r&   r   r   r  r  {  sl    >mDDH5E!J/E
#	 !#E   D Gr   r  c                       ] tR tRtRt]! RRR7      t]! RRRR	7      ]! R
RRR	7      .t]! RRR7      ]! RRRR7      .3.tRt	]	R,           t
RtRtR# )TestHelpReformattingi  >Make sure that text after short names starts on the first linerC  ze   oddly    formatted
description

that is so long that it should go onto multiple lines when wrappedr  r  r5  zoddly
    formatted -x helprM  r?  r  r1  znormal y helprO  z'
    oddly formatted group

descriptionrQ  r  r*  z` oddly 
formatted    -a  help  
    again, so long that it should be wrapped over multiple linesrI  2        usage: PROG [-h] [-x XX] [-a] yyy
        a  
        oddly formatted description that is so long that it should go onto multiple
        lines when wrapped

        positional arguments:
          yyy         normal y help

        options:
          -h, --help  show this help message and exit
          -x XX       oddly formatted -x help

        title:
          oddly formatted group description

          -a          oddly formatted -a help again, so long that it should be wrapped
                      over multiple lines
        r'   r&   Nr  r&   r   r   r  r    s    H)* 	D$ &= 	>C_5 
W #0 
1 d<$% 
&		'
!E   D( Gr   r  c                       ] tR tRtRt]! RRR7      t]! RRRR7      ]! RR	RR7      .t]! R
4      ]! RRRR7      .3.tRt	]	R,           t
RtRtR# )TestHelpWrappingShortNamesi  r  rC  r  r  r5  r  r  r1  ALPHASr  r*  rI  r  a  
        D DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD
        DD DD DD DD D

        positional arguments:
          yyy         YH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH
                      YHYH YHYH YHYH YHYH YHYH YHYH YHYH YH

        options:
          -h, --help  show this help message and exit
          -x XX       XHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH
                      HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HX

        ALPHAS:
          -a          AHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH
                      HHAAHHH HHAAHHH HHA
        r'   r&   NzZD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DD
DzxXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXdYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHzPAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAr  r&   r   r   r  r    sz    H[AD$]3C\2
 
X\@B 	C!E   D, Gr   r  c                       ] tR tRtRt]! RRR7      t]! RRRRR7      ]! R	RRR
7      ]! RRRR
7      .t]! R4      ]! RRRR
7      ]! RRRR
7      .3.tRt	]	R,           t
RtRtR# )TestHelpWrappingLongNamesi  z<Make sure that text after long names starts on the next liner  r  r  r  r  r  r  r  r  r  r  r2  r  ag  
        D DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD
        DD DD DD DD D

        positional arguments:
          yyyyyyyyyyyyyyyyyyyyyyyyy
                                YH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH
                                YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YH

        options:
          -h, --help            show this help message and exit
          -v, --version         show program's version number and exit
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
                                XH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH
                                XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XH

        ALPHAS:
          -a AAAAAAAAAAAAAAAAAAAAAAAAA
                                AH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH
                                AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AH
          zzzzzzzzzzzzzzzzzzzzzzzzz
                                ZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH
                                ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZH
        zs        V VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV
        VV VV VV VV V
        r&   NzZD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DzZV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VXXXXXXXXXXXXXXXXXXXXXXXXXzdXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHyyyyyyyyyyyyyyyyyyyyyyyyyr  AAAAAAAAAAAAAAAAAAAAAAAAAzdAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHzzzzzzzzzzzzzzzzzzzzzzzzzzdZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHr  r&   r   r   r  r    s    FzBD+iDD(6C5 
Xh\:XL9; 	<!
E   D<Gr   r  c                      ] tR tRtRt]! RR7      t]! RRRR7      ]! R	R
RR7      ]! RRR7      ]! RR^R7      ]! RRRR7      ]! RR]P                  R7      ]! RRR]P                  R7      ]! RRR]P                  R7      ]! R]P                  ]P                  RR7      .	t
]! R 4      ]! R!RR"R7      ]! R#^R$R7      ]! R%R%R
R7      ]! R&R&RR7      .3.tR't]R(,           tR)tR*tR+# ),TestHelpUsagei,  Test basic usage messagesrC  r  r  r  r{   r[  r  r  r!  r  r  r  )r?  r  r  r  r%  zWhether to foor?  r,  r_  zWhether to barT)r?  r  r,  r>  z--foobarz--barfoor+  z--bazzzBazz!)r,  r  r?  r   r5  r  r0  r2  r  r   a/          usage: PROG [-h] [-w W [W ...]] [-x [X ...]] [--foo | --no-foo]
                    [--bar | --no-bar]
                    [-f | --foobar | --no-foobar | --barfoo | --no-barfoo]
                    [--bazz | --no-bazz] [-y [Y]] [-z Z Z Z]
                    a b b [c] [d ...] e [e ...]
        az  
        positional arguments:
          a                     a
          b                     b
          c                     c

        options:
          -h, --help            show this help message and exit
          -w W [W ...]          w
          -x [X ...]            x
          --foo, --no-foo       Whether to foo
          --bar, --no-bar       Whether to bar
          -f, --foobar, --no-foobar, --barfoo, --no-barfoo
          --bazz, --no-bazz     Bazz!

        group:
          -y [Y]                y
          -z Z Z Z              z
          d                     d
          e                     e
        r'   r&   N)r)   r*   r+   r,   r-   r   r   r:   r  r  r   rc  rG  r?  r  r.   r&   r   r   r  r  ,  s   #'D#&D#&CcCc#Cc%G*83Q3QRG*D$::	<D*j1O1OPHX;;&//g	? 
WCc*AC(#S)#S)	
 	!E   D, Gr   r  c                   l    ] tR tRt]! RR7      t]! RRR7      ]! RRR	R7      .tR
t]R,           tRt	Rt
R# )TestHelpUsageWithParenthesesie  rC  r  
positionalz(example) positionalrM  r  z
--optionalz{1 (option A), 2 (option B)}zX        usage: PROG [-h] [-p {1 (option A), 2 (option B)}] (example) positional
        z
        positional arguments:
          (example) positional

        options:
          -h, --help            show this help message and exit
          -p, --optional {1 (option A), 2 (option B)}
        r'   r&   Nr)   r*   r+   r,   r   r   r   rG  r?  r  r.   r&   r   r   r  r  e  sL    'L"89D,(FG
E   D Gr   r  c                       ] tR tRtRt]! RRR7      t. t]! R4      ]! RRR	7      ]! R
R
R	7      .3]! R4      ]! RRR	7      ]! RRR	7      .3.tRt	]	R,           t
RtRtR# )TestHelpOnlyUserGroupsi{  r  rC  FrE  ru  xxxxr  r!  r  r  yyyyr  r5  r  z.        usage: PROG [-x X] [-y Y] a b
        zn
        xxxx:
          -x X  x
          a     a

        yyyy:
          b     b
          -y Y  y
        r'   r&   Nr  r&   r   r   r  r  {  s    #7	V3#
 	 
V#3
 		!E  	 	D Gr   r  c                       ] tR tRtRt]! RR7      t]! RRR7      ]! RRR7      ]! R	4      ]! R
4      .t. tRt	]	R,           t
RtRtR# )TestHelpUsageLongProgi  z*Test usage messages where the prog is longr  r  r4  r  r  r[  r  r  zz        usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
               [-h] [-w W] [-x X] a b
        z
        positional arguments:
          a
          b

        options:
          -h, --help  show this help message and exit
          -w W
          -x X
        r'   r&   N<PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPr  r&   r   r   r  r    sa    4)D#D#CC	 !#E  
 
D Gr   r  c                       ] tR tRtRt]! RR7      t]! RRR7      ]! RRR7      ]! RRR7      ]! RRR7      ]! R	4      ]! R
4      .t. tRt	]	R,           t
RtRtR# ) TestHelpUsageLongProgOptionsWrapi  zATest usage messages where the prog is long and the optionals wrapr  r  r  r  r5  r0  r  r  a          usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
               [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] [-x XXXXXXXXXXXXXXXXXXXXXXXXX]
               [-y YYYYYYYYYYYYYYYYYYYYYYYYY] [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
               a b
        a-  
        positional arguments:
          a
          b

        options:
          -h, --help            show this help message and exit
          -w WWWWWWWWWWWWWWWWWWWWWWWWW
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        r'   r&   Nr  WWWWWWWWWWWWWWWWWWWWWWWWWr  YYYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZZZZZr  r&   r   r   r  r    su    K)D(#D(#D(#D(#CC !#E   D Gr   r  c                   z    ] tR tRtRt]! R
RR7      t]! R4      ]! R4      ]! R4      .t. tRt	]	R,           t
RtRtR	# )$TestHelpUsageLongProgPositionalsWrapi  zCTest usage messages where the prog is long and the positionals wrapFr  z        usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
               aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
               ccccccccccccccccccccccccc
        
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc
        r'   r&   Nr  aaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccr  r&   r   r   r  r    sV    M59HHH
 !#E
   D Gr   r  c            	           ] tR tRtRt]! RR7      t]! RRR7      ]! RRR7      ]! RRR7      ]! R	RR7      ]! R
4      ]! R4      ]! R4      .t. tRt	]	R,           t
RtRtR# )TestHelpUsageOptionalsWrapi  z,Test usage messages where the optionals wraprC  r  r  r  r  r5  r0  r  r  r  z        usage: PROG [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] [-x XXXXXXXXXXXXXXXXXXXXXXXXX]
                    [-y YYYYYYYYYYYYYYYYYYYYYYYYY] [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
                    a b c
        a9  
        positional arguments:
          a
          b
          c

        options:
          -h, --help            show this help message and exit
          -w WWWWWWWWWWWWWWWWWWWWWWWWW
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        r'   r&   Nr  r  r  r  r  r&   r   r   r  r    s|    6'D(#D(#D(#D(#CCC !#E   D Gr   r  c                       ] tR tRtRt]! RR7      t]! R4      ]! R4      ]! R4      ]! R4      ]! R4      ]! R4      .t. tRt	]	R	,           t
R
tRtR# )TestHelpUsagePositionalsWrapi  z.Test usage messages where the positionals wraprC  r  r  r5  r0  z        usage: PROG [-h] [-x X] [-y Y] [-z Z]
                    aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
                    ccccccccccccccccccccccccc
        a  
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc

        options:
          -h, --help            show this help message and exit
          -x X
          -y Y
          -z Z
        r'   r&   Nr  r  r  r  r&   r   r   r  r    si    8'D	D	D	HHH !#E
   D Gr   r  c                       ] tR tRtRt]! RR7      t]! RRR7      ]! RRR7      ]! RRR7      ]! R4      ]! R4      ]! R4      .t. tR	t	]	R
,           t
RtRtR# )%TestHelpUsageOptionalsPositionalsWrapi<  z<Test usage messages where the optionals and positionals wraprC  r  r  r  r5  r0  a          usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] [-y YYYYYYYYYYYYYYYYYYYYYYYYY]
                    [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
                    aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
                    ccccccccccccccccccccccccc
        aZ  
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc

        options:
          -h, --help            show this help message and exit
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        r'   r&   Nr  r  r  r  r  r  r  r&   r   r   r  r  <  sr    F'D(#D(#D(#HHH !#E   D Gr   r  c                       ] tR tRtRt]! RR7      t]! RRR7      ]! RRR7      ]! RRR7      .t. tR	t	]	R
,           t
RtRtR# )TestHelpUsageOptionalsOnlyWrapi`  z@Test usage messages where there are only optionals and they wraprC  r  r  r  r5  r0  z        usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] [-y YYYYYYYYYYYYYYYYYYYYYYYYY]
                    [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
        z
        options:
          -h, --help            show this help message and exit
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        r'   r&   Nr  r  r  r  r&   r   r   r  r  `  s]    J'D(#D(#D(#
 !#E
   D Gr   r  c                   z    ] tR tRtRt]! RRR7      t]! R4      ]! R4      ]! R4      .t. tRt	]	R,           t
RtR	tR
# ) TestHelpUsagePositionalsOnlyWrapiz  zBTest usage messages where there are only positionals and they wraprC  Fr  z~        usage: PROG aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
                    ccccccccccccccccccccccccc
        r  r'   r&   Nr  r  r  r  r&   r   r   r  r  z  sV    L7HHH
 !#E   D Gr   r  c                      ] tR tRt]! RR7      t]! RRRR7      ]! RR	R
R7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! R R!R"R7      ]! R#R$R%R7      ]! R&R'R(R7      ]! R)R*R+R7      ]! R,R-R.R7      ]! R/R0R1R7      ]! R2R3R4R7      .tR5t]R6,           tR7t	R8t
R9# ):&TestHelpUsageMetavarsSpacesParenthesesi  rC  r  z-n1z()n1r  z-o1z(1, 2)o1z-u1z (uu) u1z-v1z( vv )v1z-w1z(w)ww1z-x1zx(x)x1z-y1zyy)y1z-z1z(zzz1z-n2z[]n2z-o2z[1, 2]o2z-u2z [uu] u2z-v2z[ vv ]v2z-w2z[w]ww2z-x2zx[x]x2z-y2zyy]y2z-z2z[zzz2z        usage: PROG [-h] [-n1 ()] [-o1 (1, 2)] [-u1  (uu) ] [-v1 ( vv )] [-w1 (w)w]
                    [-x1 x(x)] [-y1 yy)] [-z1 (zz] [-n2 []] [-o2 [1, 2]] [-u2  [uu] ]
                    [-v2 [ vv ]] [-w2 [w]w] [-x2 x[x]] [-y2 yy]] [-z2 [zz]
        a  
        options:
          -h, --help  show this help message and exit
          -n1 ()      n1
          -o1 (1, 2)  o1
          -u1  (uu)   u1
          -v1 ( vv )  v1
          -w1 (w)w    w1
          -x1 x(x)    x1
          -y1 yy)     y1
          -z1 (zz     z1
          -n2 []      n2
          -o2 [1, 2]  o2
          -u2  [uu]   u2
          -v2 [ vv ]  v2
          -w2 [w]w    w2
          -x2 x[x]    x2
          -y2 yy]     y2
          -z2 [zz     z2
        r'   r&   Nr  r&   r   r   r  r    s     'E4d+E8$/E8$/E8$/E6-E6-E5t,E5t,E4d+E8$/E8$/E8$/E6-E6-E5t,E5t,!&E
   D* Gr   r  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestHelpUsageNoWhitespaceCrashi  c                $   \         P                  ! R R7      pVP                  4       pVP                  R\         P                  R7       VP                  R4       \
        P                  ! R4      pV P                  VP                  4       V4       R# )rC  r  r  r  z--eggs-eggs-eggs-eggs-eggs-eggszu        usage: PROG [-h]
                    [--eggs-eggs-eggs-eggs-eggs-eggs EGGS_EGGS_EGGS_EGGS_EGGS_EGGS]
        N)	r:   r;   r,  r   r  r  r  r  r@  r   rA   mutexrG  s   &   r   .test_all_suppressed_mutex_followed_by_long_argMTestHelpUsageNoWhitespaceCrash.test_all_suppressed_mutex_followed_by_long_arg  sx     ((f53358(*;*;<=> !  	,,.6r   c                   . ROp\         P                  ! R4      pVP                  RRRRR7       VP                  RRR	R
P                  V4      R7       \        P
                  ! R4      pV P                  VP                  4       V4       R# )12345611111111111111r  r  zverbose moder*  r  targetszinstallation targetsr  r(   r?  r  rM  z        usage: 11111111111111 [-h] [-v]
                              123456
        12345
        12345
        123 [123456
        12345
        12345
        123 ...]
        N)r  12345r  123)r:   r;   r   ro   r  r  r  r@  )r   mappingrA   rG  s   &   r   test_newline_in_metavar6TestHelpUsageNoWhitespaceCrash.test_newline_in_metavar  s    5(()9:D+!/ 	 	FI!7"%$(IIg$6 	 	8  	! 	 	,,.6r   c                    \         P                  ! R R7      pVP                  RRRR7       VP                  RR
R7       RpV P                  VP	                  4       V4       R	# )rC  r  z--nilr'   T)rM  r  z--ar  zqusage: PROG [-h] --nil 
            [--a AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]
NFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)r:   r;   r   r  r@  )r   rA   rG  s   &  r   test_empty_metavar_required_arg>TestHelpUsageNoWhitespaceCrash.test_empty_metavar_required_arg  s_    ((f5GR$?E84) 	
 	,,.6r   c                (   \         P                  ! R R7      pVP                  4       pVP                  RRRR\         P                  R7       VP                  RRRR\         P                  R7       RpV P                  VP                  4       V4       R	# )
rC  r  z--param1r  r  NAME)r  r/  rM  r?  z--param2zusage: PROG [-h]
N)r:   r;   r,  r   r  r  r@  r  s   &   r   -test_all_suppressed_mutex_with_optional_nargsLTestHelpUsageNoWhitespaceCrash.test_all_suppressed_mutex_with_optional_nargs  s    ((f5335YX=N=N 	 	P 	YX=N=N 	 	P %,,.6r   c                   \         P                  ! R R7      pVP                  4       pVP                  RRRR7       VP                  RRRR7       VP                  RRR	7       VP                  R
RRR7       VP                  RRR	7       VP                  R^R	7       VP                  RR^R7       \        P
                  ! R4      pV P                  VP                  4       V4       R# )rC  r  z--op1METr  )rM  r  z--op2r  z--op3r  z--op4r  z--op5z--op6z--op7z        usage: PROG [-h] [--op1 [MET] | --op2 [MET1 [MET2 ...]] | --op3 [OP3 ...] |
                    --op4 MET1 [MET2 ...] | --op5 OP5 [OP5 ...] | --op6 OP6 OP6 OP6 |
                    --op7 MET1 MET2 MET3]
        N)MET1MET2)r  r  MET3)r:   r;   r,  r   r  r  r  r@  )r   rA   r  rG  s   &   r   test_long_mutex_groups_wrap:TestHelpUsageNoWhitespaceCrash.test_long_mutex_groups_wrap  s    ((f5//1	wS9	w(8D	wc*	w(8D	wc*	wa(	w(@J ! 
 	,,.6r   r&   N)r)   r*   r+   r,   r  r  r  r  r  r.   r/   rR   s   @r   r  r    s#     77,
777 7r   r  c                      ] tR tRtRt]! RR7      t]! R]RR7      ]! RR	^*R
RR7      ]! R. R&ORR7      ]! RR^^.RRR7      ]! RRR7      ]! RRRR7      .t]! R4      ]! RRR7      ]! RR'R R7      .3.t	R!t
]
R",           tR#tR$tR%# )(TestHelpVariableExpansioni  z:Test that variables are expanded properly in help messagesrC  r  r  z"x %(prog)s %(default)s %(type)s %%rK  r5  r-  XXXz y %(prog)s %(default)s %(const)s)r,  r  r/  r?  r%  z$foo %(prog)s %(default)s %(choices)sr>  r_  rm  BBBz!bar %(prog)s %(default)s %(dest)s)r  r  rM  r?  r  zspam %(prog)s %(default)sr  rY  r  zbadger %(prog)s %(default)s)r  r?  r   r  za %(prog)s %(default)sr  zb %(prog)s %(default)szw        usage: PROG [-h] [-x X] [-y] [--foo {a,b,c}] [--bar BBB] [-a A] [-b B]
                    spam badger
        a  
        positional arguments:
          spam           spam PROG None
          badger         badger PROG 0.5

        options:
          -h, --help     show this help message and exit
          -x X           x PROG None int %
          -y             y PROG 42 XXX
          --foo {a,b,c}  foo PROG None a, b, c
          --bar BBB      bar PROG baz bar

        group:
          -a A           a PROG None
          -b B           b PROG -1
        r'   r&   Nr  r  )r)   r*   r+   r,   r-   r   r   r  r   rc  rG  r?  r  r.   r&   r   r   r   r     s    D'Ds5	7D%3	5G_7	9GUQFE4	6F45Hc(EF 
W34b'?@
 	!E   D" Gr   r   c                   P    ] tR tRtRt]! RRR7      t. t. tRt	]	R,           t
RtR	tR
# )&TestHelpVariableExpansionUsageSuppliediF  z@Test that variables are expanded properly when usage= is presentrC  z%(prog)s FOOrE  rG  z         usage: PROG FOO
        r  r'   r&   Nr  r&   r   r   r  r  F  s=    Jn= "E   D
 Gr   r  c                   B    ] tR tRtRt]! RRR7      t. t. tRt	]	t
RtRtR	# )
$TestHelpVariableExpansionNoArgumentsiW  z;Test that variables are expanded properly with no argumentsrC  Fr  z        usage: PROG
        r'   r&   Nr  r&   r   r   r  r  W  s1    E7 "E DGr   r  c                   z    ] tR tRtRt]! R]P                  R7      t]! RRR7      ]! RR	R7      .t	. t
R
tRtRtRtR# )TestHelpSuppressUsageid  z3Test that items can be suppressed in usage messagesrC  r  r%  rH  r  r  	spam helpz        positional arguments:
          spam        spam help

        options:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        r'   r&   N)r)   r*   r+   r,   r-   r   r:   r  r   r   rc  r?  rG  r  r.   r&   r   r   r	  r	  d  sO    =h.?.?@G*%F% !#D EGr   r	  c                       ] tR tRtRt]! RRR7      t]! R]P                  R7      ]! RR	R7      .t	. t
R
t]R,           tRtRtR# )TestHelpSuppressOptionaliy  z?Test that optional arguments can be suppressed in help messagesrC  Fr  r%  r  r  r
  z!        usage: PROG spam
        zA
        positional arguments:
          spam  spam help
        r'   r&   Nr)   r*   r+   r,   r-   r   r   r:   r  r   rc  rG  r?  r  r.   r&   r   r   r  r  y  s[    I7G(++,F% !#E   D
 Gr   r  c                       ] tR tRtRt]! RR7      t]! RRR7      ]! RR	R7      .t]! R
4      ]! R]P                  R7      .3.t
Rt]R,           tRtRtR# )TestHelpSuppressOptionalGroupi  z<Test that optional groups can be suppressed in help messagesrC  r  r%  rH  r  r  r
  r   r_  2        usage: PROG [-h] [--foo FOO] spam
        
        positional arguments:
          spam        spam help

        options:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        r'   r&   N)r)   r*   r+   r,   r-   r   r   r   r:   r  rc  rG  r?  r  r.   r&   r   r   r  r    sq    F'G*%F%
 
WG(*;*;<=>!E   D Gr   r  c                       ] tR tRtRt]! RR7      t]! RRR7      ]! R]P                  R7      .t	. t
R	t]R
,           tRtRtR# )TestHelpSuppressPositionali  zATest that positional arguments can be suppressed in help messagesrC  r  r%  rH  r  r  z-        usage: PROG [-h] [--foo FOO]
        o
        options:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        r'   r&   Nr  r&   r   r   r  r    sY    K'G*%F**+ !#E   D Gr   r  c                   b    ] tR tRtRt]! RR7      t]! RRRR7      .t. tR	t	]	R
,           t
RtRtR# )TestHelpRequiredOptionali  z.Test that required options don't look optionalrC  r  r%  TrH  )r  r?  z+        usage: PROG [-h] --foo FOO
        r  r'   r&   Nr  r&   r   r   r  r    sK    8'Gd4 !#E   D Gr   r  c                   z    ] tR tRtRt]! RRRR7      t]! RRR	R
7      ]! RRRR7      .t. tRt	]	R,           t
RtRtR# )TestHelpAlternatePrefixCharsi  z:Test that options display with different prefix charactersrC  z^;F)rE  rt  ru  z^^foor*  rH  rI  z;bz;;barrJ  r  z-        usage: PROG [^^foo] [;b BAR]
        z^
        options:
          ^^foo          foo help
          ;b, ;;bar BAR  bar help
        r'   r&   Nr  r&   r   r   r  r    s[    DTEJGLz:D'
+ !#E   D Gr   r  c                   t    ] tR tRtRt]! RRR7      t]! RRR7      ]! R	R
R7      .t. tRt	]	R,           t
RtRtR# )TestHelpNoHelpOptionali  z=Test that the --help argument can be suppressed help messagesrC  Fr  r%  rH  r  r  r
  z-        usage: PROG [--foo FOO] spam
        zv
        positional arguments:
          spam       spam help

        options:
          --foo FOO  foo help
        r'   r&   Nr  r&   r   r   r  r    sU    G7G*%F% !#E   D Gr   r  c                   j    ] tR tRtRt]! RR7      t]! R4      ]! R4      .t. tRt	]	R,           t
R	tR
tR# )TestHelpNonei  z1Test that no errors occur if no help is specifiedrC  r  r%  r  r  z
        positional arguments:
          spam

        options:
          -h, --help  show this help message and exit
          --foo FOO
        r'   r&   Nr  r&   r   r   r  r    sM    ;'GF !#E   D Gr   r  c            
           ] tR tRtRt]! RR7      t]! RRRRR7      ]! R	R
RRR7      ]! RR^RR7      ]! RRRRR7      .t. tRt	]	R,           t
RtRtR# )TestHelpTupleMetavarOptionali  z"Test specifying metavar as a tuplerC  r  r  r{   r  r  r  r!  r  r5  r  r0  r2  r  z]        usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]]
        z
        options:
          -h, --help        show this help message and exit
          -w W1 [W2 ...]    w
          -x [X1 [X2 ...]]  x
          -y Y1 Y2 Y3       y
          -z [Z1]           z
        r'   r&   NW1W2X1X2Y1Y2Y3Z1r  r&   r   r   r  r    sx    ,'Ds#|<Ds#|<Ds!-?@Ds#x8	 !#E   D Gr   r  c            
           ] tR tRtRt]! RR7      t]! RRRRR7      ]! R	R
RRR7      ]! RR^RR7      ]! RRRRR7      .t. tRt	]	R,           t
RtRtR# )TestHelpTupleMetavarPositionali/  z2Test specifying metavar on a Positional as a tuplerC  r  r{   rU  r  r  r!  rV  r  r  rW  r2  rX  r  zI        usage: PROG [-h] W1 [W2 ...] [X1 [X2 ...]] Y1 Y2 Y3 [Z1]
        z
        positional arguments:
          W1 W2       w help
          X1 X2       x help
          Y1 Y2 Y3    y help
          Z1          z help

        options:
          -h, --help  show this help message and exit
        r'   r&   Nr  r"  r%  r)  r  r&   r   r   r,  r,  /  sx    <'Chc<@Chc<@Cha1CDChc7;	 !#E  
 
D Gr   r,  c                       ] tR tRtRt]! R]P                  RR7      t]! RRR7      ]! R	R
R7      .t	]! RRR7      ]! RRR7      .3.t
Rt]R,           tRtRtR# )TestHelpRawTextiK  Test the RawTextHelpFormatterrC  7Keep the formatting
    exactly as it is written

here
rE  formatter_classrF  r%  z-    foo help should also
appear as given herer  r  r
  rO  ?    This text
  should be indented
    exactly like it is here
rQ  r_  rJ  >        usage: PROG [-h] [--foo FOO] [--bar BAR] spam
        a  
        Keep the formatting
            exactly as it is written

        here

        positional arguments:
          spam        spam help

        options:
          -h, --help  show this help message and exit
          --foo FOO       foo help should also
                      appear as given here

        title:
              This text
            should be indented
              exactly like it is here

          --bar BAR   bar help
        r'   r&   N)r)   r*   r+   r,   r-   r   r:   RawTextHelpFormatterr   r   rc  rG  r?  r  r.   r&   r   r   r.  r.  K  s    'X%B%B 	G 1 	2F% 
W #B 
C gJ
'	(	*!E   D, Gr   r.  c                       ] tR tRtRt]! R]P                  RR7      t]! RRR7      ]! R	R
R7      .t	]! RRR7      ]! RRR7      .3.t
Rt]R,           tRtRtR# )TestHelpRawDescriptioni|  r/  rC  r0  r1  r%  z4  foo help should not
    retain this odd formattingr  r  r
  rO  r3  rQ  r_  rJ  r4  a  
        Keep the formatting
            exactly as it is written

        here

        positional arguments:
          spam        spam help

        options:
          -h, --help  show this help message and exit
          --foo FOO   foo help should not retain this odd formatting

        title:
              This text
            should be indented
              exactly like it is here

          --bar BAR   bar help
        r'   r&   N)r)   r*   r+   r,   r-   r   r:   RawDescriptionHelpFormatterr   r   rc  rG  r?  r  r.   r&   r   r   r7  r7  |  s    'X%I%I 	G ; 	<F% 
W #B 
C gJ
'	(	*!E   D* Gr   r7  c                   \   ] tR tRtRt]! R]P                  RR7      t]! RRR7      ]! R	R
RR7      ]! R]P                  RRR7      ]! R]P                  R]P                  R7      ]! RR^*R7      ]! RRR7      ]! RRRRR7      .t]! RRR7      ]! R]^*R R!7      .3.tR"t]R#,           tR$tR%tR&# )'TestHelpArgumentDefaultsi  z&Test the ArgumentDefaultsHelpFormatterrC  rF  r1  r%  z)foo help - oh and by the way, %(default)sr  r_  r*  rJ  rI  z--tazzWhether to taz itT)r,  r?  r  z--corgezWhether to corge itr  zSet the quux)r?  r  r  r
  rY  r  woodenzbadger helpr  r  r?  rO  rQ  r  r  )r   r  r?  z        usage: PROG [-h] [--foo FOO] [--bar] [--taz | --no-taz] [--corge | --no-corge]
                    [--quux QUUX] [--baz BAZ]
                    spam [badger]
        ay  
        description

        positional arguments:
          spam                 spam help
          badger               badger help (default: wooden)

        options:
          -h, --help           show this help message and exit
          --foo FOO            foo help - oh and by the way, None
          --bar                bar help (default: False)
          --taz, --no-taz      Whether to taz it (default: True)
          --corge, --no-corge  Whether to corge it
          --quux QUUX          Set the quux (default: 42)

        title:
          description

          --baz BAZ            baz help (default: 42)
        r'   r&   N)r)   r*   r+   r,   r-   r   r:   ArgumentDefaultsHelpFormatterr   r  r  r   r  rc  rG  r?  r  r.   r&   r   r   r:  r:    s    0X%K%K!#
 	GEFGLz:GH::$d	4Ih<<&0A0A	CH>26F%HCF
 
W-	0
gC*
=	>	@!E
   D* Gr   r:  c                   f    ] tR tRtRt]! RRR7      t]! RRRR	R
7      .t. tRt	]	R,           t
RtRtR# )TestHelpVersionActioni  z,Test the default help for the version actionrC  rF  r  -Vr  r  z3.6r  z&        usage: PROG [-h] [-V]
        z
        description

        options:
          -h, --help     show this help message and exit
          -V, --version  show program's version number and exit
        r'   r&   Nr  r&   r   r   r?  r?    sK    6MBt[ERS "E   D Gr   r?  c                       ] tR tRtRt]! RR7      t]! RRRR]P                  R	7      ]! R
RR7      ]! RRR7      .t	. t
Rt]R,           tRtR# )TestHelpVersionActionSuppressi  zCTest that the --version argument can be suppressed in help messagesrC  r  r  r  r  r  )r,  r  r?  r%  rH  r  r  r
  r  r  r&   N)r)   r*   r+   r,   r-   r   r   r:   r  r   rc  rG  r?  r.   r&   r   r   rB  rB    se    M'D+i""	$G*%F%	 !#E   Dr   rB  c                       ] tR tRtRt]! RRR7      t]! RRRR	R
7      .tR U u. uF  p \        V R7      NK  	  up tRt	]	R,           t
RtRtR# u up i )TestHelpSubparsersOrderingi  5Test ordering of subcommands in help matches the coderC  display some subcommandsr  r  r  r  r  r  rK  6        usage: PROG [-h] [-v] {a,b,c,d,e} ...
        z
        display some subcommands

        positional arguments:
          {a,b,c,d,e}

        options:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
        r  r&   N)r  r  r  r  r   )r)   r*   r+   r,   r-   r   r   r   rd  rG  r?  r  r.   rK  s   0r   rD  rD    sv    ?'ACt[ERS *CD)B !d^)BDE  
 
DG'Ds   ArD  c            	           ] tR tRtRt]! RRR7      t]! RRRR	R
7      .tRt] U Uu. uF  w  r\        WR7      NK  	  upp t	Rt
]
R,           tRtRtR# u upp i )"TestHelpSubparsersWithHelpOrderingi(  rE  rC  rF  r  r  r  r  r  r  rw   r?  rG  a  
        display some subcommands

        positional arguments:
          {a,b,c,d,e}
            a            a subcommand help
            b            b subcommand help
            c            c subcommand help
            d            d subcommand help
            e            e subcommand help

        options:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
        r  r&   N))r  za subcommand help)r  zb subcommand help)r  zc subcommand help)r  zd subcommand help)r   ze subcommand help)r)   r*   r+   r,   r-   r   r   r   subcommand_datard  rG  r?  r  r.   rJ  s   00r   rI  rI  (  s    ?'ACt[ERSO 0?@/> !d6/>@E   D"G1@s   ArI  c                      a  ] tR tRt o R t]! RR]P                  R7      t]! R]	R7      ]! R]R7      ]! R	]
R
R7      .t. tRt]R,           tRtRtV tR# )TestHelpMetavarTypeFormatteriS  c                    V # ra   r&   r  s   &r   custom_type(TestHelpMetavarTypeFormatter.custom_typeU  s    r   rC  rF  )rE  rF  r2  r  r  r  r  z
SOME FLOAT)r   rM  zF        usage: PROG [-h] [-b custom_type] [-c SOME FLOAT] int
        z
        description

        positional arguments:
          int

        options:
          -h, --help      show this help message and exit
          -b custom_type
          -c SOME FLOAT
        r'   r&   N)r)   r*   r+   r,   rO  r   r:   MetavarTypeHelpFormatterr   r  r  r   rc  rG  r?  r  r.   r/   rR   s   @r   rM  rM  S  su      M+3+L+LNs-t+6t%FH !#E   D Gr   rM  c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )TestHelpCustomHelpFormatterip  Nc                    R  p\         P                  ! RRVR7      pVP                  RRRR7       VP                  RR	R7       VP                  4       pV P	                  V\
        P                  ! R
4      4       R# )c                 2    \         P                  ! V ^R7      #    indent_incrementr:   r5  r  s   &r   custom_formatterTTestHelpCustomHelpFormatter.test_custom_formatter_function.<locals>.custom_formatteru      00JJr   rC  r  rE  rt  r2  rv  r"  rH  r  r  r
              usage: PROG [-h] [+f FOO] spam

            positional arguments:
                 spam           spam help

            options:
                 -h, --help     show this help message and exit
                 +f, ++foo FOO  foo help
        N)r:   r;   r   rA  r  r  r  )r   r[  rA   r\  s   &   r   test_custom_formatter_function:TestHelpCustomHelpFormatter.test_custom_formatter_functiont  s{    	K ((! 0

 	D'
;F5((*hoo 	7 	' 		r   c                $    ! R  R\         P                  4      p\         P                  ! RRVR7      pVP                  RRRR7       VP                  R	R
R7       VP	                  4       pV P                  V\        P                  ! R4      4       R# )c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )PTestHelpCustomHelpFormatter.test_custom_formatter_class.<locals>.CustomFormatteri  c                *   < \         SV `  V^R7       R# rW  rX  Nr   r   r   rE  r   s   &&r   r   YTestHelpCustomHelpFormatter.test_custom_formatter_class.<locals>.CustomFormatter.__init__        :r   r&   r)   r*   r+   r,   r   r.   r/   r0   r1   s   @@r   CustomFormatterrd         ; ;r   rl  rC  r  r^  rv  r"  rH  r  r  r
  r_  N)r:   r5  r;   r   rA  r  r  r  )r   rl  rA   r\  s   &   r   test_custom_formatter_class7TestHelpCustomHelpFormatter.test_custom_formatter_class  s    	;h;; 	; ((! /

 	D'
;F5((*hoo 	7 	' 		r   c                B   R p\         P                  ! RVR7      pVP                  RRRR7      pVP                  RR	R
7       VP                  RRR
7       VP                  RRR
7       VP	                  4       pV P                  V\        P                  ! R4      4       R# )z<Test that subparser commands are formatted correctly in helpc                 2    \         P                  ! V ^2R7      # )2   )max_help_positionrZ  r  s   &r   r[  WTestHelpCustomHelpFormatter.test_usage_long_subparser_command.<locals>.custom_formatter  s    00LLr   rC  )rE  r2  rN  CMDzcommand to use)rO  rM  r?  ru  zadd somethingr  removezremove somethingza-very-long-commandzcommand that does somethinga}              usage: PROG [-h] CMD ...

            options:
              -h, --help             show this help message and exit

            commands:
              CMD                    command to use
                add                  add something
                remove               remove something
                a-very-long-command  command that does something
        N)r:   r;   r  r  rA  r  r  r  )r   r[  parent_parsercmd_subparsersr\  s   &    r   !test_usage_long_subparser_command=TestHelpCustomHelpFormatter.test_usage_long_subparser_command  s    	M !// 0

 '55J>C;K 6 M 	!!%'6 	" 	8 	!!('9 	" 	; 	!!"7'D 	" 	F $//1hoo 7 ' 	r   r&   )
r)   r*   r+   r,   r  r`  rn  ry  r.   r/   rR   s   @r   rS  rS  p  s     G02" "r   rS  c                      a  ] tR tRt o RtRR/R ltRR/R ltR tR tR	 t	R
 t
R t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# )TestInvalidArgumentConstructorsi  z-Test a bunch of invalid Argument constructorserrmsgNc               z    \         P                  ! 4       pV P                  ! \        WP                  .VO5/ VB  R # ra   )r:   r;   rH  r   r   r   r}  r   r   rA   s   &$*, r   assertTypeError/TestInvalidArgumentConstructors.assertTypeError  s8    ((*y&2E2E 	0 $	0(.	0r   c               z    \         P                  ! 4       pV P                  ! \        WP                  .VO5/ VB  R # ra   )r:   r;   rH  r  r   r  s   &$*, r   assertValueError0TestInvalidArgumentConstructors.assertValueError  s8    ((*z63F3F 	0 $	0(.	0r   c                    V P                  R RR7       V P                  RRR7       V P                  RRR7       V P                  R/ R7       R# )	r  N)rl  r5  r7   )callback)callback_args)callback_kwargsr&   r  r$   s   &r   test_invalid_keyword_arguments>TestInvalidArgumentConstructors.test_invalid_keyword_arguments  sN    Tt,TE2T4T26r   c                    V P                  4        R F8  pV P                  VR7      ;_uu_ 4        V P                  VR7       RRR4       K:  	  R#   + '       g   i     KO  ; i)r  r+  Nr  r  r  )r  rL   r   r,  s   & r   test_missing_destination8TestInvalidArgumentConstructors.test_missing_destination  sL    3FV,,$$F$3 -, 4,,,s   AA"c                x    V P                  R RR7       V P                  RRR7       V P                  RRR7       R# )r  zdest= is requiredr}  r}  z---Nr  r$   s   &r   test_invalid_option_strings;TestInvalidArgumentConstructors.test_invalid_option_strings  s>    S)<=T*=>U+>?r   c                .    V P                  R RRR7       R# )r%  z+foozmust start with a characterr  Nr  r$   s   &r   test_invalid_prefix3TestInvalidArgumentConstructors.test_invalid_prefix  s    gv%B 	 	Dr   c                j    V P                  R RRR7       V P                  R \        \        3RR7       R# )r%  r  z'int' is not callable)r   r}  zis not callableN)r  r  r  r$   s   &r   r4  1TestInvalidArgumentConstructors.test_invalid_type  s:    W5$; 	 	=WC<$5 	 	7r   c                    V P                  R RRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       R# )	r  r7   zunknown actionr,  r}  rm  r%  z
store-trueN)r  r  r  r$   s   &r   test_invalid_action3TestInvalidArgumentConstructors.test_invalid_action  sk    d5%5 	 	7eE%5 	 	7g.A%5 	 	7gl%5 	 	7r   c                ~    V P                  R RRR7       V P                  R RRR7       V P                  R RRR7       R# )r%  r  r  )r?  r}  r  r  Nr  r$   s   &r   test_invalid_help1TestInvalidArgumentConstructors.test_invalid_help   sS    gJ%? 	 	AgJ%? 	 	AgJ%? 	 	Ar   c                6   \         P                  ! 4       pVP                  R R7       V P                  \        4      ;_uu_ 4       pVP                  RRR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r7   rQ  rl  rm  NzBdest supplied twice for positional argument, did you mean metavar?)r:   r;   r   r
  r   r  r  r  r  s   &  r   test_multiple_dest2TestInvalidArgumentConstructors.test_multiple_dest  sr    ((*'y))RE2 * /",,'	) *)s   BB	c                (   R F  pV P                  VR7      ;_uu_ 4        \        \        R7      \        RR7      \        RR.R7      3 FN  pV P                  VR7      ;_uu_ 4        V P                  ! RR
V/VB  V P                  ! RR
V/VB  RRR4       KP  	  V P	                  RVRV R2R7       V P                  R	V^ R7       V P	                  RV^ RR7       RRR4       K  	  R#   + '       g   i     K  ; i  + '       g   i     EK  ; i)r-  r+  r  r  r  r  r  r  )attrsr  r,  r!  Nzaction 'z'' is not valid for positional argumentsr  r  "nargs for positionals must be != 0)r,  r  r}  )r-  r*  r  r  r	  )r  r   )rL   r^  r  r  r  )r   r,  r  s   &  r   test_no_argument_actions8TestInvalidArgumentConstructors.test_no_argument_actions  s   0FV,,"ndo"C:68EE22,,J&JEJ,,II5I 328
 %%c&%fX-TU & W$$T&$B%%c&? & A -,0
 322 -,,s%   AC?')C+AC?+C<6	C??Dc           	         R FN  pV P                  VR7      ;_uu_ 4        V P                  RRVR7       V P                  RRVR7       RRR4       KP  	  R#   + '       g   i     Ke  ; i)	r*  r+  r  r7   r  r  r  N)r*  r  r	  rL   r  r  s   & r   !test_no_argument_no_const_actionsATestInvalidArgumentConstructors.test_no_argument_no_const_actions   s[    <FV,,$$Tv$F $$TV$D -, =,,,s   )AA(c                Z   R F  pV P                  VR7      ;_uu_ 4        VR8X  d   RMTpV P                  R^ VRV R2R7       V P                  R^ VR	R7       R F+  pV P                  RR
W1R7       V P                  RR
W1R7       K-  	  RRR4       K  	  R#   + '       g   i     K  ; i)r  r  r  r+  r  z
nargs for z actions must be != 0)r  r,  r}  r  r  r7   )r/  r  r,  Nr  )r  r  r  )rL   r  )r   r,  action_namer  s   &   r   #test_more_than_one_argument_actionsCTestInvalidArgumentConstructors.test_more_than_one_argument_actions*  s    3FV,,*0H*<h&%%d!F'}4IJ & L%%fAf? & A +E))$e05 * F))&05 * F + -, 4,,,s   A+BB*c           	         R F:  pV P                  VR7      ;_uu_ 4        V P                  RRVR7       RRR4       K<  	  R#   + '       g   i     KQ  ; i)r-  r+  r  r  r  N)r-  r  r  r  s   & r   test_required_const_actions;TestInvalidArgumentConstructors.test_required_const_actions;  sD    5FV,,$$TV$D -, 6,,,s   AAc                    V P                  R RR7       V P                  R RRR7       V P                  R R\        P                  R7       R# )r  parsersr+  rC  )r,  rE  )r,  r   N)r  r:   r;   r$   s   &r   "test_parsers_action_missing_paramsBTestInvalidArgumentConstructors.test_parsers_action_missing_paramsA  sK    Yy9YyvFYy*2*A*A 	 	Cr   c                ,    V P                  R RR7       R# )r  r  r+  Nr  r$   s   &r   test_version_missing_params;TestInvalidArgumentConstructors.test_version_missing_paramsG  s    Yy9r   c                ,    V P                  R RR7       R# )r7   Tr  Nr  r$   s   &r   test_required_positional8TestInvalidArgumentConstructors.test_required_positionalJ  s    UT2r   c           	        a  ! R  R\         4      o ! V3R lR\        4      p\        P                  ! 4       pV P	                  SVP
                  RVSSR7       V P	                  SVP
                  RVSSR7       R# )c                       ] tR tRtRtR# )ITestInvalidArgumentConstructors.test_user_defined_action.<locals>.SuccessiO  r&   Nr0  r&   r   r   Successr  O  r  r   r  c                   8   <a  ] tR tRt o RV3R lltR tRtV tR# )HTestInvalidArgumentConstructors.test_user_defined_action.<locals>.ActioniR  c                D   < VR 8X  d   VSJ d   VSJ d   S! 4       hR# R# R# )r  Nr&   )r   option_stringsrR  r/  r  r  r  s   &&&&&&r   r   QTestInvalidArgumentConstructors.test_user_defined_action.<locals>.Action.__init__T  s2     6>'"g-"))O . ( "r   c                    R # ra   r&   r   s   &*,r   r  QTestInvalidArgumentConstructors.test_user_defined_action.<locals>.Action.__call___  s    r   r&   NF)r)   r*   r+   r,   r   r  r.   r/   )r2   r  s   @r   r  r  R  s     	, r   r  r  )r,  r  r/  r  N)r   r  r:   r;   r
  r   )r   r  rA   r  s   &  @r   test_user_defined_action8TestInvalidArgumentConstructors.test_user_defined_actionM  sy    	i 		V 	  ((*'6#6#6!' 	 	I'6#6#6!' 	 	Ir   r&   )r)   r*   r+   r,   r-   r  r  r  r  r  r  r4  r  r  r  r  r  r  r  r  r  r  r  r.   r/   rR   s   @r   r|  r|    s     70D 0
0T 0
74@
D77A)AEF"EC:3I Ir   r|  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestActionsReturnedil  c                B   \         P                  ! 4       pVP                  R 4      pV P                  VP                  R4       VP                  RR4      pV P                  VP                  R4       VP                  RR4      pV P                  VP                  R4       R# )	r%  r7   r  r_  rl  r  r5  r!  N)r:   r;   r   r  rR  r8  s   &  r   r  TestActionsReturned.test_destn  s    ((*$$W-e,$$T73e,$$T40c*r   c                <   \         P                  ! 4       pVP                  R R^*^T\        ^^.RRRR7	      pV P	                  VP
                  R4       V P	                  VP                  ^*4       V P	                  VP                  ^T4       V P	                  VP                  \        4       V P	                  VP                  ^^.4       V P	                  VP                  R4       V P	                  VP                  R4       V P	                  VP                  R4       R# )r%  r  r  BARrm  )r  r/  r  r   r  r?  rM  rR  N)r:   r;   r   r  r  r  r/  r  r   r  r?  rM  rR  r8  s   &  r   	test_miscTestActionsReturned.test_miscw  s    ((*$$WCr-/cAq6*/U % L 	s+r*,c*!Q0e,/e,r   r&   N)r)   r*   r+   r,   r  r  r.   r/   rR   s   @r   r  r  l  s     +- -r   r  c                   B   a  ] tR tRt o R tR t]R 4       tR tRt	V t
R# )TestConflictHandlingi  c                R    V P                  \        \        P                  R R7       R# )r7   )conflict_handlerN)r
  r  r:   r;   r$   s   &r   test_bad_type"TestConflictHandling.test_bad_type  s"    *h&=&=+0 	 	2r   c                    \         P                  ! 4       pVP                  R 4       V P                  \         P                  VP                  R 4       VP                  R4       V P                  \         P                  VP                  R4       R# )r  r  N)r:   r;   r   r
  rI  r@   s   & r   test_conflict_error(TestConflictHandling.test_conflict_error  sn    ((*D!(00 --t	5H%(00 --x	9r   c                   \         P                  pV! R RR7      pVP                  RRR7       VP                  RRR7       V P                  VP	                  4       \
        P                  ! R4      4       VP                  RR	R
7       VP                  RRR
7       V P                  VP	                  4       \
        P                  ! R4      4       R# )rC  resolve)rE  r  r  zOLD Xr  zNEW Xz            usage: PROG [-h] [-x X]

            options:
              -h, --help  show this help message and exit
              -x X        NEW X
            r  OLD_SPAMr  NEW_SPAMz            usage: PROG [-h] [-x X] [--spam NEW_SPAM]

            options:
              -h, --help       show this help message and exit
              -x X             NEW X
              --spam NEW_SPAM
            N)r:   r;   r   r  rA  r  r  )r   r  rA   s   &  r   test_resolve_error'TestConflictHandling.test_resolve_error  s    ,,
)DDw/Dw/++-x @ 0 	 	Hj9Hj9++-x @ 0 	r   c                   \         P                  ! 4       pVP                  4       pVP                  R R.R7       V P	                  \
        RVP                  R 4       V P	                  \
        RVP                  R4       V P	                  \
        RVP                  RR .R7       V P	                  \
        RVP                  RR.R7       R# )	fullnamealiasr  zconflicting subparser: fullnamezconflicting subparser: aliasz%conflicting subparser alias: fullnamer   z"conflicting subparser alias: aliasN)r:   r;   r  r  rH  r  )r   rA   sps   &  r   test_subparser_conflict,TestConflictHandling.test_subparser_conflict  s    ((*""$
j7)4z@!}}j	: 	z=!}}g	7 	zF!}}g
| 	 	M 	zC!}}gy 	 	Jr   r&   N)r)   r*   r+   r,   r  r  r   r  r  r.   r/   rR   s   @r   r  r    s/     29  2J Jr   r  c                   Z   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V tR# )TestOptionalsHelpVersionActionsi  z!Test the help and version actionsc                   V P                  \        4      ;_uu_ 4       pVP                  VP                  4       4       R R R 4       V P	                  VP                  4       XP                  P                  4       R #   + '       g   i     LF; ira   )r
  r   rK   r	  r  rA  r  r   )r   rA   r  r  s   &&& r   assertPrintHelpExit3TestOptionalsHelpVersionActions.assertPrintHelpExit  s\    233rhnn./ 4++-r||/B/BC 43s    A<<B	c                H    V P                  \        VP                  V4       R # ra   )r
  r   rK   r:  s   &&*r   r?  9TestOptionalsHelpVersionActions.assertArgumentParserError  s    -v/@/@$Gr   c                    \        4       pVP                  R RRRR7       V P                  VR4       V P                  VR4       V P                  \        \
        VR4       R# )	r  r  r  r  r  rE   r~  format_versionNr   r   r  r
  rD  r   r@   s   & r   test_version,TestOptionalsHelpVersionActions.test_version  sV    +-D+iO  .  2.'6;KLr   c                *   \        R R7      pVP                  RRRRR7       V P                  \        4      ;_uu_ 4       pVP	                  R.4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)	PPPr  r  r  r  z%(prog)s 3.5r  NzPPP 3.5
r   r   r
  r   rK   r  r  r   r  s   &  r   test_version_format3TestOptionalsHelpVersionActions.test_version_format  so    +7D+iX233rtf% 4bll&9&9: 43s   BB	c                    \        R R7      pVP                  RRRRR7       V P                  VR4       V P                  VR4       V P                  \        \
        VR	4       R
# )Fr&  r  r  r  r  r  rE   r~  r  N)r   r   r?  r
  rD  r   r@   s   & r   test_version_no_help4TestOptionalsHelpVersionActions.test_version_no_help  sX    +U;D+iO&&vt4&&vx8.'6;KLr   c                (   \        R R7      pVP                  RRRR7       V P                  \        4      ;_uu_ 4       pVP	                  R.4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)r  r  r@  r  z%(prog)s 3.7r  NzXXX 3.7
r  r  s   &  r   test_version_action3TestOptionalsHelpVersionActions.test_version_action  sm    +7DNK233rtf% 4bll&9&9: 43s   BB	c                    \        R R7      pV P                  VR4       V P                  VR4       V P                  VR4       V P                  VR4       R# )Fr&  rE   r~  r  r  N)r   r?  r@   s   & r   test_no_help,TestOptionalsHelpVersionActions.test_no_help  sL    +U;&&vt4&&vx8&&vt4&&v{;r   c                
   \        4       pVP                  R RR7       VP                  RRR7       V P                  VR 4       V P                  VR4       V P                  VR4       V P	                  \
        \        VR4       R# )	r  r?  r+  r5  r  r  r  r  N)r   r   r  r?  r
  rD  r   r@   s   & r   test_alternate_help_version;TestOptionalsHelpVersionActions.test_alternate_help_version  su    +-D0D3  .&&vt4&&v{;.'6;KLr   c                x   \        4       pVP                  R RRR7       VP                  RRR7       VP                  R4       . ROpVRR	.,           pV Fb  pV F  pV: R
V: 2pK  	  V P                  VXR,          4       V P                  WR,          4       V P                  \        \
        VR4       Kd  	  R# )r  r  r  r  r  r*  r+  r  z--bad-optionzfoo bar bazz %s rE   r~  r  N)r'   r  r7   z-x barzbaz -xr  )r   rA   valid_prefixesvalid_suffixesprefixsuffixrr  s   &      r   !test_help_version_extra_argumentsATestOptionalsHelpVersionActions.test_help_version_extra_arguments   s    +-K	5ID6C  ?'>=*II$F((.7 )$$VVd];$$Vh->?ngv?OP %r   r&   N)r)   r*   r+   r,   r-   r  r?  r  r  r  r  r  r  r  r.   r/   rR   s   @r   r  r    sA     +D
HM;M;<MQ Qr   r  c                   T   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V tR# )TestStringsi  z3Test str()  and repr() on Optionals and Positionalsc                \    \         \        3 F  pV P                  V! V4      V4       K  	  R # ra   )r  r%  r  )r   objresult_stringrF   s   &&& r   assertStringEqualTestStrings.assertStringEqual  s$    $KDT#Y6  r   c                r    \         P                  ! . R
ORRR^*. RORRRR7	      pRpV P                  W4       R	# )r%  r  r  r  FHELPMETAVAR	r  rR  r   r  r  r  r  r?  rM  zAction(option_strings=['--foo', '-a', '-b'], dest='b', nargs='+', const=None, default=42, type='int', choices=[1, 2, 3], required=False, help='HELP', metavar='METAVAR', deprecated=False)N)r%  r  r  r  r     )r:   r  r  )r   optionr  s   &  r   test_optionalTestStrings.test_optional  sE    0	3 	
 	v.r   c                    \         P                  ! . R \        RR. R	ORRRR7	      pR\        ,          pV P                  W4       R# )
r!  r  r  TzH HH HzMV MV MVr  zAction(option_strings=[], dest='x', nargs='?', const=None, default=2.5, type=%r, choices=[0.5, 1.5, 2.5], required=True, help='H HH H', metavar='MV MV MV', deprecated=False)N)r  g      ?r  )r:   r  r  r  )r   argumentr  s   &  r   test_argumentTestStrings.test_argument.  sO    ??#	   #(( 	
 	x0r   c                \    \         P                  ! ^*RR7      pRpV P                  W4       R# )r  r  rf  zNamespace(foo=42, bar='spam')Nr:   rG  r  r   rJ  r  s   &  r   test_namespaceTestStrings.test_namespace@  s'    BF30r*r   c                \    \         P                  ! R/ R R/B pRpV P                  W4       R# )"quotezNamespace(**{'"': 'quote'})Nr&   r#  r$  s   &  r   'test_namespace_starkwargs_notidentifier3TestStrings.test_namespace_starkwargs_notidentifierE  s,    13.12r*r   c                `    \         P                  ! RR ^/RR/B pRpV P                  W4       R# )r  r(  r)  z Namespace(a=1, **{'"': 'quote'})Nr&   r#  r$  s   &  r   2test_namespace_kwargs_and_starkwargs_notidentifier>TestStrings.test_namespace_kwargs_and_starkwargs_notidentifierJ  s1    6!6W~67r*r   c                \    \         P                  ! R/ R R/B pRpV P                  W4       R# )validTzNamespace(valid=True)Nr&   r#  r$  s   &  r   $test_namespace_starkwargs_identifier0TestStrings.test_namespace_starkwargs_identifierO  s,    27D/2(r*r   c                    \         P                  ! R R7      pR\         P                  ,          pV P                  W4       R# )rC  r  zvArgumentParser(prog='PROG', usage=None, description=None, formatter_class=%r, conflict_handler='error', add_help=True)N)r:   r;   HelpFormatterr  )r   rA   r  s   &  r   test_parserTestStrings.test_parserT  s:    ((f5'556 	 	v.r   r&   N)r)   r*   r+   r,   r-   r  r  r   r%  r*  r-  r1  r5  r.   r/   rR   s   @r   r  r    s5     =7/$1$+
+
+
+
/ /r   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestNamespacei`  c                   \         P                  ! 4       pV P                  \        \        VR 4       \         P                  ! ^*RR7      pV P                  VP                  ^*4       V P                  VP                  R4       R# )r!  r  r@  N)r:   rG  r
  rD  r   r  r  r  rI  s   & r   test_constructorTestNamespace.test_constructorb  s^    !.'2s;"/r"v&r   c                   \         P                  ! ^^R7      p\         P                  ! ^^R7      p\         P                  ! ^R7      p\         P                  ! ^R7      pV P                  W4       V P                  W4       V P                  W4       V P                  W#4       V P                  W$4       V P	                  W8g  4       V P	                  W8g  4       V P	                  W#8g  4       V P	                  W$8g  4       R# )r  r@  )r  r  )r  r   N)r:   rG  r  assertNotEqual
assertTrue)r   ns1ns2ns3ns4s   &    r   test_equalityTestNamespace.test_equalityj  s      1*  1*  1%  1%"C%C%C%C%
#
#
#
#r   c                    \         P                  ! ^^R7      pV P                  VP                  R4      \        4       V P                  VP                  R4      \        4       R# )r  r@  N)r:   rG  r  r   NotImplemented__ne__rI  s   & r   $test_equality_returns_notimplemented2TestNamespace.test_equality_returns_notimplementedz  s@    !q)biio~6biio~6r   r&   N)	r)   r*   r+   r,   r:  rC  rH  r.   r/   rR   s   @r   r8  r8  `  s     '$ 7 7r   r8  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestEncodingi  c                    \         P                  P                  V4      w  rVR ,          p\        VRRR7      ;_uu_ 4       pVP	                  4        RRR4       R#   + '       g   i     R# ; i).pyr(  r   r|   N)re   rn   splitextr~   rR  )r   rn   r   rA  s   &&  r   _test_module_encoding"TestEncoding._test_module_encoding  sJ    ''""4($g..!FFH /...s   AA-	c                D    V P                  \        P                  4       R # ra   )rO  r:   r  r$   s   &r   test_argparse_module_encoding*TestEncoding.test_argparse_module_encoding  s    ""8#4#45r   c                0    V P                  \        4       R # ra   )rO  r  r$   s   &r   "test_test_argparse_module_encoding/TestEncoding.test_test_argparse_module_encoding  s    ""8,r   r&   N)	r)   r*   r+   r,   rO  rR  rU  r.   r/   rR   s   @r   rK  rK    s     6- -r   rK  c                   &   a  ] tR tRt o R tRtV tR# )TestArgumentErrori  c                n    R p\         P                  ! RV4      pV P                  \        V4      V4       R# )zmy error hereN)r:   rI  r  r  )r   r  r   s   &  r   test_argument_error%TestArgumentError.test_argument_error  s-    &&tS1US)r   r&   N)r)   r*   r+   r,   rZ  r.   r/   rR   s   @r   rX  rX    s     * *r   rX  c                   0   a  ] tR tRt o ]R 4       tRtV tR# )TestArgumentTypeErrori  c                .   R  p\        RRR7      pVP                  RVR7       V P                  \        4      ;_uu_ 4       pVP	                  R.4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)	c                 .    \         P                  ! R 4      h)spam!)r:   ArgumentTypeErrorr  s   &r   r  <TestArgumentTypeError.test_argument_type_error.<locals>.spam  s    ,,W55r   rC  Fr  r!  r  r  Nz-usage: PROG x
PROG: error: argument x: spam!
)r   r   r
  r   rK   r  r  r   )r   r  rA   r  s   &   r   test_argument_type_error.TestArgumentTypeError.test_argument_type_error  sx    	6 ,%HCd+233rug& 4J,,	. 43s   BB	r&   N)r)   r*   r+   r,   r   rc  r.   r/   rR   s   @r   r]  r]    s     
. 
.r   r]  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestMessageContentErrori  c                4   \        R RR7      pVP                  R\        R7       VP                  R\        RR7       VP                  R\        R	R
7       V P	                  \
        4      ;_uu_ 4       pVP                  . 4       RRR4       \        XP                  4      pV P                  VR4       V P                  VR4       V P                  VR4       V P	                  \
        4      ;_uu_ 4       pVP                  R.4       RRR4       \        VP                  4      pV P                  VR4       V P                  VR4       V P                  VR4       V P	                  \
        4      ;_uu_ 4       pVP                  RR.4       RRR4       \        VP                  4      pV P                  VR4       V P                  VR4       V P                  VR4       R#   + '       g   i     ELe; i  + '       g   i     L; i  + '       g   i     L; i)rC  r'   r  req_posr  -req_optTr  need_oner  )r   r  Nreq_optmyXargumentz
-req_opt=1)
r   r   r  r  r
  r   rK   r  rN   rH  r   rA   r  r  s   &   r   %test_missing_argument_name_in_message=TestMessageContentError.test_missing_argument_name_in_message  s   +rBIC0JS4@JS<233rb! 4",,i(i(j)233r}o. 4",,i(i(j)233r}l;< 4",,i(i(j)# 433 43 43s$   2G 4G47H G1	4H	H	c                   \        R RR7      pVP                  R\        R7       VP                  R\        RR7       VP                  R\        R	RR
7       V P                  \        4      ;_uu_ 4       pVP                  . 4       RRR4       \        XP                  4      pV P                  VR4       V P                  VR4       V P                  VR4       V P                  \        4      ;_uu_ 4       pVP                  R.4       RRR4       \        VP                  4      pV P                  VR4       V P                  VR4       V P                  VR4       R#   + '       g   i     L; i  + '       g   i     Lp; i)rC  r'   r  rh  r  z	--req_optTr  z	--opt_optr  )r   r  r  Nrk  opt_optz--req_opt=1)r   r   r  r  r  r
  r   rK   r  rN   rH  rm  s   &   r   %test_optional_optional_not_in_message=TestMessageContentError.test_optional_optional_not_in_message  s0   +rBIC0KcDAKd#$( 	 	*233rb! 4",,i(i(i(233r}o. 4",,i(i(i( 43 43s   3E5E0E-	0F 	c                p   \        R RR7      pVP                  R4       VP                  RRRR7       V P                  \        4      ;_uu_ 4       pVP	                  . 4       RRR4       \        XP                  4      pV P                  VR4       V P                  VR4       R#   + '       g   i     LK; i)	rC  r'   r  rh  optional_positionalr  r  r  N)	r   r   r
  r   rK   r  r  rN   rH  rm  s   &   r   'test_optional_positional_not_in_message?TestMessageContentError.test_optional_positional_not_in_message  s    +rBI&1fM233rb! 4",,i(34	 43s   B%%B5	r&   N)	r)   r*   r+   r,   rn  rr  rv  r.   r/   rR   s   @r   rf  rf    s     *2)&5 5r   rf  c                   &   a  ] tR tRt o R tRtV tR# )TestTypeFunctionCallOnlyOncei  c                   a  V 3R  lp\         P                  ! 4       pVP                  RVRR7       VP                  RP	                  4       4      pS P                  \        RR7      V4       R# )c                 ,   < SP                  V R 4       R# )r`  foo_convertedr  )string_to_convertr   s   &r   r  LTestTypeFunctionCallOnlyOnce.test_type_function_call_only_once.<locals>.spam  s    .8"r   r%  rl  rh  z--foo spam!r|  r9  N)r:   r;   r   rK   r	  r  r   r   r  rA   r   s   f   r   !test_type_function_call_only_once>TestTypeFunctionCallOnlyOnce.test_type_function_call_only_once  s[    	# ((*G$>  !4!4!670$7r   r&   N)r)   r*   r+   r,   r  r.   r/   rR   s   @r   ry  ry    s     8 8r   ry  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestDeprecatedArgumentsi  c                   \         P                  ! 4       pVP                  R RRR7       \        4       ;_uu_ 4       pVP	                  RR.4       RRR4       XP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \        4       ;_uu_ 4       pVP	                  R R.4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \        4       ;_uu_ 4       pVP	                  . R	O4       RRR4       VP                  4       pV P                  VR4       V P                  VR4       V P                  VP                  R4      ^4       \        4       ;_uu_ 4       pVP	                  . R
O4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       R#   + '       g   i     EL; i  + '       g   i     EL^; i  + '       g   i     EL; i  + '       g   i     L; i)r>  r%  T)
deprecatedr  N%warning: option '--foo' is deprecatedis deprecated"warning: option '-f' is deprecated)r%  r  r>  ham)r%  r  r%  r  )	r:   r;   r   r   rK   r"   rN   r  r	  r   rA   r   s   &  r   test_deprecated_option.TestDeprecatedArguments.test_deprecated_option  s   ((*D'd;&w/0 "!HIo6:&tVn- "!EFo6:&<= "!HI!EFo6:&?@ "!HIo6:/    s/   H-HH*!H>H	H'	*H;	>I	c                   \         P                  ! 4       pVP                  R R\         P                  RR7       \	        4       ;_uu_ 4       pVP                  R.4       RRR4       XP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \	        4       ;_uu_ 4       pVP                  R .4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \	        4       ;_uu_ 4       pVP                  R.4       RRR4       VP                  4       pV P                  VR	4       V P                  VP                  R4      ^4       \	        4       ;_uu_ 4       pVP                  RR.4       RRR4       VP                  4       pV P                  VR4       V P                  VR	4       V P                  VP                  R4      ^4       R#   + '       g   i     EL; i  + '       g   i     EL]; i  + '       g   i     EL; i  + '       g   i     L; i)
r>  r%  Tr,  r  Nr  r  r  r  z(warning: option '--no-foo' is deprecated)
r:   r;   r   r  r   rK   r"   rN   r  r	  r  s   &  r   test_deprecated_boolean_option6TestDeprecatedArguments.test_deprecated_boolean_option"  s   ((*D'(2P2P]ab&wi( "!HIo6:&tf% "!EFo6:&zl+ "!KLo6:&w
34 "!HI!KLo6:/    s0   H;H"+H6I
H	"H3	6I	
I	c                   \         P                  ! 4       pVP                  R RRR7       VP                  RRRR7       \        4       ;_uu_ 4       pVP	                  . 4       RRR4       XP                  4       pV P                  VP                  R4      ^ 4       \        4       ;_uu_ 4       pVP	                  R.4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \        4       ;_uu_ 4       pVP	                  RR	.4       RRR4       VP                  4       pV P                  VR4       V P                  VR
4       V P                  VP                  R4      ^4       R#   + '       g   i     EL7; i  + '       g   i     L; i  + '       g   i     L; i)r7   r  Tr  r  rl  Nr  r  %warning: argument 'foo' is deprecatedr  z%warning: argument 'bar' is deprecated	r:   r;   r   r   rK   r"   r  r	  rN   r  s   &  r   test_deprecated_arguments1TestDeprecatedArguments.test_deprecated_arguments?  sZ   ((*E>E>&b! "o6:&vh' "!HIo6:&vuo. "!HI!HIo6:! 
  s$   F-F$F7F!	$F4	7G	c                H   \         P                  ! 4       pVP                  R RRR7       \        4       ;_uu_ 4       pVP	                  . 4       RRR4       XP                  4       pV P                  VP                  R4      ^ 4       \        4       ;_uu_ 4       pVP	                  R.4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \        4       ;_uu_ 4       pVP	                  RR.4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       R#   + '       g   i     EL%; i  + '       g   i     L; i  + '       g   i     L|; i)	r7   r  Tr  Nr  r  r  r  r  r  s   &  r   test_deprecated_varargument3TestDeprecatedArguments.test_deprecated_varargumentV  s4   ((*E>&b! "o6:&vh' "!HIo6:&vuo. "!HIo6: 
  s#   E*E>	F*E;	>F	F!	c                   \         P                  ! 4       pVP                  4       pVP                  R R.RR7       VP                  R4       \	        4       ;_uu_ 4       pVP                  R.4       RRR4       XP                  4       pV P                  VP                  R4      ^ 4       \	        4       ;_uu_ 4       pVP                  R .4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       \	        4       ;_uu_ 4       pVP                  R.4       RRR4       VP                  4       pV P                  VR4       V P                  VP                  R4      ^4       R#   + '       g   i     EL$; i  + '       g   i     L; i  + '       g   i     L|; i)	r7   rm  T)rT  r  rl  Nr  z$warning: command 'foo' is deprecatedz$warning: command 'baz' is deprecated)
r:   r;   r  r  r   rK   r"   r  r	  rN   )r   rA   r  r   s   &   r   test_deprecated_subparser1TestDeprecatedArguments.test_deprecated_subparserk  sR   ((***,
eeWFe$&ug& "o6:&ug& "!GHo6:&ug& "!GHo6: 
  s$   F<F ,F3F	 F0	3G	r&   N)r)   r*   r+   r,   r  r  r  r  r  r.   r/   rR   s   @r   r  r    s#     ;:;:;.;*; ;r   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestTypeFunctionCalledOnDefaulti  c                   a  V 3R  lp\         P                  ! 4       pVP                  RV^ R7       VP                  . 4      pS P	                  \        ^ R7      V4       R# )c                 ,   < SP                  V ^ 4       R# )r   r|  r}  )int_to_convertr   s   &r   r  ]TestTypeFunctionCalledOnDefault.test_type_function_call_with_non_string_default.<locals>.spam  s    ^Q/"r   r%  rh  r9  Nr:   r;   r   rK   r  r   r  s   f   r   /test_type_function_call_with_non_string_defaultOTestTypeFunctionCalledOnDefault.test_type_function_call_with_non_string_default  sQ    	# ((*G$:  $D)r   c                    R  p\         P                  ! 4       pVP                  RVRR7       VP                  . 4      pV P	                  \        RR7      V4       R# )c                     R # )r|  r&   )r  s   &r   r  YTestTypeFunctionCalledOnDefault.test_type_function_call_with_string_default.<locals>.spam  s    "r   r%  0rh  r|  r9  Nr  r  s   &   r   +test_type_function_call_with_string_defaultKTestTypeFunctionCalledOnDefault.test_type_function_call_with_string_default  sQ    	# ((*G$<  $0$7r   c                    R  p\         P                  ! 4       pVP                  RVRR7       VP                  . 4      pV P	                  \        RR7      V4       R# )c                     V R ,           # )r  r&   )str_to_converts   &r   r  YTestTypeFunctionCalledOnDefault.test_no_double_type_conversion_of_default.<locals>.extend  s    !C''r   --testr  rh  z**)r  Nr  )r   r  rA   r   s   &   r   )test_no_double_type_conversion_of_defaultITestTypeFunctionCalledOnDefault.test_no_double_type_conversion_of_default  sR    	( ((*H63?  $ 	-r   c                    \         P                  ! 4       pVP                  R R\        . RR7       VP	                  . 4      pV P                  VP                  . 4       R# )r  r  r  )rR  r   r  r,  N)r:   r;   r   r  rK   r  r  r:  s   &  r   test_issue_159060TestTypeFunctionCalledOnDefault.test_issue_15906  sT     ((*H6$&x 	 	9  $B'r   r&   N)
r)   r*   r+   r,   r  r  r  r  r.   r/   rR   s   @r   r  r    s     	*8
.( (r   r  c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )TestParseKnownArgsi  c                R    \         P                  ! 4       pVP                  R4       R # )Nr&   r:   r;   rK   r@   s   & r   test_arguments_tuple'TestParseKnownArgs.test_arguments_tuple      ((*"r   c                R    \         P                  ! 4       pVP                  . 4       R # ra   r  r@   s   & r   test_arguments_list&TestParseKnownArgs.test_arguments_list  r  r   c                t    \         P                  ! 4       pVP                  R 4       VP                  R4       R# )r!  Nr   r:   r;   r   rK   r@   s   & r   test_arguments_tuple_positional2TestParseKnownArgs.test_arguments_tuple_positional  s,    ((*C &!r   c                v    \         P                  ! 4       pVP                  R 4       VP                  R .4       R# )r!  Nr  r@   s   & r   test_arguments_list_positional1TestParseKnownArgs.test_arguments_list_positional  s.    ((*C 3% r   c                    \         P                  ! 4       pVP                  R 4       VP                  RP	                  4       4      w  r#V P                  \        RR7      V4       V P                  RR.V4       R# )r%  z--foo F --bar --bazFr9  r_  r  N)r:   r;   r   r  r	  r  r   )r   rA   r   extrass   &   r   test_optionals!TestParseKnownArgs.test_optionals  sc    ((*G$../D/J/J/LMd+'7+V4r   c                <   \         P                  ! 4       pVP                  R R^\        R7       VP                  RRR7       VP                  R4       . ROpVP	                  V4      w  r4V P                  \        ^RRR	7      V4       V P                  . ROV4       R
# )r  r  )r  r/  r   r  r  r+  rY  rj  T)vr  rY  N)rj  r  r%  r  r  r  )r  r%  r  )r:   r;   r   r  r  r  r   )r   rA   r   r   r  s   &    r   
test_mixedTestParseKnownArgs.test_mixed  s    ((*D13?H];H%2..t4ad37>,f5r   c                    \         P                  ! 4       pVP                  R RRR7       VP                  . 4      pV P	                  \        . R7      V4       R# )r!  r  )r  r  r   Nr  r  r:  s   &  r   test_zero_or_more_optional-TestParseKnownArgs.test_zero_or_more_optional  sI    ((*CsJ?  $b4(r   r&   N)r)   r*   r+   r,   r  r  r  r  r  r  r  r.   r/   rR   s   @r   r  r    s-     "
!
5	6) )r   r  c                   D   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
TestDoubleDashi  c                   \         P                  ! R R7      pVP                  RR4       VP                  RRR7       VP                  R.4      pV P	                  \        R. R	7      V4       V P                  \         P                  R
VP                  RR.4       VP                  R.4      pV P	                  \        R. R	7      V4       V P                  \         P                  R
VP                  RR.4       VP                  . RO4      pV P	                  \        RRR.R	7      V4       VP                  . RO4      pV P	                  \        RRR.R	7      V4       VP                  . RO4      pV P	                  \        R. ROR	7      V4       VP                  . RO4      pV P	                  \        R. ROR	7      V4       R# )FrE  r>  r%  rl  r  r  --foo=--r}  rf  z(argument -f/--foo: expected one argument-f--r  r  r  N)r%  r  r}  r  r  )r  r  r%  r  )r  r}  r  r%  r  )r  r}  r  r}  r  r%  r  )r  r  r}  r  r%  r  )r:   r;   r   rK   r  r   rH  rI  r:  s   &  r   test_single_argument_option*TestDoubleDash.test_single_argument_option  s   ((u=D'*E-  *."-t4x556	0   &*"-t4x556d|	-   !?@#s4d;  !9:#s4d;  !?@*BCTJ  !JK*MNPTUr   c                   \         P                  ! R R7      pVP                  RRRR7       VP                  RRR7       VP                  R.4      pV P	                  \        R.. R	7      V4       VP                  RR.4      pV P	                  \        . . R	7      V4       VP                  R
.4      pV P	                  \        R.. R	7      V4       VP                  RR.4      pV P	                  \        . . R	7      V4       VP                  . RO4      pV P	                  \        RR.RR.R	7      V4       VP                  . RO4      pV P	                  \        RR.RR.R	7      V4       VP                  . RO4      pV P	                  \        R. ROR	7      V4       VP                  . RO4      w  r#V P	                  \        R.RR.R	7      V4       V P	                  VRR.4       R# )FrE  r>  r%  r  r  rl  r  r}  rf  r  r  r  r  r  N)r%  r  r  r}  r  r  )r  r  r%  r  r  )r  r}  r  r%  r  r  )r  r  r%  r  r}  r  )r:   r;   r   rK   r  r   r  )r   rA   r   r   s   &   r   test_multiple_argument_option,TestDoubleDash.test_multiple_argument_option  s   ((u=D'5E-  *.B/6  '41+T2  &*B/6  $.+T2  !DEc
c
;TB  !>?c
c
;TB  !DE*GH$O,,-PQ
C:6=c{+r   c                p   \         P                  ! R R7      pVP                  R4       VP                  RRR7       VP                  . RO4      pV P	                  \        RRR	.R
7      V4       VP                  . RO4      pV P	                  \        RRR	.R
7      V4       VP                  . RO4      pV P	                  \        RRR	.R
7      V4       VP                  . RO4      pV P	                  \        R. ROR
7      V4       VP                  . RO4      pV P	                  \        R. ROR
7      V4       R# )FrE  r7   rl  r  r  r}  r  r  r  rf  Nr}  r  r  r  r  r}  r  r  r  r  r}  r  r  r}  r  r}  r  r  r}  r  )r}  r}  r  r}  r  r  r  r:  s   &  r   test_multiple_double_dashes*TestDoubleDash.test_multiple_double_dashes  s	   ((u=E"E-  !67#s4d;  !67#s4d;  !67#s4d;  !<=)9:DA  !BC*?@$Gr   c                   \         P                  ! R R7      pVP                  R4       VP                  RRR7       VP                  . RO4      pV P	                  \        RRR.R	7      V4       VP                  . RO4      pV P	                  \        RRR.R	7      V4       VP                  . RO4      pV P	                  \        R. ROR	7      V4       VP                  . RO4      pV P	                  \        R. ROR	7      V4       \         P                  ! R R7      pVP                  R
4       VP                  RRR7       VP                  . RO4      pV P	                  \        R. ROR	7      V4       R# )FrE  r7   rl  r  r  r  r  r  rf  r%  Nr  r  r  r  r  )r%  r  r}  r  r}  r  )r}  r  r}  r  r  r:  s   &  r   test_remainderTestDoubleDash.test_remainder%  s7   ((u=E"E/  !67#s4d;  !67#s4d;  !67)9:DA  !<=)9:DA((u=G$E/  !EF)?@$Gr   c                l   \         P                  ! R R7      pVP                  R4       VP                  4       pVP	                  R4      pVP                  R4       VP                  RRR7       VP                  . RO4      pV P                  \        RRR	R
.R7      V4       VP                  . RO4      pV P                  \        RR. ROR7      V4       VP                  . RO4      pV P                  \        RR. ROR7      V4       VP                  . RO4      pV P                  \        RR. ROR7      V4       VP                  . RO4      pV P                  \        RRR	R
.R7      V4       VP                  . RO4      pV P                  \        RRR	R
.R7      V4       VP                  . RO4      pV P                  \        RR. ROR7      V4       VP                  . RO4      pV P                  \        RR. ROR7      V4       V P                  \         P                  RVP
                  . RO4       R# )FrE  r7   r  r>  rl  r  r  r!  r  r  r  r7   rA  rl  Ninvalid choice: '--')r!  r  r  r  r>  r  )r!  r  r  r  r}  r>  r  )r  r  r>  r  )r!  r  r  r}  r  r>  r  )r!  r  r}  r  r  r>  r  )r!  r}  r  r  r  r>  r  )r}  r!  r  r  r  r>  r  )r!  r  r}  r  r}  r  )r  r}  r  )r!  r}  r  r}  r  r}  r  )r}  r!  r}  r  r  r  
r:   r;   r   r  r  rK   r  r   rH  rI  r   rA   r  rb  r   s   &    r   test_subparserTestDoubleDash.test_subparser9  s   ((u=E"**,
''.T"U#.  !BCsc
;TB  !HIt1FGN  !HIt1FGN  !HIt1FGN  !HIsc
;TB  !HIsc
;TB  !CDt1ABDI  !IJt1ABDIx55"A	Cr   c                   \         P                  ! R R7      pVP                  RRR7       VP                  4       pVP	                  R4      pVP                  R4       VP                  RRR7       VP                  . RO4      pV P                  \        RR	.RR
R.R7      V4       V P                  \         P                  RVP
                  . RO4       R# )FrE  r%  r  r  r  r>  rl  r!  r  r  r  r  r  r  N)	r%  r!  r  r}  r  r  r  r>  r  )r%  r!  r}  r}  r  r  r  r  r  s   &    r   -test_subparser_after_multiple_argument_option<TestDoubleDash.test_subparser_after_multiple_argument_optionU  s    ((u=G3/**,
''.T"U#.  !VWc
cSzBDIx55"J	Lr   r&   N)r)   r*   r+   r,   r  r  r  r  r  r  r.   r/   rR   s   @r   r  r    s.     V0,.H H(C8L Lr   r  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestIntermixedArgsih  c           	        \         P                  ! R R7      pVP                  RRR7       VP                  RRRR7      pVP                  R	4       VP                  R
R\        R7       RP	                  4       pVP                  V4      pV P                  \        RR	R. ROR7      V4       VP                  V4      w  rEV P                  \        RR	R^.R7      V4       V P                  RR.V4       VP                  V4      w  rEV P                  \        RR	R. ROR7      V4       V P                  . V4       RP	                  4       pVP                  V4      w  rEV P                  \        RR	R. ROR7      V4       V P                  R.V4       RP	                  4       pVP                  V4      w  rEV P                  \        RR	R. ROR7      V4       V P                  R.V4       RP	                  4       pVP                  V4      w  rEV P                  \        RR	R. ROR7      V4       V P                  R.V4       V P                  VP                  4       V P                  VP                  R4       R# )rC  r  r%  r7   rQ  r_  rl  Tr  cmdrestr  )r  r   zcmd --foo x 1 --bar y 2 3r  r!  )rl  r  r7   r  r  r  z!cmd --foo x --error 1 2 --bar y 3z--errorz!cmd --foo x 1 --error 2 --bar y 3z!cmd --foo x 1 2 --error --bar y 3Nr  )r:   r;   r   r  r	  parse_intermixed_argsr  r   r  parse_known_intermixed_argsr  rG  r  )r   rA   rl  r   r   r  s   &     r   
test_basicTestIntermixedArgs.test_basici  s)   ((f5G%0!!'!EE"F#C8*002++D1CiH$O..t4CqcBDI#sV,99$?CiH$OV$ 388:99$?CiH$O)f-288:99$?CiH$O)f-288:99$?CiH$O)f- 	&,,'t,r   c                   \        R R7      pVP                  R4       VP                  R4       VP                  RRR7       RP                  4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  \        XP                  4      R	4       R#   + '       g   i     L7; i)
rC  r  r0  r!  r  r  r  r  Nz\.\.\.)	r   r   r	  r
  r   r  rN   r  r  )r   rA   r   r  s   &   r   r  !TestIntermixedArgs.test_remainder  s    +8D!C Cu-!!# y))R((. *R\\*I6 *)s   /B00C 	c                z   \         P                  ! R RR7      pVP                  RR7      pVP                  RRRR7       VP                  R	R
R7       VP                  RRRRR7       VP	                  RP                  4       4      pV P                  \        RR.RRR7      V4       VP	                  RP                  4       4      pV P                  \        RR.RRR7      V4       V P                  \         P                  RVP                  RP                  4       4       V P                  VP                  R4       R# )rC  FrE  rF  Tr  r%  r*  r  rI  r  r  r  rY  r  r[  r  r<  z	--foo 1 2rb  r  N)rY  r7   r  z	1 --foo 2z-one of the arguments --foo --spam is requiredrc  )r:   r;   r,  r   r  r	  r  r   rH  rI  r  r   rA   r   r   s   &   r   test_required_exclusive*TestIntermixedArgs.test_required_exclusive  s   ((fEJ33T3B7<eD8&1HC8L++K,=,=,?@C:4dCTJ++K,=,=,?@C:4dCTJx55?,,ekkm	= 	.r   c                   \         P                  ! R RR7      pVP                  RR7      pVP                  RRRR7       VP                  R	R
R7       VP                  RRRRR7       VP	                  R.4      pV P                  \        RRRR7      V4       VP	                  RR.4      pV P                  \        RRRR.R7      V4       V P                  \         P                  RVP                  . 4       V P                  \         P                  RVP                  . RO4       V P                  \         P                  RVP                  . RO4       V P                  VP                  R4       R# )rC  Fr  Tr  r%  r*  r  rI  r  r  r  rY  r  r[  r  r<  Nr  r  r  z4one of the arguments --foo --spam badger is requiredz0argument badger: not allowed with argument --foo)r%  r  r  )r  r%  r  )
r:   r;   r,  r   r  r  r   rH  rI  r  r 	  s   &   r   'test_required_exclusive_with_positional:TestIntermixedArgs.test_required_exclusive_with_positional  sL   ((fEJ33T3B7<eD8&183(K++WI64<dC++S#J7D#sDdKx55F,,b	2 	x55B,,.A	C 	x55B,,.A	C 	.r   c                b    \        R R7      pV P                  \        VP                  R.4       R# )rC  r  r  N)r   r
  r   r  r@   s   & r   test_invalid_args$TestIntermixedArgs.test_invalid_args  s'    +8-v/K/KcUSr   r&   N)r)   r*   r+   r,   r  r  r	  r	  r	  r.   r/   rR   s   @r   r  r  h  s&     $-L7/ /,T Tr   r  c                   &   a  ] tR tRt o R tRtV tR# )!TestIntermixedMessageContentErrori  c                   \        R RR7      pVP                  R\        R7       VP                  R\        RR7       V P	                  \
        4      ;_uu_ 4       pVP                  . 4       RRR4       \        XP                  4      pV P                  VR4       V P                  VR	4       V P	                  \
        4      ;_uu_ 4       pVP                  . 4       RRR4       \        VP                  4      pV P                  VR4       V P                  VR	4       R#   + '       g   i     L; i  + '       g   i     L^; i)
rC  r'   r  rh  r  ri  Tr  Nrk  )
r   r   r  r  r
  r   rK   r  rN   r  rm  s   &   r   rn  GTestIntermixedMessageContentError.test_missing_argument_name_in_message  s    +rBIC0JS4@233rb! 4",,i(i(233r((, 4",,i(i( 43 43s   D
D2D/	2E	r&   N)r)   r*   r+   r,   rn  r.   r/   rR   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R tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R% t'R& t(R' t)R( t*R) t+R* t,R+ t-R, t.R- t/R. t0R/ t1R0 t2R1 t3R2t4V t5R3# )4TestAddArgumentMetavari  z,length of metavar tuple does not match nargsc                V    \         P                  ! 4       pVP                  R WR7       R# r%  r  rM  N)r:   r;   r   )r   r  rM  rA   s   &&& r   do_test_no_exception+TestAddArgumentMetavar.do_test_no_exception  s#    ((*G5Br   c                6   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       pVP	                  R WR7       RRR4       V P                  XP                  P                  ^ ,          V P                  4       R#   + '       g   i     LI; ir	  )	r:   r;   r
  r  r   r  r  r   EXPECTED_MESSAGE)r   r  rM  rA   r  s   &&&  r   do_test_exception(TestAddArgumentMetavar.do_test_exception  si    ((*z**buF +**1-t/D/DE +*   BB	c                ,    V P                  R RR7       R # )Nrb  r	  r	  r$   s   &r   test_nargs_None_metavar_string5TestAddArgumentMetavar.test_nargs_None_metavar_string  s    !!c!:r   c                <    V P                  R \        4       R7       R # )Nr	  r	  tupler$   s   &r   test_nargs_None_metavar_length06TestAddArgumentMetavar.test_nargs_None_metavar_length0  s    T57;r   c                ,    V P                  R RR7       R # )Nr	  r\  r	  r$   s   &r   test_nargs_None_metavar_length16TestAddArgumentMetavar.test_nargs_None_metavar_length1  s    !!f!=r   c                ,    V P                  R RR7       R # )Nr	  rb  r  r	  r$   s   &r   test_nargs_None_metavar_length26TestAddArgumentMetavar.test_nargs_None_metavar_length2  s    T:>r   c                ,    V P                  R RR7       R # )Nr	  r]  r'	  r$   s   &r   test_nargs_None_metavar_length36TestAddArgumentMetavar.test_nargs_None_metavar_length3  s    T?Cr   c                ,    V P                  R RR7       R# )r  rb  r	  Nr	  r$   s   &r   "test_nargs_optional_metavar_string9TestAddArgumentMetavar.test_nargs_optional_metavar_string       !!S!9r   c                <    V P                  R \        4       R7       R# )r  r	  Nr	  r$   s   &r   #test_nargs_optional_metavar_length0:TestAddArgumentMetavar.test_nargs_optional_metavar_length0      S%':r   c                ,    V P                  R RR7       R# )r  r	  Nr\  r	  r$   s   &r   #test_nargs_optional_metavar_length1:TestAddArgumentMetavar.test_nargs_optional_metavar_length1      !!V!<r   c                ,    V P                  R RR7       R# )r  r	  Nr&	  r'	  r$   s   &r   #test_nargs_optional_metavar_length2:TestAddArgumentMetavar.test_nargs_optional_metavar_length2	  s    S*=r   c                ,    V P                  R RR7       R# )r  r	  Nr]  r'	  r$   s   &r   #test_nargs_optional_metavar_length3:TestAddArgumentMetavar.test_nargs_optional_metavar_length3      S/Br   c                ,    V P                  R RR7       R# )r  rb  r	  Nr	  r$   s   &r   $test_nargs_zeroormore_metavar_string;TestAddArgumentMetavar.test_nargs_zeroormore_metavar_string  r0	  r   c                <    V P                  R \        4       R7       R# )r  r	  Nr	  r$   s   &r   %test_nargs_zeroormore_metavar_length0<TestAddArgumentMetavar.test_nargs_zeroormore_metavar_length0  r4	  r   c                ,    V P                  R RR7       R# )r  r	  Nr\  r	  r$   s   &r   %test_nargs_zeroormore_metavar_length1<TestAddArgumentMetavar.test_nargs_zeroormore_metavar_length1  r8	  r   c                ,    V P                  R RR7       R# )r  r	  Nr&	  r	  r$   s   &r   %test_nargs_zeroormore_metavar_length2<TestAddArgumentMetavar.test_nargs_zeroormore_metavar_length2      !!Z!@r   c                ,    V P                  R RR7       R# )r  r	  Nr]  r'	  r$   s   &r   %test_nargs_zeroormore_metavar_length3<TestAddArgumentMetavar.test_nargs_zeroormore_metavar_length3  r?	  r   c                ,    V P                  R RR7       R# )r  rb  r	  Nr	  r$   s   &r   #test_nargs_oneormore_metavar_string:TestAddArgumentMetavar.test_nargs_oneormore_metavar_string"  r0	  r   c                <    V P                  R \        4       R7       R# )r  r	  Nr	  r$   s   &r   $test_nargs_oneormore_metavar_length0;TestAddArgumentMetavar.test_nargs_oneormore_metavar_length0%  r4	  r   c                ,    V P                  R RR7       R# )r  r	  Nr\  r'	  r$   s   &r   $test_nargs_oneormore_metavar_length1;TestAddArgumentMetavar.test_nargs_oneormore_metavar_length1(  s    S&9r   c                ,    V P                  R RR7       R# )r  r	  Nr&	  r	  r$   s   &r   $test_nargs_oneormore_metavar_length2;TestAddArgumentMetavar.test_nargs_oneormore_metavar_length2+  rL	  r   c                ,    V P                  R RR7       R# )r  r	  Nr]  r'	  r$   s   &r   $test_nargs_oneormore_metavar_length3;TestAddArgumentMetavar.test_nargs_oneormore_metavar_length3.  r?	  r   c                ,    V P                  R RR7       R# )r  rb  r	  Nr	  r$   s   &r   #test_nargs_remainder_metavar_string:TestAddArgumentMetavar.test_nargs_remainder_metavar_string3  s    !!s!;r   c                <    V P                  R \        4       R7       R# )r  r	  N)r	  r	  r$   s   &r   $test_nargs_remainder_metavar_length0;TestAddArgumentMetavar.test_nargs_remainder_metavar_length06  s    !!uw!?r   c                ,    V P                  R RR7       R# )r  r	  Nr\  r	  r$   s   &r   $test_nargs_remainder_metavar_length1;TestAddArgumentMetavar.test_nargs_remainder_metavar_length19  s    !!v!>r   c                ,    V P                  R RR7       R# )r  r	  Nr&	  r	  r$   s   &r   $test_nargs_remainder_metavar_length2;TestAddArgumentMetavar.test_nargs_remainder_metavar_length2<  s    !!z!Br   c                ,    V P                  R RR7       R# )r  r	  Nr]  r	  r$   s   &r   $test_nargs_remainder_metavar_length3;TestAddArgumentMetavar.test_nargs_remainder_metavar_length3?  s    !!!Gr   c                ,    V P                  R RR7       R# )A...rb  r	  Nr	  r$   s   &r    test_nargs_parser_metavar_string7TestAddArgumentMetavar.test_nargs_parser_metavar_stringD  s    !!!<r   c                <    V P                  R \        4       R7       R# )ro	  r	  Nr	  r$   s   &r   !test_nargs_parser_metavar_length08TestAddArgumentMetavar.test_nargs_parser_metavar_length0G  s    VUW=r   c                ,    V P                  R RR7       R# )ro	  r	  Nr\  r	  r$   s   &r   !test_nargs_parser_metavar_length18TestAddArgumentMetavar.test_nargs_parser_metavar_length1J  s    !!!?r   c                ,    V P                  R RR7       R# )ro	  r	  Nr&	  r'	  r$   s   &r   !test_nargs_parser_metavar_length28TestAddArgumentMetavar.test_nargs_parser_metavar_length2M  s    VZ@r   c                ,    V P                  R RR7       R# )ro	  r	  Nr]  r'	  r$   s   &r   !test_nargs_parser_metavar_length38TestAddArgumentMetavar.test_nargs_parser_metavar_length3P  s    V_Er   c                ,    V P                  ^RR7       R# )r  rb  r	  Nr	  r$   s   &r   test_nargs_1_metavar_string2TestAddArgumentMetavar.test_nargs_1_metavar_stringU      !!3!7r   c                <    V P                  ^\        4       R7       R# )r  r	  Nr	  r$   s   &r   test_nargs_1_metavar_length03TestAddArgumentMetavar.test_nargs_1_metavar_length0X      Q8r   c                ,    V P                  ^RR7       R# )r  r	  Nr\  r	  r$   s   &r   test_nargs_1_metavar_length13TestAddArgumentMetavar.test_nargs_1_metavar_length1[  s    !!6!:r   c                ,    V P                  ^RR7       R# )r  r	  Nr&	  r'	  r$   s   &r   test_nargs_1_metavar_length23TestAddArgumentMetavar.test_nargs_1_metavar_length2^      Q
;r   c                ,    V P                  ^RR7       R# )r  r	  Nr]  r'	  r$   s   &r   test_nargs_1_metavar_length33TestAddArgumentMetavar.test_nargs_1_metavar_length3a      Q@r   c                ,    V P                  ^RR7       R# )r  rb  r	  Nr	  r$   s   &r   test_nargs_2_metavar_string2TestAddArgumentMetavar.test_nargs_2_metavar_stringf  r	  r   c                <    V P                  ^\        4       R7       R# )r  r	  Nr	  r$   s   &r   test_nargs_2_metavar_length03TestAddArgumentMetavar.test_nargs_2_metavar_length0i  r	  r   c                ,    V P                  ^RR7       R# )r  r	  Nr\  r'	  r$   s   &r   test_nargs_2_metavar_length13TestAddArgumentMetavar.test_nargs_2_metavar_length1l      Q7r   c                ,    V P                  ^RR7       R# )r  r	  Nr&	  r	  r$   s   &r   test_nargs_2_metavar_length23TestAddArgumentMetavar.test_nargs_2_metavar_length2o  s    !!:!>r   c                ,    V P                  ^RR7       R# )r  r	  Nr]  r'	  r$   s   &r   test_nargs_2_metavar_length33TestAddArgumentMetavar.test_nargs_2_metavar_length3r  r	  r   c                ,    V P                  ^RR7       R# )r  rb  r	  Nr	  r$   s   &r   test_nargs_3_metavar_string2TestAddArgumentMetavar.test_nargs_3_metavar_stringw  r	  r   c                <    V P                  ^\        4       R7       R# )r  r	  Nr	  r$   s   &r   test_nargs_3_metavar_length03TestAddArgumentMetavar.test_nargs_3_metavar_length0z  r	  r   c                ,    V P                  ^RR7       R# )r  r	  Nr\  r'	  r$   s   &r   test_nargs_3_metavar_length13TestAddArgumentMetavar.test_nargs_3_metavar_length1}  r	  r   c                ,    V P                  ^RR7       R# )r  r	  Nr&	  r'	  r$   s   &r   test_nargs_3_metavar_length23TestAddArgumentMetavar.test_nargs_3_metavar_length2  r	  r   c                ,    V P                  ^RR7       R# )r  r	  Nr]  r	  r$   s   &r   test_nargs_3_metavar_length33TestAddArgumentMetavar.test_nargs_3_metavar_length3  s    !!?!Cr   r&   N)6r)   r*   r+   r,   r	  r	  r	  r	  r 	  r#	  r(	  r+	  r.	  r2	  r6	  r:	  r=	  rA	  rD	  rG	  rJ	  rN	  rQ	  rT	  rW	  rZ	  r]	  r`	  rc	  rf	  ri	  rl	  rp	  rs	  rv	  ry	  r|	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r.   r/   rR   s   @r   r	  r	    s    ECF;<>?D
:;=>C
:;=AC
:;:AC
<@?CH
=>@AF
89;<A
898?A
898<D Dr   r	  c                   @   a  ] tR tRt o RtRtR tR tR tR t	Rt
V tR	# )
TestInvalidNargsi  zinvalid nargs valueznargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriatec                6   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       pVP	                  R VR7       RRR4       V P                  XP                  P                  ^ ,          V P                  4       R#   + '       g   i     LI; ir%  r  N)	r:   r;   r
  r  r   r  r  r   EXPECTED_RANGE_MESSAGEr   r  rA   r  s   &&  r   do_test_range_exception(TestInvalidNargs.do_test_range_exception  si    ((*z**bu5 +**1-t/J/JK +*r	  c                6   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       pVP	                  R VR7       RRR4       V P                  XP                  P                  ^ ,          V P                  4       R#   + '       g   i     LI; ir	  )	r:   r;   r
  r  r   r  r  r   EXPECTED_INVALID_MESSAGEr	  s   &&  r   do_test_invalid_exception*TestInvalidNargs.do_test_invalid_exception  si    ((*z**bu5 +**1-t/L/LM +*r	  c                N    V P                  R R7       V P                  RR7       R# )r  r  abcdN)r	  r$   s   &r   test_nargs_alphabetic&TestInvalidNargs.test_nargs_alphabetic  s$    &&S&1&&V&4r   c                *    V P                  ^ R7       R# )r   r  N)r	  r$   s   &r   test_nargs_zero TestInvalidNargs.test_nargs_zero  s    $$1$-r   r&   N)r)   r*   r+   r,   r	  r	  r	  r	  r	  r	  r.   r/   rR   s   @r   r	  r	    s/     4LLN5. .r   r	  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestImportStari  c                `    \         P                   F  pV P                  \         V4       K  	  R # ra   )r:   __all__assertHasAttrrL  s   & r   r  TestImportStar.test  s"    $$Dx. %r   c                V   \        \        4      P                  4        UUu. uFG  w  rVP                  R 4      '       d   K  VR8X  d   K'  \        P
                  ! V4      '       d   KE  VNKI  	  pppV P                  \        V4      \        \        P                  4      4       R# u uppi )r   ngettextN)	r   r:   r   
startswithinspectismoduler  r   r	  )r   rw   r  r   s   &   r   'test_all_exports_everything_but_modules6TestImportStar.test_all_exports_everything_but_modules  s      $H~335
5OOC( ,0J,>  ##E* D5 	 
 	x/?/?(@A
s   B%B%
B%(B%r&   N)r)   r*   r+   r,   r  r	  r.   r/   rR   s   @r   r	  r	    s     /B Br   r	  c                   B   a a ] tR tRt oV 3R lt]R 4       tRtVtV ;t	# )TestWrappingMetavari  c                   < \         SV `  4        \        R 4      V n        RpV P                  P	                  RVR7       R# )9this_is_spammy_prog_with_a_long_name_sorry_about_the_namez<http[s]://example:1234>z--proxyr  N)r   r\   r   rA   r   )r   rM  r   s   & r   r\   TestWrappingMetavar.setUp  s9    0G

 -  G <r   c                    V P                   P                  4       pV P                  V\        P                  ! R 4      4       R# )a              usage: this_is_spammy_prog_with_a_long_name_sorry_about_the_name
                   [-h] [--proxy <http[s]://example:1234>]

            options:
              -h, --help            show this help message and exit
              --proxy <http[s]://example:1234>
            N)rA   rA  r  r  r  )r   	help_texts   & r   test_help_with_metavar*TestWrappingMetavar.test_help_with_metavar  s4    KK++-	HOO 5 % 	r   rA   )
r)   r*   r+   r,   r\   r   r	  r.   r/   r0   r1   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R tR tR tR tR tR tR tR tRtV tR# )TestExitOnErrori  c                    \         P                  ! R RR7      V n        V P                  P                  RR\        R7       R# )Fr  )rF  r  z
--integersN)rM  r   N)r:   r;   rA   r   r  r$   s   &r   r\   TestExitOnError.setUp  s3    --EDGI  s Er   c                    V P                   P                  R P                  4       4      pV P                  V\        P
                  ! ^R7      4       R# )z--integers 4)integersN)rA   rK   r	  r  r:   rG  rI  s   & r   !test_exit_on_error_with_good_args1TestExitOnError.test_exit_on_error_with_good_args  s:    [[##N$8$8$:;X//;<r   c                    V P                  \        P                  4      ;_uu_ 4        V P                  P	                  R P                  4       4       RRR4       R#   + '       g   i     R# ; i)z--integers aN)r
  r:   rI  rA   rK   r	  r$   s   &r    test_exit_on_error_with_bad_args0TestExitOnError.test_exit_on_error_with_bad_args  sC    x5566KK"">#7#7#9: 7666s   *AA-	c                    V P                  \        P                  R V P                  P                  RP                  4       4       R# z!unrecognized arguments: --foo barr  N)rH  r:   rI  rA   rK   r	  r$   s   &r   test_unrecognized_args&TestExitOnError.test_unrecognized_args  s4    x55B#{{55{7H7H7J	Lr   c                    V P                  \        P                  R V P                  P                  RP                  4       4       R# r	  )rH  r:   rI  rA   r  r	  r$   s   &r   !test_unrecognized_intermixed_args1TestExitOnError.test_unrecognized_intermixed_args  s4    x55B#{{@@+BSBSBU	Wr   c                    V P                   P                  R 4       V P                   P                  R4       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  /the following arguments are required: bar, baz$NrA   r   rH  r:   rI  rK   r$   s   &r   test_required_args"TestExitOnError.test_required_args  sN      '  'x55P#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  RRR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  BaZr  z/the following arguments are required: bar, BaZ$Nr	  r$   s   &r   test_required_args_with_metavar/TestExitOnError.test_required_args_with_metavar  sS      '   6x55P#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  R^R7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r  r	  Nr	  r$   s   &r   test_required_args_n$TestExitOnError.test_required_args_n  sS      '  a 0x55P#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  R^RR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r	  z3the following arguments are required: bar, B, A, Z$N)rj  r  r  r	  r$   s   &r   !test_required_args_n_with_metavar1TestExitOnError.test_required_args_n_with_metavar  sU      '  a Ix55T#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  RRR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r  r  *the following arguments are required: bar$Nr	  r$   s   &r   test_required_args_optional+TestExitOnError.test_required_args_optional  S      '  c 2x55K#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  RRR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r  r  r	  Nr	  r$   s   &r   test_required_args_zero_or_more/TestExitOnError.test_required_args_zero_or_more  r 
  r   c                    V P                   P                  R 4       V P                   P                  RRR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r  r  r	  Nr	  r$   s   &r   test_required_args_one_or_more.TestExitOnError.test_required_args_one_or_more  sS      '  c 2x55P#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  RRRR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r  r	  z9the following arguments are required: bar, BaZ1\[, BaZ2]$N)BaZ1BaZ2r	  r$   s   &r   +test_required_args_one_or_more_with_metavar;TestExitOnError.test_required_args_one_or_more_with_metavar  sV      '  c;K Lx55[#{{55r	;r   c                    V P                   P                  R 4       V P                   P                  RRR7       V P                  \        P                  RV P                   P
                  . 4       R# )rl  rm  r  r  r	  Nr	  r$   s   &r   test_required_args_remainder,TestExitOnError.test_required_args_remainder!  sS      '  e 4x55K#{{55r	;r   c                    V P                   P                  R R7      pVP                  R4       VP                  R4       V P                  \        P
                  RV P                   P                  . 4       R# )Tr  r_  r  z,one of the arguments --bar --baz is requiredNrA   r,  r   rH  r:   rI  rK   r   r   s   & r   %test_required_mutually_exclusive_args5TestExitOnError.test_required_mutually_exclusive_args(  s]    88$8G7#7#x55M#{{55r	;r   c                d   V P                   P                  4       pVP                  R 4       VP                  RRRR7       V P                  \        P
                  RV P                   P                  . RO4       V P                  \        P
                  RV P                   P                  . R	O4       R# )
r_  rm  r  r	  r	  z.argument BaZ: not allowed with argument --bar$z.argument --bar: not allowed with argument BaZ$Nr_  r  r  r  r_  r  r
  r
  s   & r   >test_conflicting_mutually_exclusive_args_optional_with_metavarNTestExitOnError.test_conflicting_mutually_exclusive_args_optional_with_metavar0  s    88:7#5U;x55O#{{557J	L 	x55O#{{557J	Lr   c                d   V P                   P                  4       pVP                  R 4       VP                  RRRR7       V P                  \        P
                  RV P                   P                  . RO4       V P                  \        P
                  RV P                   P                  . R	O4       R# )
r_  rm  r  r	  z/argument BAZ1: not allowed with argument --bar$z/argument --bar: not allowed with argument BAZ1$N)BAZ1r
  r
  r
  r
  s   & r   Ctest_conflicting_mutually_exclusive_args_zero_or_more_with_metavar1STestExitOnError.test_conflicting_mutually_exclusive_args_zero_or_more_with_metavar1;  s    88:7#5Y?x55P#{{557J	L 	x55P#{{557J	Lr   c                d   V P                   P                  4       pVP                  R 4       VP                  RRRR7       V P                  \        P
                  RV P                   P                  . RO4       V P                  \        P
                  RV P                   P                  . R	O4       R# )
r_  rm  r  r	  z8argument BAZ1\[, BAZ2]: not allowed with argument --bar$z8argument --bar: not allowed with argument BAZ1\[, BAZ2]$N)r
  BAZ2r
  r
  r
  r
  s   & r   Ctest_conflicting_mutually_exclusive_args_zero_or_more_with_metavar2STestExitOnError.test_conflicting_mutually_exclusive_args_zero_or_more_with_metavar2F  s    88:7#55EFx55Z#{{557J	L 	x55Z#{{557J	Lr   c                h   V P                   P                  R 4       V P                   P                  RRR7       V P                   P                  R4       V P                  \        P                  RV P                   P
                  R.4       V P                  \        P                  RV P                   P
                  R.4       V P                  \        P                  R	V P                   P
                  . RO4       V P                  \        P                  RV P                   P
                  . RO4       R
# )r  r  r*  r+  --fooglez7ambiguous option: --foob could match --foobaz, --foobler  z:ambiguous option: --foob=1 could match --foobaz, --fooble$--foob=1z8ambiguous option: --foob could match --foobaz, --fooble$N)r  rb  r"
  r  )r#
  r"
  r  r	  r$   s   &r   test_ambiguous_option%TestExitOnError.test_ambiguous_optionQ  s      ,  L A  ,x55IKK""XJ	0 	x55LKK""ZL	2 	x55JKK""$D	F 	x55LKK""$A	Cr   c                    V P                   P                  R 4       V P                  \        P                  RV P                   P
                  R.4       R# )r   z)No such file or directory: 'no-such-file'z@no-such-fileNr	  r$   s   &r   test_os_errorTestExitOnError.test_os_errorb  s@      (x55J#{{557H	Jr   r	  N)r)   r*   r+   r,   r\   r	  r	  r	  r	  r	  r	  r	  r	  r	  r
  r
  r

  r
  r
  r
  r
  r
  r$
  r'
  r.   r/   rR   s   @r   r	  r	    sw     F
=;L
W
;;;;;;;;;;	L	L	LC"J Jr   r	  c                      a  ] tR tRt o ]P
                  ! R4      tR tRR/R ltRR lt	R	 t
RR
 ltR tRR ltR tRR ltR tRR ltR tRR ltR tRR ltR tRtV tR# )TestProgNameii  zc        import argparse
        parser = argparse.ArgumentParser()
        parser.parse_args()
    c                    R \         P                  ,           V n        V P                  \         P                  V P                  4       \
        P                  ! V P                  4       R# )packageN)r   r  dirname
addCleanuprs   re   mkdirr$   s   &r   r\   TestProgName.setUpq  s<     9#8#88	(($,,7
r   compiledFc                   \         P                  ! WV P                  4      pV'       g   V# \        P                  ! VR R7       \
        P                  ! V4       \        P                  ! V4      pV# )T)doraise)	r	   make_scriptsource
py_compilecompilere   rv  r   make_legacy_pyc)r   r-
  basenamer1
  script_namepyc_files   &&&$  r   r4
  TestProgName.make_scriptv  sR    #//4;;O;5
		+ 00=r   Nc                N    \         P                  ! V P                  R W4      w  r4V# )test_zip)r	   make_zip_scriptr-
  )r   r:
  name_in_zipzip_namer   s   &&&  r   r?
  TestProgName.make_zip_script  s%    #33DLL*4?Nr   c                    \         P                  ! R .VORN5/ VB pV P                  \        P                  ! VP
                  P                  4       ^ ,          4      RV R24       R# )z-Xutf8rE   usage: z [-h]N)r	   assert_python_okr  re   r  out
splitlines)r   r  r   r   ress   &&*, r   check_usageTestProgName.check_usage  sX    ,,XMMdMfMSWW%7%7%9!%<="8*E2	4r   c                    \         P                  pV P                  V P                  W!R 7      pV P	                  \
        P                  P                  V4      VR4       R# )r1
  rE   N)r   TESTFNr4
  r-
  rI
  re   rn   r9
  )r   r1
  r9
  r:
  s   &&  r   test_scriptTestProgName.test_script  sG    ##&&t||X&Q))+6TJr   c                *    V P                  R R7       R# TrL
  N)rN
  r$   s   &r   test_script_compiled!TestProgName.test_script_compiled      $'r   c                   \         P                  P                  V P                  \        P
                  4      p\         P                  ! V4       V P                  VR VR7       V P                  \         RV 2V4       \         P                  P                  \         P                  V4      pV P                  \         RV 2V4       R# __main__rL
  r  N)re   rn   ro   r-
  r   rM
  r/
  r4
  rI
  pycurdir)r   r1
  r-
  dirname2s   &&  r   test_directoryTestProgName.test_directory  s    '',,t||Y-=-=>
*x@B4q	*G477<<		73B4q
+X6r   c                *    V P                  R R7       R# rQ
  )r[
  r$   s   &r   test_directory_compiled$TestProgName.test_directory_compiled  s    T*r   c                    R \         P                  ,           pV P                   RV 2pV P                  V P                  W!R7       V P	                  \
         RV 2RV\        P                  R7       R# )module.rL
   -m -m
PYTHONPATHN)r   r  r-
  r4
  rI
  rX
  re   rY
  )r   r1
  r9
  
modulenames   &&  r   test_moduleTestProgName.test_module  si    i333~Qxj1
xCB4tJ<0zbii 	 	Ar   c                *    V P                  R R7       R# rQ
  )rh
  r$   s   &r   test_module_compiled!TestProgName.test_module_compiled  rT
  r   c                   R \         P                  ,           pV P                   RV 2p\        P                  P                  V P                  V4      p\        P                  ! V4       V P                  VRVR7       V P                  \         RV 2RV\        P                  R7       V P                  \         RV 2RVR,           \        P                  R7       R# )	
subpackagerb
  rW
  rL
  rc
  rd
  re
  z	.__main__N)r   r  r-
  re   rn   ro   r/
  r4
  rI
  rX
  rY
  )r   r1
  r9
  packagename
subdirnames   &&   r   test_packageTestProgName.test_package  s    )"7"77az2WW\\$,,9

Z(CB4tK=1{ryy 	 	BB4tK=1{[8RYY 	 	Pr   c                *    V P                  R R7       R# rQ
  )rq
  r$   s   &r   test_package_compiled"TestProgName.test_package_compiled      4(r   c                    V P                  V P                  R VR7      pV P                  V4      pV P                  \         RV 2V4       R# rV
  )r4
  r-
  r?
  rI
  rX
  )r   r1
  r:
  rA
  s   &&  r   test_zipfileTestProgName.test_zipfile  sH    &&t||Z(&S''4B4q
+X6r   c                *    V P                  R R7       R# rQ
  )rx
  r$   s   &r   test_zipfile_compiled"TestProgName.test_zipfile_compiled  rv
  r   c                    V P                  V P                  R VR7      pRRV,          ,           pV P                  W#4      p\        P                  P                  VRR4      pV P                  \         RV 2V4       R# )rW
  rL
  zpackage/subpackage/__main__r,
  rn
  r  N)rM  z.pyc)r4
  r-
  r?
  re   rn   ro   rI
  rX
  )r   r1
  r:
  r@
  rA
  r-
  s   &&    r   test_directory_in_zipfile&TestProgName.test_directory_in_zipfile  sm    &&t||Z(&S3oh6OO''A'',,xLAB4q	*G4r   c                *    V P                  R R7       R# rQ
  )r~
  r$   s   &r   "test_directory_in_zipfile_compiled/TestProgName.test_directory_in_zipfile_compiled  s    &&&5r   )r-
  ra   r  )r)   r*   r+   r,   r  r  r5
  r\   r4
  r?
  rI
  rN
  rR
  r[
  r^
  rh
  rk
  rq
  rt
  rx
  r{
  r~
  r
  r.   r/   rR   s   @r   r*
  r*
  i  sw     __  	F
 
4
K
(7+A(	P)7
)56 6r   r*
  c                   &   a  ] tR tRt o R tRtV tR# )TestTranslationsi  c                0    V P                  \        4       R # ra   )assertMsgidsEqualr:   r$   s   &r   test_translations"TestTranslations.test_translations  s    x(r   r&   N)r)   r*   r+   r,   r
  r.   r/   rR   s   @r   r
  r
    s     ) )r   r
  c                   N   a a ] tR tRt oRtV 3R ltR tR tR tR t	Rt
VtV ;t# )	TestColorizedi  Nc                   < \         SV `  4        R  \        n        \        P                  ! RR7      P
                  V n        R# )c                      R # )Tr&   r   s   *,r   <lambda>%TestColorized.setUp.<locals>.<lambda>  s    r   T)force_colorN)r   r\   	_colorizecan_colorize	get_themer:   themer}  s   &r   r\   TestColorized.setUp  s,    !=	((T:CC
r   c           	        \         P                  ! R R\         P                  RRR7      pVP                  4       pVP	                  RRRRR	7       VP	                  R
RRRR	7       VP	                  R\
        RR7       VP	                  R\
        RR R7       VP	                  R\
        RR7       VP	                  RRRR R7       VP	                  RRR7       VP	                  RRdR7       VP	                  RRdRR7       VP	                  RRdRR7       VP	                  RRdRR7       VP	                  R R!ReRR7       VP	                  R"4       VP	                  R#4       VP	                  R$4       VP	                  R%R&4       VP                  R'R(R)R*7      pVP                  R+R R,R-7       VP                  R.R R/R-7      pVP	                  R0RdR1R7       V P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  p	V P                  P                  p
V P                  P                  pV P                  P                   pV P                  P"                  pV P                  P$                  pV P                  P&                  pVP)                  4       pV P+                  V\,        P.                  ! R2P1                  . R3NV NR4NV NV NRNV NR5NV NR6NV NR7NV NRNV NR8NV NR
NV NR7NV NRNV NR7NV NR9NV	 NR:NV NR7NV NR;NV	 NR<NV NR=NV NR>NV	 NR<NV NR7NV NR?NV	 NR<NV NR7NV NR@NV	 NR<NV NR=NV NRANV	 NRBNV NR7NV NRCNV	 NRDNV NR7NV NRENV	 NRFNV NR7NV NRGNV	 NRHNV NR=NV NRINV	 NRJNV NRKNV
 NRNV NRLNV
 NRNV NRLNV
 NRNV NRLNV
 NRMNV NRNNV NRONV NRPNV NRNV NRQNV NRNV NRRNV NRNV NRSNV NRTNV NRPNV NR6NV NRUNV NRVNV NRWNV NRNV NRUNV NRNV NRXNV NR
NV NRUNV NRNV NRYNV NRNV NRUNV NRNV NRPNV NRNV NRLNV NR:NV NRZNV NRNV NRLNV NR<NV NRPNV NRNV NRLNV NR<NV NR[NV NRNV NRLNV NR<NV NR[NV NRNV NRLNV NR<NV NR[NV NR NV NRUNV NR!NV NRLNV NRBNV NRZNV NR"NV NRLNV NRDNV NRPNV NR#NV NRLNV NRFNV NRPNV NR$NV NRLNV NRHNV NRPNV NR%NV NRUNV NR&NV NRLNV NRJNV NR\NV NR]NV NR^NV NR_NV NR`NV NR+NV NRaNV NR.NV NRbN4      4      4       Rc# )fTzColorful helpr  rC  )r9  rF  r2  rt  rE  r  r  r*  z	more spamrI  r  r  z	less spamr!  zthe baserK  r  zthe exponent)r   r?  r  &this_indeed_is_a_very_long_action_namez-oz--optional1r  z--optional2zpick oner  z--optional3r  z--optional4r>  z--optional5z--optional6r  z--optional7rv  z++barz-+bazr  z--countr  zvalid subcommandszadditional helpr  sub1z	sub1 help)r  r?  sub2z	sub2 helpr  r  r'                   rD
   [rE   ] [z | z--optional2 	OPTIONAL2z--optional3 z{X,Y,Z}z]
                            [z--optional4 z--optional5 z--optional6 z-p z{Aaaaa,Bbbbb,Ccccc,Ddddd}+f r  z++bar r  z-+baz BAZz-c COUNTz]
                            r  z{sub1,sub2} ...z1

                Colorful help

                positional arguments:z
                  z0                     the base
                  z4                     the exponent
                  zG
                                        the exponent

                options:r   r~  z>            show this help message and exit
                  z6         more spam (default: False)
                  z8           less spam (default: False)
                  zT
                                        pick one (default: None)
                  z.   pick one (default: None)
                  z

                zsubcommands:z8
                  valid subcommands

                  z{sub1,sub2}z/           additional help
                    z.                sub1 help
                    z*                sub2 help
                Nr  )AaaaaBbbbbCccccDdddd)r:   r;   r=  r,  r   r  r  r  r
  rE  headingsummary_long_optionsummary_short_optionsummary_labelsummary_actionlong_optionshort_optionlabelr,  resetrA  r  r  r  ro   )r   rA   r   r  r
  rE  r
  longshortr
  poslong_bshort_blabel_bpos_br
  r	  s   &                r   test_argparse_color!TestColorized.test_argparse_color  s   (('$BB
 335+l 	 	
 	)L{ 	 	
 	Cc
;c4 	 	
 	4 	 	

 	- 	 	
 	M
;M?C? 	 	
 	? 	 	
 	? 	 	
 	8	 	 	
 	D!G$G$D),**+" + 


 	fKH$$V;$O'?Lzz**$$zz--

//

((jj''''**))**""

!!

   &&(	 	OO' '  '	' '!&'(,v'-1'27'8:';@''AC'DI7'JM'NSW'TV'W\V]']`'af`g'gi'joip'ps'tysz'z|' ~C  }D' DG' HL  GM' MY' Z_  Y`' `i' jo  ip' ps' tx  sy' yE' FK  EL' LU' V[  U\'\'"V'#/'05w'6?'@Ew'FI'JN'O['\a[b'bk'lqkr'ru'vzu{' |H' IN  HO' OX' Y^  X_'_' $W' %(' ).w' /J' KP' QT' UZSZ' [^' _d]d' ef' glel' mp' quou' v|' }B  |C' CF' GL  FM' MP' QU  PV' V\' ]b  \c' cf' gl  fm'm' $W	' %(	' ).w	' /4	' 5:7	';	'
 !E'
 "#'
 $)''
 *+'
 ,/%'
 01'
 27'
 89'
 :='
 >d'
 ejcj'
 kl'
 mpkp'
 qB'
 CH  BI'
I' 	' /' 05g'6' '' ' !''"' '' ' !''"' '' @' AFw'G' 	' "' #(')'  )!'  !'  $W!'  %'!'  (.h!'  /5!'  6;G!' <!'" )#'" #'" $W#'" %'#'" (.h#'" /8#'" 9>w#'"?#'$ )%'$ %'$ $W%'$ %'%'$ (.h%'$ /6%'$ 7<W%'$=%'& )''& ''& $W''& %'''& (.h''& /:''& ;@''&A''( ()'( &)'( ',W)'( -.)'( /6Y)'( 7@)'( AFw)'(G)', (-', &-', ',W-', -.-', /6Y-', 7@-', AFw-',G-'. (/'. &/'. ',W/'. -./'. /6Y/'. 7@/'. AFw/'.G/'0 (1'0 &1'0 ',W1'0 -.1'0 /6Y1'0 7@1'0 AFw1'0G1'2 (3'2 &3'2 ',W3'2 -.3'2 /6Y3'2 7@3'2 AFw3'2G3'4 )5'4 5'4 $W5'4 %'5'4 (.h5'4 /:5'4 ;@5'4 AB5'4 CJ5'4 Kf5'4 glel5'4m5'8 )9'8 9'8 $W9'8 %&9'8 '.Y9'8 /09'8 16w9'879': (;':  ;': !&w;': '(;': )0y;': 14;': 5:7;':;;'< (='<  ='< !&w='< '(='< )0y='< 14='< 5:7='<;='> )?'> ?'> $W?'> %'?'> (.h?'> /6?'> 7<W?'> =>?'> ?FY?'> GL?'> MR7?'>S?'B 	C'B &C'B ',WC'B-C'H 'I'H 'I'H (-gI'H.I'J GK'J  K'J !&wK'J'K'L GM'L  M'L !&wM'L'M'),	
r   c                   \         P                  ! R RRRRR7      pV P                  P                  pV P                  P                  pV P                  P
                  pV P                  P                  pVP                  4       pV P                  V\        P                  ! RV RV V RV RV V R	V R
24      4       R# )FTzTest prog and usage colorsrC  z[prefix] %(prog)s [suffix])ru  r9  rF  rE  rG  r
  rD
  z	[prefix] z	 [suffix]z=

                Test prog and usage colors
                N)r:   r;   r
  r
  rE  r
  
prog_extrarA  r  r  r  )r   rA   r
  rE  r
  rG  r	  s   &      r   test_argparse_color_usage'TestColorized.test_argparse_color_usageX  s    ((4.
 **$$zz

  

%% &&(	 	OO	wivT%yY^X_ `		
r   c           	        R  p\         P                  ! RRVRR7      pVP                  RRRR7       VP                  R	R
R7       V P                  P                  pV P                  P
                  pV P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  p	V P                  P                  p
V P                  P                  pV P                  P                  pVP                  4       pV P                  V\         P"                  ! RP%                  . RNV NRNV NV NRNV NRNV NRNV NRNV NRNV NRNV NRNV NR	NV NRNV NRNV NRNV NR	NV NRNV NRNV NRNV	 NRNV NRNV NRNV NRNV	 NRNV NRNV NRNV NRNV
 NRNV NRN4      4      4       R# )c                 2    \         P                  ! V ^R7      # rV  rZ  r  s   &r   r[  FTestColorized.test_custom_formatter_function.<locals>.custom_formatterv  r]  r   rC  r  TrE  rt  r2  r9  rv  r"  rH  r  r  r
  r'               rD
  r
  rE   r
  r
  r  ] 

            r
  
                 &               spam help

            r
  r   r~  :         show this help message and exit
                 r        foo help
        N)r:   r;   r   r
  rE  r
  r
  r
  r
  r
  r
  r
  r,  r
  rA  r  r  r  ro   )r   r[  rA   rE  r
  r
  r
  r
  r
  r
  r
  r
  r
  r\  s   &             r   r`  ,TestColorized.test_custom_formatter_functionu  sL   	K ((,	
 	D'
;F5zz**$$

//

((jj''''**))**""

!!

  ((*hoo 	7 	7 ; 	7I	7	7"G	7$(6	7)-	7.3W	746	77<g	7=?	7@Ew	7FI	7JO	7PS	7TYSZ	7Z]	7^c]d	7df	7gjfk	7ko	7puov	7w	7 I	7 +	7 ,1'	72	7 		7 		7 #G		7$		7 I	7 	7 $W	7%	7 	7 	7 #G	7 $&	7 '-X	7 .4	7 5:7	7;	7 	7 	7 #G	7 $&	7 '-X	7 .3	7 49'	7 :;	7 <C)	7 DG	7 HMg	7N		7 	' 		r   c           	     
    ! R  R\         P                  4      p\         P                  ! RRVRR7      pVP                  RRRR	7       VP                  R
RR	7       V P                  P
                  pV P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  pV P                  P                  p	V P                  P                  p
V P                  P                  pV P                  P                  pVP                  4       pV P!                  V\"        P$                  ! RP'                  . RNV NRNV NV NRNV NRNV NRNV NRNV NRNV NRNV NRNV NR
NV NRNV NRNV NRNV NR
NV NRNV NRNV NRNV	 NRNV NRNV NRNV NRNV	 NRNV NRNV NRNV NRNV
 NRNV NRN4      4      4       R# ) c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )BTestColorized.test_custom_formatter_class.<locals>.CustomFormatteri  c                *   < \         SV `  V^R7       R# rf  rg  rh  s   &&r   r   KTestColorized.test_custom_formatter_class.<locals>.CustomFormatter.__init__  rj  r   r&   rk  r1   s   @@r   rl  r
    rm  r   rl  rC  r  Tr
  rv  r"  rH  r  r  r
  r'   r
  rD
  r
  rE   r
  r
  r  r
  r
  r
  r
  r
  r
  r   r~  r
  r  r
  N)r:   r5  r;   r   r
  rE  r
  r
  r
  r
  r
  r
  r
  r,  r
  rA  r  r  r  ro   )r   rl  rA   rE  r
  r
  r
  r
  r
  r
  r
  r
  r
  r\  s   &             r   rn  )TestColorized.test_custom_formatter_class  sX   	;h;; 	; ((+	
 	D'
;F5zz**$$

//

((jj''''**))**""

!!

  ((*hoo 	7 	7 ; 	7I	7	7"G	7$(6	7)-	7.3W	746	77<g	7=?	7@Ew	7FI	7JO	7PS	7TYSZ	7Z]	7^c]d	7df	7gjfk	7ko	7puov	7w	7 I	7 +	7 ,1'	72	7 		7 		7 #G		7$		7 I	7 	7 $W	7%	7 	7 	7 #G	7 $&	7 '-X	7 .4	7 5:7	7;	7 	7 	7 #G	7 $&	7 '-X	7 .3	7 49'	7 :;	7 <C)	7 DG	7 HMg	7N		7 	' 		r   )r
  )r)   r*   r+   r,   r  r\   r
  r
  r`  rn  r.   r/   r0   r1   s   @@r   r
  r
    s,     GDx
t
:"H# #r   r
  c                  B    / \         n        \        4       \        n        R # ra   )rI  rQ  r  rp  r&   r   r   tearDownModuler
    s    EJEJr   rW
  z--snapshot-update(  r
  r<   rI   r	  r   r?  re   r6
  rr   rp   r   r  rb   unittestr:   r  enumr   test.supportr   r   r   r   r   r	   test.support.i18n_helperr
   r   r   rn   r9
  
executablerX
  TextIOWrapperr   rT   r4   skip_unless_working_chmodr  r_   r   r   r   r   r   r;   r   r   r   r  r   r  r)  r7  r=  rM  rO  rU  rW  re  rh  rq  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r$  r&  r+  r-  rM  rQ  rS  rV  rX  r[  r]  r_  ra  re  rh  rj  rn  rz  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r   r   r;  rb  r  	eq_stderrrn  r  
eq_bstderrrI  rW  rd  rj  rp  skip_if_dac_overriderx  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r-  r<  r   r  r"  ro  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r  r  r  r  r?  rE  rR  rT  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r	  r  r  r  r  r  r  r  r  r,  r.  r7  r:  r?  rB  rD  rI  rM  rS  r|  r  r  r  r  r8  rK  rX  r]  rf  ry  r  r  r  r  r  r
	  r	  r	  r	  r	  r	  r*
  r
  r
  r
  r)   lenr   r?   mainr&   r   r   <module>r
     sN       	  	    
       
 ' " & W  WWcnn%:""" :$FH%% F:x    $$D6 D %D.& ) )%) %# L>!8!8 >q9D q9f 		&'7Cn n 4. ^  ~ .
> 
n . $ &N & ( , .^  
 
	> 	 . .  .> &. "> "
N 
~ N N > U U8
 
	 		> 	 &^  ~  &N "~ "n "n &N &
 
B~ N N 	^ 		N 	N > . > >    ( "~   $  ~ n ^ N 	n 	^ N . , . ,> 
^ 
	N 	>  
. 

. 
   ~ "
 

 
> &~ &.    ^ 6. 2 (. **L. *Z\> D20h 0Kx K0 h h , ,, W%h'	h'	n-	/
/
/F / L. 03< 3"\> .'F '" L.   , L.   & \>     
] 
  
#8 #,
 
$~ . ,> ,>8 >.>N >BJX J$~ ! !FV
( V
rD DJ  Q Q  Qn!+H !+F78 7H  I I  I^  _?x _?  _?B5?f 5?p '8  F( (V7H B!'8 !H*( *Z''8 'T%7H %P' 'T GX  F w  F (  Lf 	-	
	(	
	&	
	1	
	0	
	7	
	0	
	>	X0h X0|8X 8."( "&T1$ T1l 		*>5"E"l "H3B| 3Bl,< ,^ >1< 1h% %P3 3l6L 6r< ,\ >L :!| !H< 2# #L< D!L !H\ 4| 01\ 1h  N7X N7  N7b+ +\\ "
< 
L *| (L 4 *| (< *\ .< 0< 6\ 8.l .b-\ -`0| 0dL (L 2 :' 'V< :  V( V  VzXIh XI|-( -<8J8 8J~EQh EQXE/( E/V7H 7J-8 -$* *.H .&65h 65z
88 
8"};h };H+(h +(b*) *)Z|LX |LF\T \T~) )0eDX eDP.x .@BX B ( 2VJh VJr  Z68 Z6  Z6@)+ )gH gT z
388}qSXXa[,??$X.MMO r   