%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_argparse.pyc


Nac@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
m
Z
de
fdYZddlm
Z
dejfdYZdefd	YZd
efdYZdefd
YZdefdYZdZde	jfdYZdefdYZefZedeiZdefdYZdefdYZdefdYZdefdYZdefdYZ d efd!YZ!d"efd#YZ"d$efd%YZ#d&efd'YZ$d(efd)YZ%d*efd+YZ&d,efd-YZ'd.efd/YZ(d0efd1YZ)d2efd3YZ*d4efd5YZ+d6efd7YZ,d8efd9YZ-d:efd;YZ.d<efd=YZ/d>efd?YZ0d@efdAYZ1dBefdCYZ2dDefdEYZ3dFefdGYZ4dHefdIYZ5dJefdKYZ6dLefdMYZ7dNefdOYZ8dPefdQYZ9dRefdSYZ:dTefdUYZ;dVefdWYZ<dXefdYYZ=dZefd[YZ>d\efd]YZ?d^efd_YZ@d`efdaYZAdbefdcYZBddefdeYZCdfefdgYZDdhefdiYZEdjefdkYZFdlefdmYZGdnefdoYZHdpefdqYZIdrefdsYZJdtefduYZKdvefdwYZLdxefdyYZMdzefd{YZNd|efd}YZOd~efdYZPdefdYZQdefdYZRdefdYZSdefdYZTdefdYZUdefdYZVdefdYZWdefdYZXdefdYZYdefdYZZdefdYZ[defdYZ\defdYZ]defdYZ^defdYZ_defdYZ`defdYZadefdYZbdefdYZcdefdYZddefdYZedefdYZfdefdYZgdeefdYZhdeefdYZidefdYZjdefdYZkdeefdYZldeefdYZmdeefdYZndefdYZoejpeqedoejrdkddeefdYZsdeefdYZtdefdYZudefdYZvdefdYZwdefdYZxdefdYZydefdYZzdefdYZ{defdYZ|defdYZ}defdYZ~defdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdefdYZdee~fdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdeefdYZdefdYZdefdYZdefdYZdefdYZefZedeiZdefdYZdefd	YZd
efdYZdefd
YZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZd efd!YZd"efd#YZd$efd%YZd&efd'YZd(efd)YZd*efd+YZd,efd-YZd.efd/YZd0efd1YZd2efd3YZd4efd5YZd6efd7YZd8efd9YZd:efd;YZd<efd=YZd>efd?YZd@efdAYZdBefdCYZdDefdEYZdFefdGYZdHefdIYZdJefdKYZdLefdMYZdNefdOYZdPefdQYZdRefdSYZdTefdUYZdVefdWYZdXefdYYZdZefd[YZd\efd]YZd^efd_YZd`efdaYZdbefdcYZddefdeYZdfefdgYZdhefdiYZdjefdkYZdlZedmkrendS(niN(tStringIOtStdIOBuffercBseZRS((t__name__t
__module__(((s./usr/local/lib/python2.7/test/test_argparse.pyRs(ttest_supporttTestCasecBseZdZdZRS(cCsQ||kr4dGHt|GHt|GH|GH|GHntt|j||dS(Nt(treprtsuperRtassertEqual(tselftobj1tobj2((s./usr/local/lib/python2.7/test/test_argparse.pyR	scCs-tj}|jd|j|jdS(NtCOLUMNS(RtEnvironmentVarGuardtunsett
addCleanupt__exit__(R
tenv((s./usr/local/lib/python2.7/test/test_argparse.pytsetUp s
(RRR	R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs		tTempDirMixincBs#eZdZdZdZRS(cCs2tj|_tj|_tj|jdS(N(ttempfiletmkdtempttemp_dirtostgetcwdtold_dirtchdir(R
((s./usr/local/lib/python2.7/test/test_argparse.pyR+scCstj|jx_tj|jdtD]E\}}}x3|D]+}tjtjj|j|t	j
q?Wq)Wtj|jt
dS(Nttopdown(RRRtwalkRtFalsetchmodtpathtjointstattS_IWRITEtshutiltrmtreetTrue(R
troottdirstfilestname((s./usr/local/lib/python2.7/test/test_argparse.pyttearDown0s
(
-cCsTtjj|j|}t|d}|j|WdQXtj|tjdS(Ntw(	RR R!RtopentwriteRR"tS_IREAD(R
tfilenamet	file_pathtfile((s./usr/local/lib/python2.7/test/test_argparse.pytcreate_readonly_file7s(RRRR+R3(((s./usr/local/lib/python2.7/test/test_argparse.pyR)s		tSigcBseZdZRS(cOs||_||_dS(N(targstkwargs(R
R5R6((s./usr/local/lib/python2.7/test/test_argparse.pyt__init__?s	(RRR7(((s./usr/local/lib/python2.7/test/test_argparse.pyR4=stNScBs2eZdZdZdZdZdZRS(cKs|jj|dS(N(t__dict__tupdate(R
R6((s./usr/local/lib/python2.7/test/test_argparse.pyR7FscCsRt|jj}djg|D]}d|^q"}dt|j|fS(Ns, s%s=%rs%s(%s)(tsortedR9titemsR!ttypeR(R
tsorted_itemsttupt	kwarg_str((s./usr/local/lib/python2.7/test/test_argparse.pyt__repr__Is&cCst|t|kS(N(tvars(R
tother((s./usr/local/lib/python2.7/test/test_argparse.pyt__eq__PscCs||kS(N((R
RC((s./usr/local/lib/python2.7/test/test_argparse.pyt__ne__SsN(RRR7RAtNonet__hash__RDRE(((s./usr/local/lib/python2.7/test/test_argparse.pyR8Ds
			tArgumentParserErrorcBseZddddZRS(cCs>tj||||||_||_||_||_dS(N(t	ExceptionR7tmessagetstdouttstderrt
error_code(R
RJRKRLRM((s./usr/local/lib/python2.7/test/test_argparse.pyR7Ys
			N(RRRFR7(((s./usr/local/lib/python2.7/test/test_argparse.pyRHWsc
Os]ttjts$ttjtr1|||Stj}tj}tt_tt_zy|||}xptt|D]\}t||tjkrt|||nt||tjkrt|||qqW|SWnWt	k
rAtj
dj}tjj}tjj}	t
d||	|nXWd|t_|t_XdS(Nit
SystemExit(t
isinstancetsysRLRRKtlistRBtgetattrtsetattrRNtexc_infotcodetgetvalueRH(
t
parse_argsR5R6t
old_stdoutt
old_stderrtresulttkeyRURKRL((s./usr/local/lib/python2.7/test/test_argparse.pytstderr_to_parser_erroras,$
		
	tErrorRaisingArgumentParsercBs#eZdZdZdZRS(cOs"tt|j}t|||S(N(RR]RWR\(R
R5R6RW((s./usr/local/lib/python2.7/test/test_argparse.pyRWscOs"tt|j}t|||S(N(RR]texitR\(R
R5R6R^((s./usr/local/lib/python2.7/test/test_argparse.pyR^scOs"tt|j}t|||S(N(RR]terrorR\(R
R5R6R_((s./usr/local/lib/python2.7/test/test_argparse.pyR_s(RRRWR^R_(((s./usr/local/lib/python2.7/test/test_argparse.pyR]s		tParserTesterMetaclasscBseZdZdZRS(s}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Cs|dkrdSt|ds.t|_nt|dsIt|_nd}d}d}d}d}d	tfd
Y}	x>|||gD]-}
x$||gD]}|	||
|qWqWdS(NtParserTestCasetparser_signaturetparser_classcSs+x$|D]}|j|j|jqWdS(s(Add all arguments directly to the parserN(tadd_argumentR5R6(tparsertargument_signaturestsig((s./usr/local/lib/python2.7/test/test_argparse.pyt	no_groupss
cSs:|jd}x$|D]}|j|j|jqWdS(s4Add all arguments under a single group in the parsertfooN(tadd_argument_groupRdR5R6(ReRftgroupRg((s./usr/local/lib/python2.7/test/test_argparse.pyt	one_groups
cSsJxCt|D]5\}}|jd|}|j|j|jq
WdS(s0Add each argument in its own group to the parsersfoo:%iN(t	enumerateRjRdR5R6(ReRftiRgRk((s./usr/local/lib/python2.7/test/test_argparse.pytmany_groupsscSs
|j|S(s#Parse the args by passing in a list(RW(ReR5((s./usr/local/lib/python2.7/test/test_argparse.pytlistargsscSs<tj}|dg|t_z|jSWd|t_XdS(s(Parse the args by defaulting to sys.argviN(RPtargvRW(ReR5told_sys_argv((s./usr/local/lib/python2.7/test/test_argparse.pytsysargss
	tAddTestscBs,eZdZdZdZdZRS(cSs||_||_|jj}|jj}x~|j|jgD]j}|j}|||f}dj|}	|d}
y
|	|
_Wntk
rnXt||	|
q=WdS(Nt_cSs||dS(N((R
t	test_func((s./usr/local/lib/python2.7/test/test_argparse.pytwrappers(t_add_argumentst_parse_argsRt
test_failuresttest_successesR!t	TypeErrorRS(R
t
tester_clst
add_argumentsRWtadd_arguments_nametparse_args_nameRvt	func_nametnamest	test_nameRw((s./usr/local/lib/python2.7/test/test_argparse.pyR7s			

cSsA|jj}|jj}|j||}|j||j|S(N(RbR5R6RcRxRf(R
ttesterR5R6Re((s./usr/local/lib/python2.7/test/test_argparse.pyt_get_parsers
cSsO|j|}x9|jD].}|j}|j}|t|j|qWdS(N(RtfailurestsplittassertRaisesRHRW(R
RRetargs_strR5traises((s./usr/local/lib/python2.7/test/test_argparse.pyRzs
	cSsm|j|}xW|jD]L\}}t|trC|j}n|j||}|j||qWdS(N(Rt	successesROtstrRRyR	(R
RReR5texpected_nst	result_ns((s./usr/local/lib/python2.7/test/test_argparse.pyR{s(RRR7RRzR{(((s./usr/local/lib/python2.7/test/test_argparse.pyRts			(thasattrR4RbR]Rctobject(tclsR*tbasestbodydictRhRlRoRpRsRtR~RW((s./usr/local/lib/python2.7/test/test_argparse.pyR7s						-(RRt__doc__R7(((s./usr/local/lib/python2.7/test/test_argparse.pyR`sRatTestOptionalsSingleDashcBseZdZedgZdddddgZdedd
fdeddfd	eddfd
eddfdeddfgZRS(s1Test an Optional with a single-dash option strings-xtas--foos-x --foos-x -yRtxs-x as-xas-x -1s-1s-x-1N(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestOptionalsSingleDashCombinedcBseZdZedddedddddedgZd	d
ddd
ddddddgZdededd!dd!fdede	dd!dd!fdededd!dd	fdededd!dd	fdede	dd!dd	fdede	dd!dd	fdede	dd!dd	fdede	dd!dd	fdededddd!fdededddd!fdede	dddd	fd ede	dddd	fgZ
RS("s1Test an Optional with a single-dash option strings-xtactiont
store_trues-yyytstore_consttconsti*s-zRs--foos-xas-x --foos-x -zs-z -xs-yxs-yz as-yyyxs-yyyzas-xyzaRRtyyytzs-zas-z as-xzas-xz as-x -zas-x -z as-ys-x -yyy -zas-x -yyy -z aN(RRRR4RfRR8RRFR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs$tTestOptionalsSingleDashLongcBseZdZedgZddddddgZdeddfd	eddfd
eddfdeddfd
eddfgZRS(sATest an Optional with a multi-character single-dash option strings-fooRs--foos
-foo --foos-foo -ys-fooaRRis-foo as-foo -1s-1s-fo as-f aN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR0st&TestOptionalsSingleDashSubsetAmbiguouscBs"eZdZedededgZddddddd	gZd
eddddd
dfdeddddd
dfdeddddd
dfdeddddd
dfdeddddd
dfdeddddd
dfdeddddd
dfgZRS(s=Test Optionals where option strings are subsets of each others-fs-foobars-foorabs-foos-fos-foo bs-foobs-foobas-fooraRtftfoobartfoorabs-f aRs-fas-foatoas-fooatooas	-foobar as	-foorab aN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR>s!t TestOptionalsSingleDashAmbiguouscBseZdZededgZddddddd	gZd
eddddfd
eddddfdeddddfdeddddfdeddddfdeddddfdeddddfgZRS(s7Test Optionals that partially match but are not subsetss-foobars-foorabs-fs-f as-fas-foas-foos-fos-foo bRRRs-foob aRs-foor as-fooba as-foora as	-foobar as	-foorab aN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRNstTestOptionalsNumericcBseZdZedddgZddddddgZd	eddfd
eddfdeddfdedd
fgZRS(s(Test an Optional with a short opt strings-1tdesttoneRs-1 --foos-1 -ys-1 -1s-1 -2Rs-1 as-1as-1-2s-2N(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR^stTestOptionalsDoubleDashcBseZdZedgZddddddgZdeddfd	eddfd
eddfdeddfd
eddfgZRS(s1Test an Optional with a double-dash option strings--foos-fs-f aRs--foo -xs--foo --barRRis--foo as--foo=as
--foo -2.5s-2.5s
--foo=-2.5N(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRkst#TestOptionalsDoubleDashPartialMatchcBseZdZedddedgZddddd	d
gZdeded
dfdeded
dfdede	d
dfdede	d
dfdede	d
dfdede	d
dfgZ
RS(s7Tests partial matching with a double-dash option strings--badgerRRs--bats--bars--bs--bas--b=2s--ba=4s	--badge 5Rtbadgertbats--bat XtXs--bads--badgs--badgeN(RRRR4RfRR8RRFR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRyst"TestOptionalsDoubleDashPrefixMatchcBseZdZedddedgZdddddgZd	ed
eddfded
edd
fded
edd
fded
e	ddfded
e	ddfded
e	ddfded
e	ddfgZ
RS(s?Tests when one double-dash option string is a prefix of anothers--badgerRRs--bas--bars--bs--b=2s	--badge 5RRtbas--ba XRs--ba=Xs--bads--badgs--badgeN(RRRR4RfRR8RRFR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestOptionalsSingleDoubleDashc
BseZdZedddededddddgZdd	d
ddd
gZdededdddfdede	ddddfdededd
ddfdede	dd
ddfdede	ddddfdede	ddddfgZ
RS(s<Test an Optional with single- and double-dash option stringss-fRRs--bars-bazRRi*s-fbars-fbazs-bazfs-b BtBRRtbartbazs--ba Bs
-f --bar Bs-f -bs-ba -fN(RRRR4RfRR8RRFR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	t!TestOptionalsAlternatePrefixCharsc
Bs:eZdZedddeZedddededdd	d
dgZdd
ddddddddddgZdededd dd fdede
dd dd fdededddd fdede
dddd fdede
dd ddfdede
dd ddfgZRS(!s9Test an Optional with option strings with custom prefixestprefix_charss+:/tadd_helps+fRRs::bars/bazRRi*s--bars-fbars-b BRs-fs--bar Bs-bazs-hs--helps+hs::helps/helpRRRRs::ba Bs
+f ::bar Bs+f /bs/ba +fN(RRRR4RRbRfRR8RFR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	*t*TestOptionalsAlternatePrefixCharsAddedHelpc
Bs+eZdZedddeZedddededdd	d
dgZdd
dddddgZdede	ddddfdededdddfdede	ddddfdededdddfdededdddfdededdddfgZRS(sWhen ``-`` not in prefix_chars, default operators created for help
       should use the prefix_chars in use rather than - or --
       http://bugs.python.org/issue9444Rs+:/Rs+fRRs::bars/bazRRi*s--bars-fbars-b BRs-fs--bar Bs-bazRRRRs::ba Bs
+f ::bar Bs+f /bs/ba +fN(RRRR4R&RbRfRR8RRFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	t2TestOptionalsAlternatePrefixCharsMultipleShortArgscBseZdZedddeZedddedddedddgZd	d
ddd
gZdedededefdede	dedefdede	de	defdede	de	de	fgZ
RS(s@Verify that Optionals must be called with their defined prefixesRs+-Rs-xRRs+ys+zs-ws-xyzs+xs-ys+xyzRRtyRs+y -xs+yz -x(RRRR4RRbRfRR8R&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	tTestOptionalsShortLongcBseZdZeddddddgZddd	d
gZdedefdedefdedefdedefdedefgZ	RS(
s<Test a combination of single- and double-dash option stringss-vs	--verboses-ns--noisyRRs
--x --verboses-NRs-v xRtverbose(
RRRR4RfRR8RR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestOptionalsDestc	BseZdZededddgZdgZdeddddfd	edddd
fdedddd
fdeddddfgZRS(s*Tests various means of setting destinations	--foo-bars--bazRtzabbazRs--foo-bar ftfoo_barRs--baz gtgs--foo-bar h --baz ithRns--baz j --foo-bar ktktjN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	tTestOptionalsDefaultcBseZdZededddgZdgZdeddddfd	eddddfd
eddddfgZRS(s*Tests specifying a default for an Optionals-xs-ytdefaulti*RRRRs-xxs-yyN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	tTestOptionalsNargsDefaultcBsSeZdZedgZddgZdeddfdeddfgZRS(s7Tests not specifying the number of args for an Optionals-xRRRs-x aN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
tTestOptionalsNargs1cBs\eZdZedddgZddgZdeddfdeddgfgZRS(	s&Tests specifying 1 arg for an Optionals-xtnargsiRRRs-x aN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR&s
tTestOptionalsNargs3cBsneZdZedddgZddddddgZd	ed
dfded
ddd
gfgZRS(s'Tests specifying 3 args for an Optionals-xRiRs-x as-x a bsa -xsa -x bRRs-x a b ctbtcN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR1s
tTestOptionalsNargsOptionalcBseZdZedddedddddeddddd	ed
dddedddd
gZdgZdedddddd	ddfdedddddd	ddfdedddddd	ddfdedddddd	ddfdedddddd	ddfdeddddddddfdeddddddddfd
edddddd	ddfdedddddd	ddfg	Z	RS(s0Tests specifying an Optional arg for an Optionals-wRt?s-xRi*s-yRtspams-zR=t42t84t2RR,RRRiTs-w 2s-x 2s-y 2s-z 2iN(
RRRR4tintRfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR<s'	$$$$$$$$tTestOptionalsNargsZeroOrMorec
BseZdZedddedddddgZdgZded	dd
dfded	gd
dfded	dgd
dfded	dd
gd
dfded	dd
gfded	dd
dgfded	dd
dd
gfgZRS(s?Tests specifying args for an Optional that accepts zero or mores-xRt*s-yRRRRRRs-x as-x a bRs-y as-y a bN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRSs	tTestOptionalsNargsOneOrMorecBseZdZedddedddddgZddddd	gZd
eddddfd
eddgddfdedddgddfdeddddgfdedddddgfgZRS(s>Tests specifying args for an Optional that accepts one or mores-xRt+s-yRRRsa -xsa -y bRRRs-x as-x a bRs-y as-y a bN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRfstTestOptionalsChoicescBseZdZedddeddededgZddd	d
dgZded
dddfded
dddfded
dddfded
dddfded
dddfded
dddfgZ
RS(s,Tests specifying the choices for an Optionals-ftchoicestabcs-gR=iRs-f ds-fads-gas-g 6RRRs-f as-f cRs-g 0is-g 03is-fb -g4RiN(RRRR4RtrangeRfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRws!tTestOptionalsRequiredcBs_eZdZeddedegZddgZdeddfd	edd
fgZ	RS(s)Tests an optional action that is requireds-xR=trequiredRRs-x 1Ris-x42i*(
RRRR4RR&RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
tTestOptionalsActionStorecBsYeZdZedddgZddgZdedd
fdedd	fgZRS(s&Tests the store action for an Optionals-xRtstoreRsa -xRRs-xfooRiN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
tTestOptionalsActionStoreConstcBs\eZdZeddddegZdgZdeddfdedefgZ	RS(	s,Tests the store_const action for an Optionals-yRRRRRRN(
RRRR4RRfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
	tTestOptionalsActionStoreFalsecBs\eZdZedddgZdddgZdedefdedefgZ	RS(	s,Tests the store_false action for an Optionals-zRtstore_falseRs-zas-z aRR(
RRRR4RfRR8R&RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
tTestOptionalsActionStoreTruecBs\eZdZedddgZdddgZdedefdedefgZ	RS(	s+Tests the store_true action for an Optionals--appleRRRs	--apple=bs	--apple bRtapple(
RRRR4RfRR8RR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
tTestOptionalsActionAppendcBszeZdZedddgZddddgZdeddfd	eddgfd
edddgfgZRS(
s'Tests the append action for an Optionals--bazRtappendRsa --bazs	--baz a bRRs--baz as--baz a --baz bRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRst$TestOptionalsActionAppendWithDefaultcBseZdZedddddggZddddgZd	ed
dgfded
ddgfded
ddd
gfgZRS(s'Tests the append action for an Optionals--bazRRRRRsa --bazs	--baz a bRRs--baz as--baz a --baz bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestOptionalsActionAppendConstc	BseZdZeddddeedddddgZd	dd
ddgZd
eddfdedegfdedededgfgZ	RS(s-Tests the append_const action for an Optionals-bRtappend_constRs-cRRRRsa -cs-bxs-b xRs-b -cx -b -cyzRtyzN(
RRRR4RIRfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRst)TestOptionalsActionAppendConstWithDefaultc
BseZdZeddddeddgedddd	d
gZdddd
dgZded
dgfded
degfded
dededgfgZRS(s-Tests the append_const action for an Optionals-bRRRRRs-cRRRRsa -cs-bxs-b xRs-b -cx -b -cyzRR(	RRRR4RIRfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestOptionalsActionCountcBs_eZdZedddgZddddgZded	dfded	d
fgZRS(s&Tests the count action for an Optionals-xRtcountRs-x as-x bs	-x a -x bRRiN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
tTestPositionalsNargsNonecBsDeZdZedgZdddgZdeddfgZRS(s,Test a Positional that doesn't specify nargsRiRs-xsa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestPositionalsNargs1cBsMeZdZedddgZdddgZdeddgfgZRS(s.Test a Positional that specifies an nargs of 1RiRiRs-xsa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestPositionalsNargs2cBsSeZdZedddgZddddgZdeddd	gfgZRS(
s.Test a Positional that specifies an nargs of 2RiRiRRs-xsa b csa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestPositionalsNargsZeroOrMorecBsqeZdZedddgZdgZdedgfdeddgfdedddgfgZRS(	s0Test a Positional that specifies unlimited nargsRiRRs-xRRsa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR$s	t%TestPositionalsNargsZeroOrMoreDefaultcBsweZdZedddddgZdgZdeddfdeddgfd	eddd
gfgZRS(s>Test a Positional that specifies unlimited nargs and a defaultRiRRRRs-xRRsa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR0s	tTestPositionalsNargsOneOrMorecBsbeZdZedddgZddgZdeddgfdedddgfgZRS(	s2Test a Positional that specifies one or more nargsRiRRRs-xRsa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR<s
tTestPositionalsNargsOptionalcBsYeZdZedddgZddgZdeddfdeddfgZRS(	sTests an Optional PositionalRiRRs-xsa bRRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRGs
t#TestPositionalsNargsOptionalDefaultcBs_eZdZedddddgZddgZdeddfd	edd	fgZRS(
s1Tests an Optional Positional with a default valueRiRRRi*s-xsa bRR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRRs
t,TestPositionalsNargsOptionalConvertedDefaultcBsheZdZeddddeddgZddd	gZd
eddfdedd
fgZRS(snTests an Optional Positional with a default value
    that needs to be converted to the appropriate type.
    RiRRR=RRs-xsa bs1 2Ri*t1i(	RRRR4RRfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR]s
!tTestPositionalsNargsNoneNonecBsVeZdZededgZddddgZdeddddfgZRS(	s-Test two Positionals that don't specify nargsRiRRs-xRsa b csa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRlstTestPositionalsNargsNone1cBs_eZdZededddgZddddgZd	edddd
gfgZRS(s6Test a Positional with no nargs followed by one with 1RiRRiRs--fooRsa b csa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRvstTestPositionalsNargs2NonecBseeZdZedddedgZddddd	gZd
edddgddfgZRS(
s8Test a Positional with 2 nargs followed by one with noneRiRiRRs--fooRsa bsa b c dsa b cRR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRst"TestPositionalsNargsNoneZeroOrMorec	BseZdZededddgZddgZdedddgfdedddd	gfd
edddd	dgfgZRS(s>Test a Positional with no nargs followed by one with unlimitedRiRRRRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRst!TestPositionalsNargsNoneOneOrMorecBszeZdZededddgZdddgZdedddd	gfd
edddd	dgfgZRS(s@Test a Positional with no nargs followed by one with one or moreRiRRRRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
t TestPositionalsNargsNoneOptionalcBsqeZdZededddgZdddgZdeddddfd	edddd
fgZRS(s@Test a Positional with no nargs followed by one with an OptionalRiRRRRs--foosa b cRsa bRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
t"TestPositionalsNargsZeroOrMoreNonecBseZdZedddedgZddgZdedgddfdeddgdd	fd
eddd	gddfgZRS(s@Test a Positional with unlimited nargs followed by one with noneRiRRRRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRst!TestPositionalsNargsOneOrMoreNonecBszeZdZedddedgZdddgZdeddgdd	fd
eddd	gddfgZRS(sBTest a Positional with one or more nargs followed by one with noneRiRRRRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
t TestPositionalsNargsOptionalNonecBsweZdZedddddedgZddd	gZd
edddd
fdedd
ddfgZRS(
sBTest a Positional with an Optional nargs followed by one with noneRiRRRi*RRs--foosa b cRsa bR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
$tTestPositionalsNargs2ZeroOrMorecBseZdZedddedddgZdddgZd	eddd
gdgfdeddd
gddgfgZRS(
s=Test a Positional with 2 nargs followed by one with unlimitedRiRiRRRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
$tTestPositionalsNargs2OneOrMorecBskeZdZedddedddgZdddd	gZd
edddgddgfgZRS(
s?Test a Positional with 2 nargs followed by one with one or moreRiRiRRRs--fooRsa bsa b cRR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs$tTestPositionalsNargs2OptionalcBseZdZedddedddgZdddd	gZd
edddgddfdedddgdd
fgZRS(s7Test a Positional with 2 nargs followed by one optionalRiRiRRRs--fooRsa b c dsa bRsa b cRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
$tTestPositionalsNargsZeroOrMore1cBseZdZedddedddgZddgZdedgddgfd	eddgdd
gfdeddd
gddgfgZRS(
s=Test a Positional with unlimited nargs followed by one with 1RiRRRiRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs$tTestPositionalsNargsOneOrMore1cBseZdZedddedddgZdddgZd	eddgdd
gfdeddd
gddgfgZRS(
s?Test a Positional with one or more nargs followed by one with 1RiRRRiRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
$tTestPositionalsNargsOptional1cBs}eZdZedddedddgZdddgZd	edddd	gfd
edd	ddgfgZRS(
s?Test a Positional with an Optional nargs followed by one with 1RiRRRiRs--foosa b cRsa bRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs
$t#TestPositionalsNargsNoneZeroOrMore1c	BseZdZededddedddgZddd	gZd
edd	dgddgfdedd	ddgdd
gfgZRS(s=Test three Positionals: no nargs, unlimited nargs and 1 nargsRiRRRRiRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	!t"TestPositionalsNargsNoneOneOrMore1c	BseZdZededddedddgZddd	d
gZdedd	dd
gddgfd
edd	dd
dgddgfgZRS(s?Test three Positionals: no nargs, one or more nargs and 1 nargsRiRRRRiRs--fooRRsa b cRsa b c dtd(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	$t!TestPositionalsNargsNoneOptional1c	BseZdZededddddedddgZd	d
dgZdedddddd
gfdedddd
ddgfgZRS(s;Test three Positionals: no nargs, optional narg and 1 nargsRiRRRRg?RiRs--fooRsa bRsa b cR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR	.s	!t$TestPositionalsNargsOptionalOptionalcBseZdZedddedddddgZddgZd	edd
ddfd
edd
ddfdedd
ddfgZRS(sTest two optional nargsRiRRRRi*s--foosa b cRRsa bRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR
=st&TestPositionalsNargsOptionalZeroOrMorec
BseZdZedddedddgZdgZdedd
dgfdedddgfd	edddd
gfdedddd
dgfgZRS(s1Test an Optional narg followed by unlimited nargsRiRRRRs--fooRRsa bRsa b cRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRLs$	t%TestPositionalsNargsOptionalOneOrMorec	BseZdZedddedddgZddgZdedd
ddgfd	edddd
gfdedddd
dgfgZRS(s3Test an Optional narg followed by one or more nargsRiRRRRRs--fooRsa bRsa b cRN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRYs$tTestPositionalsChoicesStringcBsheZdZeddedgZdddddgZd	edd	fd
edd
fgZRS(s&Test a set of single-character choicesRRtabcdefgRs--fooRRtefRR(	RRRR4tsetRfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR
es
tTestPositionalsChoicesIntcBsneZdZeddededgZddddd	gZd
eddfdedd
fgZ	RS(sTest a set of integer choicesRR=RiRs--fooRRRt4it15i(
RRRR4RRRfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRps
!tTestPositionalsActionAppendcBsqeZdZedddedddddgZdddd	d
gZdedddd
ggfgZRS(sTest the 'append' actionRRRRiRs--fooRsa bsa b c dsa b cRR(RRRR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR{s
t"TestOptionalsNumericAndPositionalsc	BseZdZedddedddddgZd	d
gZdedddefdedddefdeddde	fd
eddde	fgZ
RS(s;Tests negative number args when numeric options are presentRRRs-4RRRRs-2s-315RRs-4 aN(RRRR4RfRR8RFRR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRst(TestOptionalsAlmostNumericAndPositionalsc
BseZdZedddedddddgZd	gZd
edddefdedddefdedddefdeddde	fd
eddde	fgZ
RS(sBTests negative number args when almost numeric options are presentRRRs-k4RRRRs-k3Rs-2Rs-k4 aN(RRRR4RfRR8RFRR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	t$TestEmptyAndSpaceContainingArgumentsc
BseZedddeddddgZdgZdgeddddfdgeddddfd	gedd	ddfddgeddddfddgeddddfdd	gedddd	fd
geddddfdgedddd	fgZRS(
RRRs-ys--yyyRRRsa badgers	-a badgers--yyy=a badgers--yyy=-a badgerN(RRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	t TestPrefixCharacterOnlyArgumentsc
Bs.eZeddZeddddddded	dd
dedd
edddddgZddgZdeddd
d
de	fdeddd
d
de	fdeddd
d
de	fdeddd
dde	fdeddd
d
de
fdeddd
d
de	fgZRS(Rs-+t-RRRRRRRRR=Ri*s-+-RRRs-ys+ -Rs- XRs+ -3is- ===s===N(RRR4RbRRfRR8RFRR&R(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestNargsZeroOrMorecBseZdZedddedddgZgZdedd
dgfdedgdgfdeddgdgfd	eddgdd
gfdedd
ddgfdedgddgfdedd
gddgfgZRS(s?Tests specifying args for an Optional that accepts zero or mores-xRRRRRs-x aRs	-x a -- bRsa -xsa -x bN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs$tTestNargsRemaindercBseZdZededddedgZdddgZdedddgd	dfd
edddgd	dfdedddd
dddgd	dfdedddddgd	dfgZRS(s2Tests specifying a positional with nargs=REMAINDERRRRs...s-zRs-z ZRRs-z Z XtZs
X A B -z ZtARs	X Y --footYs--fooN(	RRRR4RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs'*tTestOptionLikecBseZdZeddeeddeddedddgZdd	d
ddd
dddddddg
Zdedd%dd%dgfdedddd%dgfdedddd%ddgfdedd%dddgfdedd%dddgfdedd%dddgfd edd%ddddgfdedd%dd%ddgfd!edd"dd%ddgfd#edd"dd%ddgfd$edd%dd"ddgfgZ	RS(&s.Tests options that may or may not be argumentss-xR=s-3RRRRRs-y2.5s-xas-x -as-x -3s-x -3.5s-3 -3.5s-x -2.5s	-x -2.5 as-3 -.5sa x -1s-x -1 as-3 -1 aRRs-x 2.5g@s-x 2.5 aRs-3.5g?s-3-.5gs-3 .5sa -3.5sa -x 1g?s-x 1 as-3 1 aN(
RRRR4tfloatRfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs&		!!!!!tTestDefaultSuppressc
BseZdZeddddejeddddejeddd	dejgZd
gZdefdeddfd
eddddgfdede	fdeddde	fdeddddgde	fgZ
RS(s%Test actions with suppressed defaultsRiRRRRRs--bazRRs-xRRsa bRRsa --bazs	--baz a b(RRRR4targparsetSUPPRESSRfRR8R&R(((s./usr/local/lib/python2.7/test/test_argparse.pyR!
s	tTestParserDefaultSuppressc
BseZdZedejZedddedddeddd	gZd
gZde	fde	ddfd
e	ddddgfde	de
fde	ddde
fde	ddddgde
fgZRS(s4Test actions with a parser-level default of SUPPRESStargument_defaultRiRRRRs--bazRRs-xRRsa bRRsa --bazs	--baz a b(RRRR4R"R#RbRfRR8R&R(((s./usr/local/lib/python2.7/test/test_argparse.pyR$s	tTestParserDefault42c
BseZdZeddddZedddeddd	ed
ddgZd
gZdeddddddfdeddddddfdeddddgddfd
edddddefdedddddefdeddddgdefgZ	RS(s.Test actions with a parser-level default of 42R%i*tversions1.0RiRRRRs--bazRRs-xRRRsa bRsa --bazs	--baz a b(
RRRR4RbRfRR8R&R(((s./usr/local/lib/python2.7/test/test_argparse.pyR&1s	!tTestArgumentsFromFilecBsdeZdZdZeddZedededddgZd	d
ddd
gZdeddddddgfdedddddddgfdeddddddgfdeddddddgfdedddddddgfdedddddddgfdd	ddgedd	ddddgfgZ
RS(s"Test reading arguments from a filecCsctt|jdd	d
g}x:|D]2\}}t|d}|j||jq)WdS(Nthellos
hello world!
t	recursives-a
A
@hellotinvalids@no-such-path
R,(R)s
hello world!
(R*s-a
A
@hello(R+s@no-such-path
(RR(RR-R.tclose(R
t
file_textsR ttextR2((s./usr/local/lib/python2.7/test/test_argparse.pyRHs	
tfromfile_prefix_charst@s-aRRRRRs-bRs@invalids@missingsX YRRs
X -a A Y ZRRs@hello Xshello world!sX @hellos-a B @recursive Y ZsX @recursive Z -a BRN(RRRRR4RbRfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyR(Es			!$!!$$tTestArgumentsFromFileConvertercBs~eZdZdZdefdYZeZeddZedddgZ	gZ
d	edd
ddgfgZRS(
s"Test reading arguments from a filecCs]tt|jdg}x:|D]2\}}t|d}|j||jq#WdS(NR)s
hello world!
R,(R)s
hello world!
(RR1RR-R.R,(R
R-R R.R2((s./usr/local/lib/python2.7/test/test_argparse.pyRks	
tFromFileConverterArgumentParsercBseZdZRS(ccs2x+|jD]}|js%q
n|Vq
WdS(N(Rtstrip(R
targ_linetarg((s./usr/local/lib/python2.7/test/test_argparse.pytconvert_arg_line_to_argsws(RRR6(((s./usr/local/lib/python2.7/test/test_argparse.pyR2usR/R0RRRs@hello XR)sworld!R(
RRRRR]R2RcR4RbRfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyR1hs	
tTestFileTypeReprcBseZdZdZRS(cCs)tjd}|jdt|dS(Ntrs
FileType('r')(R"tFileTypeR	R(R
R=((s./usr/local/lib/python2.7/test/test_argparse.pyttest_rscCs,tjdd}|jdt|dS(NtwbisFileType('wb', 1)(R"R9R	R(R
R=((s./usr/local/lib/python2.7/test/test_argparse.pyt	test_wb_1s(RRR:R<(((s./usr/local/lib/python2.7/test/test_argparse.pyR7s	tRFilecBs&eZiZdZdZdZRS(cCs
||_dS(N(R*(R
R*((s./usr/local/lib/python2.7/test/test_argparse.pyR7scCs||jkr|j|}n!|j}|j|<|jt|tsa|jd}n|j|jko||kSS(Ntascii(tseentreadR,RORtdecodeR*(R
RCR.((s./usr/local/lib/python2.7/test/test_argparse.pyRDs
N(RRR?R7RFRGRD(((s./usr/local/lib/python2.7/test/test_argparse.pyR=s	t
TestFileTypeRcBseZdZdZeddejeddejdgZdddgZde	d	ddedfd
e	d	eddedfde	d	eddedfd
e	d	ej
dej
fde	d	ddedfgZRS(s8Test the FileType option/argument type for reading filescCsstt|jxLddgD]>}ttjj|j|d}|j||j	q W|j
ddS(NRiRR,treadonly(RRBRR-RR R!RR.R,R3(R
t	file_nameR2((s./usr/local/lib/python2.7/test/test_argparse.pyRs!
s-xR=RR8s-x barsnon-existent-file.txtRiRs
-x foo barRs
bar -x foos-x - -RCN(RRRRR4R"R9RfRR8RFR=RPtstdinR(((s./usr/local/lib/python2.7/test/test_argparse.pyRBs		$$tTestFileTypeDefaultscBsbeZdZdZeddejdddgZdgZde	d	e
d
fgZRS(s<Test that a file is not created unless the default is neededcCsOtt|jttjj|jdd}|jd|j	dS(NtgoodR,(
RRFRR-RR R!RR.R,(R
R2((s./usr/local/lib/python2.7/test/test_argparse.pyRs!
s-cR=R8Rsno-file.txtRs-c goodRRG(RRRRR4R"R9RfRR8R=R(((s./usr/local/lib/python2.7/test/test_argparse.pyRFs
	$	tTestFileTypeRBc	BseZdZdZeddejdeddejdgZddgZde	dd
dedfd	e	dedded
fde	dedded
fde	dej
dej
fgZRS(s8Test the FileType option/argument type for reading filescCsftt|jxLddgD]>}ttjj|j|d}|j||j	q WdS(NRiRR,(
RRHRR-RR R!RR.R,(R
RDR2((s./usr/local/lib/python2.7/test/test_argparse.pyRs
!
s-xR=trbRs-x barRiRs
-x foo barRs
bar -x foos-x - -N(RRRRR4R"R9RfRR8RFR=RPRER(((s./usr/local/lib/python2.7/test/test_argparse.pyRHs	$$tWFilecBs)eZeZdZdZdZRS(cCs
||_dS(N(R*(R
R*((s./usr/local/lib/python2.7/test/test_argparse.pyR7scCsp||jkr`d}d|jkr6|jd}n|j||j|jj|n|j|jkS(NsCheck that file is writable.RR>(R?tmodetencodeR.R,taddR*(R
RCR.((s./usr/local/lib/python2.7/test/test_argparse.pyRDs

N(RRRR?R7RFRGRD(((s./usr/local/lib/python2.7/test/test_argparse.pyRJs		tgeteuidisnon-root user requiredt
TestFileTypeWc	BseZdZdZeddejdeddejdgZddgZdddgZde	d	ddedfd
e	d	eddedfde	d	eddedfd
e	d	ej
dej
fgZRS(s8Test the FileType option/argument type for writing filescCs$tt|j|jddS(NRC(RRORR3(R
((s./usr/local/lib/python2.7/test/test_argparse.pyRss-xR=R,Rs-x barRCRiRs
-x foo barRs
bar -x foos-x - -N(RRRRR4R"R9RfRR8RFRJRPRKR(((s./usr/local/lib/python2.7/test/test_argparse.pyROs	$$tTestFileTypeWBc	BseZeddejdeddejdgZddgZdeddde	dfdede	dde	dfd	ede	dde	dfd
ede
jde
jfgZRS(s-xR=R;Rs-x barRiRs
-x foo barRs
bar -x foos-x - -N(
RRR4R"R9RfRR8RFRJRPRKR(((s./usr/local/lib/python2.7/test/test_argparse.pyRPs$$tTestTypeCallablecBseZdZeddeeddegZddddgZded	d
ddfded	d
ddfded	dddfgZ
RS(s,Test some callables as option/argument typess--eggsR=RRt42js--eggs as	--eggs 2is--eggs=42 42teggsi*gE@s--eggs 2j -- -1.5y@gs1024.675g3333@N(RRRR4tcomplexR RfRR8RFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRQ"stTestTypeUserDefinedcBseZdZdefdYZeddeeddegZgZdededded	fd
ededdedfgZ	RS(
s(Test a user-defined option/argument typetMyTypecBs eZdZdZdZRS(cCs
||_dS(N(tvalue(R
RW((s./usr/local/lib/python2.7/test/test_argparse.pyR76scCs(t||jft||jfkS(N(R=RW(R
RC((s./usr/local/lib/python2.7/test/test_argparse.pyRD;sN(RRR7RFRGRD(((s./usr/local/lib/python2.7/test/test_argparse.pyRV4s	s-xR=Rsa -x bRRRs-xf gRR(
RRRRRVR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRU1s$tTestTypeClassicClasscBseZdZdd
dYZeddeeddegZgZdededded	fd
ededdedfgZRS(sTest a classic class typetCcBs eZdZdZdZRS(cCs
||_dS(N(RW(R
RW((s./usr/local/lib/python2.7/test/test_argparse.pyR7NscCs(t||jft||jfkS(N(R=RW(R
RC((s./usr/local/lib/python2.7/test/test_argparse.pyRDSsN(RRR7RFRGRD(((s./usr/local/lib/python2.7/test/test_argparse.pyRYLs	s-xR=Rsa -x bRRRs-xf gRR((	RRRRYR4RfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRXIs$tTestTypeRegistrationcBseZdZdZRS(s*Test a user-defined type by registering itcCsd}tj}|jdd||jddd|jddd|j|jdjtdddd|j|jd	jtdddd
dS(NcSsd|S(Nsmy_type{%s}((tstring((s./usr/local/lib/python2.7/test/test_argparse.pytget_my_typefsR=tmy_types-xRRRs
my_type{1}s-x 1 42smy_type{42}(	R"tArgumentParsertregisterRdR	RWRR8RF(R
R\Re((s./usr/local/lib/python2.7/test/test_argparse.pyttestds	(RRRR`(((s./usr/local/lib/python2.7/test/test_argparse.pyRZastTestActionUserDefinedcBseZdZdejfdYZdejfdYZedddded	ed
dedded	e	d
dd
dgZ
gZdeddddfdeddddfdeddddfdeddddfgZ
RS(s*Test a user-defined option/argument actiontOptionalActioncBseZddZRS(cCsy|jdks%td|j|dksAtd|tdd}|dkrhd|_n(|dkrd
|_ntd|||kstd||fWn1tk
rtjd
}td|nXt|d|dS(NRsdest: %ss-ssflag: %sg?g?g?ig@iTs	value: %ssexpected %s, got %sisopt_action failed: %s(g?g?(g@(RtAssertionErrorR8RRPRTRHRS(R
Ret	namespaceRWt
option_stringRte((s./usr/local/lib/python2.7/test/test_argparse.pyt__call__}s"
N(RRRFRg(((s./usr/local/lib/python2.7/test/test_argparse.pyRb{stPositionalActioncBseZddZRS(cCsy|dkstd||jdksAtd|jtdd}|dkrhd|_n@|dkrd	|_n(|dkrd
|_ntd|||kstd||fWn1tk
rtjd}td
|nXt|d|dS(Nsoption_string: %sRsdest: %sii*iTg?ig?g?s	value: %ssexpected %s, got %ssarg_action failed: %s(i*iT(i(i(	RFRcRR8RRPRTRHRS(R
ReRdRWReRRf((s./usr/local/lib/python2.7/test/test_argparse.pyRgs$
"
N(RRRFRg(((s./usr/local/lib/python2.7/test/test_argparse.pyRhss-sRRRR=Rg?RRRis-s0.125g?Ri*s
-s 0.625 1g?is84 -s2g@iT(RRRR"tActionRbRhR4R RRfRR8R(((s./usr/local/lib/python2.7/test/test_argparse.pyRaxstTestActionRegistrationcBs0eZdZdejfdYZdZRS(s5Test a user-defined action supplied by registering ittMyActioncBseZddZRS(cCst||jd|dS(Nsfoo[%s](RSR(R
ReRdtvaluesRe((s./usr/local/lib/python2.7/test/test_argparse.pyRgsN(RRRFRg(((s./usr/local/lib/python2.7/test/test_argparse.pyRkscCstj}|jdd|j|jddd|j|jdgtdd|j|jdgtdddS(NRt	my_actionRRsfoo[1]Rsfoo[42](R"R^R_RkRdR	RWR8(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyR`s
%(RRRR"RiRkR`(((s./usr/local/lib/python2.7/test/test_argparse.pyRjstTestAddSubparserscBseZdZdZeddZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZRS(sTest the add_subparsers methodcOs|jt||dS(N(RRH(R
R5R6((s./usr/local/lib/python2.7/test/test_argparse.pytassertArgumentParserErrorscCs|rItddddd|}|j|dddd	d
ddn.tdddd}|jd
d	d
dd|jddtdd|jdd}|j|jtdd}|rd|d<n|jd|}|jddtdd|jdddddtdd}|r:d|d<n|jd|}|jddddd |jd!dtd"d#dd$tdd%}	|rd&|	d<n|jd'|	}
|
jd(dtdd)|
jd*d"d+dd,|S(-NtprogtPROGtdescriptionsmain descriptionRiiRiRRthelpsfoo helps--fooRR=sbar helpscommand helps
1 descriptions1 helpRs-wsw helpRRRsx helps
2 descriptions2 helpRs-yt123sy helpRRRsz helps
3 descriptions3 helpt3ttst helptus...su help(	R]RdR tadd_subparsersRotdictt
add_parserRRT(R
tsubparser_helpRRet
subparserstparser1_kwargstparser1tparser2_kwargstparser2tparser3_kwargstparser3((s./usr/local/lib/python2.7/test/test_argparse.pyRs@"


cCs;tt|j|j|_|jdt|_dS(NR{(RRnRRReR&tcommand_help_parser(R
((s./usr/local/lib/python2.7/test/test_argparse.pyRscCsLxEdddddddgD](}|j}|j|jj|qWdS(NRRsa as0.5 as0.5 1s0.5 1 -ys0.5 2 -w(RRoReRW(R
RR5((s./usr/local/lib/python2.7/test/test_argparse.pyttest_parse_args_failures
scCs
|j|jjdjtdtdddddd|j|jjd	jtdtdd
ddd
ddg|j|jjdjtdtdddddd|j|jjdjtdtddddddddddgdS(Ns0.5 1 b -w 7RiRg?R,iRRs0.25 --foo 2 -y 2 3j -- -1jg?RRRy@ys--foo 0.125 1 cg?Rs-1.5 3 11 -- a --foo 7 -- bgRviRwRs--foot7s--(R	ReRWRR8RR&RF(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_parse_argss"("cCsk|j|jjdjtdtddddddgf|j|jjd	jtdtddddddd
gf|j|jjdjtdtddddddd
gf|j|jjdjtdtddddddd
dgf|j|jjdjtdtddddddddddgfdS(Ns0.5 1 b -w 7RiRg?R,iRRs0.5 -p 1 b -w 7s-ps0.5 1 b -w 7 -ps0.5 1 b -q -rs -w 7s-qs-rss0.5 -W 1 b -X Y -w 7 Zs-Ws-XRR(R	Retparse_known_argsRR8R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_parse_known_args$s(++.cCst}|jddd|jdd}|jd}|jd|jtdtdddd	|jd
jdS(Ns--fooRRRRRRRiRs1 2(	R]RdRxRzR	R8RRWR(R
ReR|R~((s./usr/local/lib/python2.7/test/test_argparse.pyt	test_dest:s	
cCs?|j|jjd|j|jjtjddS(Ns)usage: PROG [-h] [--foo] bar {1,2,3} ...
sJ            usage: PROG [-h] [--foo] bar {1,2,3} ...

            main description

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

            optional arguments:
              -h, --help  show this help message and exit
              --foo       foo help
            (R	Retformat_usagetformat_helpttextwraptdedent(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt	test_helpCscCsK|jdd}|j|jd|j|jtjddS(NRs+:-s)usage: PROG [-h] [++foo] bar {1,2,3} ...
sJ            usage: PROG [-h] [++foo] bar {1,2,3} ...

            main description

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

            optional arguments:
              -h, --help  show this help message and exit
              ++foo       foo help
            (RR	RRRR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_help_extra_prefix_charsTs
cCsK|jdd}|j|jd|j|jtjddS(NRs+:/s)usage: PROG [+h] [++foo] bar {1,2,3} ...
sJ            usage: PROG [+h] [++foo] bar {1,2,3} ...

            main description

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

            optional arguments:
              +h, ++help  show this help message and exit
              ++foo       foo help
            (RR	RRRR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyt test_help_alternate_prefix_charshs
cCs?|j|jjd|j|jjtjddS(Ns)usage: PROG [-h] [--foo] bar {1,2,3} ...
s            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

            optional arguments:
              -h, --help  show this help message and exit
              --foo       foo help
            (R	RRRRR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_parser_command_helpzs
cCstdddd}|jddddd	|jd
dd|jdd
dddd}|jd}|jd}|j|jd|j|jtjddS(NRpRqRrsmain descriptions--fooRRRssfoo helpRsbar helpttitletsubcommandsscommand helpsadditional textRRs'usage: PROG [-h] [--foo] bar {1,2} ...
s            usage: PROG [-h] [--foo] bar {1,2} ...

            main description

            positional arguments:
              bar         bar help

            optional arguments:
              -h, --help  show this help message and exit
              --foo       foo help

            subcommands:
              command help

              {1,2}       additional text
            (	R]RdRxRzR	RRRR(R
ReR|R~R((s./usr/local/lib/python2.7/test/test_argparse.pyttest_subparser_title_helps		cCsy|jj|jWn_tk
r{tjd}|j|kret|GHt|jGHn|j|j|nXdS(Ni(	ReRWRRHRPRTRKRR	(R
Rt
expected_helpterr((s./usr/local/lib/python2.7/test/test_argparse.pyt_test_subparser_helps
cCs|jdtjddS(Ns5.0 1 -hs            usage: PROG bar 1 [-h] [-w W] {a,b,c}

            1 description

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

            optional arguments:
              -h, --help  show this help message and exit
              -w W        w help
            (RRR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_subparser1_helpscCs|jdtjddS(Ns5.0 2 -hs#            usage: PROG bar 2 [-h] [-y {1,2,3}] [z [z ...]]

            2 description

            positional arguments:
              z           z help

            optional arguments:
              -h, --help  show this help message and exit
              -y {1,2,3}  y help
            (RRR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_subparser2_helpsN(RRRRoRRFRRRRRRRRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRns 	.												
	tTestPositionalsGroupscBs)eZdZdZdZdZRS(s@Tests that order of group positionals matches construction ordercCst}|jd|jd}|jd|jdtdddddd}|jdj}|j||dS(	NRiRRRRRRus1 2 3(R]RdRjR8RWRR	(R
ReRktexpectedRZ((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nongroup_firsts	


cCst}|jd}|jd|jd|jdtdddddd}|jdj}|j||dS(	NtxxxRiRRRRRus1 2 3(R]RjRdR8RWRR	(R
ReRkRRZ((s./usr/local/lib/python2.7/test/test_argparse.pyttest_group_firsts	


c	Cst}|jd}|jd|jd|jd|jd}|jdtdddddd	dd
}|jdj}|j||dS(NRRiRRRtfrellRRRuRs1 2 3 4(R]RjRdR8RWRR	(R
ReRkRRZ((s./usr/local/lib/python2.7/test/test_argparse.pyttest_interleaved_groupss	



!(RRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	
	
tTestParentParserscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZRS(s5Tests that parsers can be created with parent parserscOs|jt||dS(N(RRH(R
R5R6((s./usr/local/lib/python2.7/test/test_argparse.pyRoscCs`tt|jtdt|_|jjd|jjd}|jd|jjdtdt|_|jjd|jjd|jjd}|jd	tdt|_	|j	jdtdt|_
|j
jdtdt|_|jj}|jd
dd|jdddt
jjtjd
|_dS(NRs--wRs-yRRs-bRs--ds-aRRi(RRRR]Rtwxyz_parentRdRjtabcd_parenttw_parenttz_parenttab_mutex_parenttadd_mutually_exclusive_groupRR tbasenameRPRqtmain_program(R
tx_grouptc_groupRk((s./usr/local/lib/python2.7/test/test_argparse.pyRs(

c	CsMtd|jg}|j|jdjtdddddddS(	Ntparentss-y 1 2 --w 3R,RuRRRR(R]RR	RWRR8(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_single_parent scCs<|j|jjtd|jg}|j|jdS(NR(t_test_mutex_abRRWR](R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_single_parent_mutex%scCsG|jg}tdtd|}td|g}|j|jdS(NRR(RR]RRRW(R
RRe((s./usr/local/lib/python2.7/test/test_argparse.pyttest_single_granparent_mutex*scCs|j|gtdtdt|j|dgtdtdt|j|dgtdtdt|j|ddg|j|ddg|j|dg|j|ddg|j|ddgdS(NRRs-as-bs-c(R	R8RR&Ro(R
RW((s./usr/local/lib/python2.7/test/test_argparse.pyR0s%((cCsk|j|jg}td|}|j|jdjtdddddddd	d
ddddS(
NRs--d 1 --w 2 3 4RRuRRRR,RRRR(RRR]R	RWRR8RF(R
RRe((s./usr/local/lib/python2.7/test/test_argparse.pyttest_multiple_parents:sc
Cs|j|jg}td|}|j|jdjtdtdtdddddd	|j
|jd
j|j
|jdjdS(NRs
-a --w 2 3RRR,RRRRus
-a --w 2 3 -bs
-a -b --w 2 3(RRR]R	RWRR8R&RRFRo(R
RRe((s./usr/local/lib/python2.7/test/test_argparse.pyttest_multiple_parents_mutex@s(cCs,|jtjtjd|j|jgdS(NR(RR"t
ArgumentErrorR^RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_conflicting_parentsJs	cCs,|jtjtjd|j|jgdS(NR(RR"RR^RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_conflicting_parents_mutexPs	c	CsY|j|jg}td|}|j|jdjtdddddddS(NRs1 2R,RRR(RRR]R	RWRR8RF(R
RRe((s./usr/local/lib/python2.7/test/test_argparse.pyttest_same_argument_name_parentsVscCs{t}|j}|jdd|jg}|jd|j|jdjtddddd	d
dddS(NRRRfsbar -b 1 --d 2 3 4RRuRRRRR(	R]RxRzRRdR	RWRR8(R
ReR|tabcde_parser((s./usr/local/lib/python2.7/test/test_argparse.pyttest_subparser_parents\s	
cCs6t}|j}|jg}|jdd|}|jd}|jd|j|jg}|jdd|}|jd|j|jdj	t
dtd	tdd
|j|jdj	t
dtd	tdd
dddddd
|j|jdj	|j|jdj	dS(NRiRRRRRfsfoo -a 4RRRsbar -b  --w 2 3 4R,RRRRusfoo -a -b 4sbar -b -a 4(R]RxRRzRjRdRR	RWRR8R&RRFRo(R
ReR|Rt
abc_parserRtwxyzabe_parser((s./usr/local/lib/python2.7/test/test_argparse.pyttest_subparser_parents_mutexds"	

.cCsk|j|jg}td|}|j}|j}|j|tjdj||rZdnddS(NRsR            usage: {}{}[-h] [-b B] [--d D] [--w W] [-y Y] a z

            positional arguments:
              a
              z

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

            c:
              --d D

            x:
              -y Y
        t R(	RRR]RRR	RRtformat(R
RRetparser_helptprogname((s./usr/local/lib/python2.7/test/test_argparse.pyttest_parent_helpws	cCstdt}|jdddd}|jd|jd|j}|jd|jd	td
|g}|jt|jddd	dg|j}|j	}|j
|tjd
j
||rdnddS(NRRRRrtgds-ws-xs-ys-zRRRs	            usage: {}{}[-h] [-w W] [-x X] [-y Y | -z Z]

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

            g:
              gd

              -w W
              -x X
        RR(R]RRjRdRRRHRWRRR	RRR(R
tparentRtmReRR((s./usr/local/lib/python2.7/test/test_argparse.pyttest_groups_parentss



	
(RRRRoRRRRRRRRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs 						
		
						t TestMutuallyExclusiveGroupErrorscBs#eZdZdZdZRS(cCs,t}|j}|t|jdddS(NRRi(R]RR|R(R
ReR((s./usr/local/lib/python2.7/test/test_argparse.pyttest_invalid_add_argument_groups		cCst}|j}|j}|j}|t|ddt|t|d|t|ddd|t|ddd|t|ddtjdS(Ns--fooRRRRi(R]RRdRt
ValueErrorR&R"tPARSER(R
ReRkRdR((s./usr/local/lib/python2.7/test/test_argparse.pyttest_invalid_add_arguments			cCstdd}|j}|jddd|jddd|j}|jddd|jd	ddd
}|j|jtj|dS(NRpRqs--fooRRs--barRs--soups--nutss            usage: PROG [-h] [--foo | --bar] [--soup | --nuts]

            optional arguments:
              -h, --help  show this help message and exit
              --foo
              --bar
              --soup
              --nuts
              (R]RRdR	RRR(R
Retgroup1tgroup2R((s./usr/local/lib/python2.7/test/test_argparse.pyRs
(RRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs		tMEMixincBsPeZdZdZdZdZdZdZdZdZ	RS(cCsL|jdtj}t}x*|jD]}|j|||jq%WdS(NR(t
get_parserRRWRHRRR(R
RWR_targs_string((s./usr/local/lib/python2.7/test/test_argparse.pyttest_failures_when_not_requiredscCsS|jdtj}t}x1|jdgD]}|j|||jq,WdS(NRR(RR&RWRHRRR(R
RWR_R((s./usr/local/lib/python2.7/test/test_argparse.pyttest_failures_when_requiredscCsb|jdtj}|j|j}x6|D].\}}||j}|j||q,WdS(NR(RRRWRtsuccesses_when_not_requiredRR	(R
RWRRRt	actual_ns((s./usr/local/lib/python2.7/test/test_argparse.pyt test_successes_when_not_requireds
cCsU|jdtj}x9|jD].\}}||j}|j||qWdS(NR(RR&RWRRR	(R
RWRRR((s./usr/local/lib/python2.7/test/test_argparse.pyttest_successes_when_requiredscCs>|jdtj}|j}|j|tj|dS(NR(RRRtusage_when_not_requiredR	RR(R
Rtexpected_usage((s./usr/local/lib/python2.7/test/test_argparse.pyttest_usage_when_not_requireds	cCs>|jdtj}|j}|j|tj|dS(NR(RR&Rtusage_when_requiredR	RR(R
RR((s./usr/local/lib/python2.7/test/test_argparse.pyttest_usage_when_requireds	cCsE|jdtj}|j|j}|j|tj|dS(NR(RRRRRsR	RR(R
RRs((s./usr/local/lib/python2.7/test/test_argparse.pyttest_help_when_not_requiredscCsE|jdtj}|j|j}|j|tj|dS(NR(RR&RRRsR	RR(R
RRs((s./usr/local/lib/python2.7/test/test_argparse.pyttest_help_when_required	s(
RRRRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs							tTestMutuallyExclusiveSimplec	BseZddZddgZdeddddfdeddddfd	edddd
fdeddddfgZdeddddfgZd
ZdZ	dZ
RS(cCsWtdd}|jd|}|jddd|jddd	d
ddd|S(
NRpRqRs--barRssbar helps--bazRRRRsbaz help(R]RRd(R
RReRk((s./usr/local/lib/python2.7/test/test_argparse.pyR		s
s--bar X --baz Ys
--bar X --bazs--bar XRRRs--bar X --bar ZRs--baz YRs--bazRs;        usage: PROG [-h] [--bar BAR | --baz [BAZ]]
        s;        usage: PROG [-h] (--bar BAR | --baz [BAZ])
        s
        optional arguments:
          -h, --help   show this help message and exit
          --bar BAR    bar help
          --baz [BAZ]  baz help
        N(RRRFRRR8RRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyR	stTestMutuallyExclusiveLongc
BseZddZdgZdeddddddddfdedd	ddddddfd
eddddddddfdedddd	ddddfgZdeddddddddfgZd
ZdZ	dZ
RS(cCsqtdd}|jddd|jddd|jd|}|jd	dd
|jddd|S(
NRpRqs--abcdeRss
abcde helps--fghijs
fghij helpRs--klmnos
klmno helps--pqrsts
pqrst help(R]RdR(R
RReRk((s./usr/local/lib/python2.7/test/test_argparse.pyR,	ss--klmno X --pqrst Ys	--klmno XtabcdetfghijtklmnoRtpqrsts--abcde Y --klmno XRs	--pqrst Xs--pqrst X --fghij YRsi    usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ]
                [--klmno KLMNO | --pqrst PQRST]
    si    usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ]
                (--klmno KLMNO | --pqrst PQRST)
    s
    optional arguments:
      -h, --help     show this help message and exit
      --abcde ABCDE  abcde help
      --fghij FGHIJ  fghij help
      --klmno KLMNO  klmno help
      --pqrst PQRST  pqrst help
    N(RRRFRRR8RRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyR*	s		$!$'*	t$TestMutuallyExclusiveFirstSuppressedcBseZdZdgZdedddefdedddefdedd
defgZd	edd
defgZ	d
Z
dZdZRS(cCsTtdd}|jd|}|jddtj|jddddd	|S(
NRpRqRs-xRss-yRRsy help(R]RRdR"R#(R
RReRk((s./usr/local/lib/python2.7/test/test_argparse.pyRW	s
s-x X -ys-x XRRRs	-x X -x YRs-yRs&        usage: PROG [-h] [-y]
        s$        usage: PROG [-h] -y
        sx
        optional arguments:
          -h, --help  show this help message and exit
          -y          y help
        N(
RRRRR8R&RFRRRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyRU	s		t#TestMutuallyExclusiveManySuppressedcBseZdZdddgZdedededdfdedededdfd	edededd
fdedededdfgZdedededdfgZ	d
Z
ZdZRS(cCsstdd}|jd|}|j}|ddddtj|ddd	dtj|d
dtj|S(NRpRqRs--spamRRRss--badgerRs	--bladder(R]RRdR"R#(R
RReRkRM((s./usr/local/lib/python2.7/test/test_argparse.pyRx	s	s--spam --badgers--badger --bladder Bs--bladder B --spams--spamRRtbladders--badgers--bladder BRs
--spam --spamRs!        usage: PROG [-h]
        s[
        optional arguments:
          -h, --help  show this help message and exit
        N(
RRRRR8R&RFRRRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyRv	s	
	$$
t*TestMutuallyExclusiveOptionalAndPositionalc
BseZdZdddddgZdededdd	d
fdededdd	d
fd
ededdd	d
gfd
ededdd	d
ddgfgZdededdd	d
fgZ	dZ
dZdZRS(cCsptdd}|jd|}|jddddd|jd	dd
|jddd
dddd|S(NRpRqRs--fooRRRstFOOs--spamtSPAMRRRRRtBADGER(R]RRd(R
RReRk((s./usr/local/lib/python2.7/test/test_argparse.pyR	ss--foo --spam Ss
--spam S XsX --foosX Y Z --spam Ss	--foo X Ys--fooRiRRRs--spam StSsX Y ZRRRsM        usage: PROG [-h] [--foo | --spam SPAM | badger [badger ...]]
        sM        usage: PROG [-h] (--foo | --spam SPAM | badger [badger ...])
        s
        positional arguments:
          badger       BADGER

        optional arguments:
          -h, --help   show this help message and exit
          --foo        FOO
          --spam SPAM  SPAM
        N(
RRRRR8R&RFRRRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyR	s			!-$
t#TestMutuallyExclusiveOptionalsMixedcBseZdZddddgZdedededed	ed
efdedededed	ed
efdedededed	ed
efd
edededed	ed
efdedededed	ed
efdedededed	ed
efgZdedededed	ed
efdedededed	ed
efdedededed	ed
efgZdZ	Z
dZRS(cCstdd}|jddddd|jd|}|jd	dddd
|jddddd|jd
dddd|jddddd|S(NRpRqs-xRRRssx helpRs-asa helps-bsb helps-ysy helps-csc help(R]RdR(R
RReRk((s./usr/local/lib/python2.7/test/test_argparse.pyR	ss-a -bs-b -cs-a -cs-a -b -cs-aRRRRRs-bs-cs-a -xs-y -bs-x -y -cRs-xs-ys:        usage: PROG [-h] [-x] [-a] [-b] [-y] [-c]
        s
        optional arguments:
          -h, --help  show this help message and exit
          -x          x help
          -a          a help
          -b          b help
          -y          y help
          -c          c help
        (RRRRR8R&RRRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyR	s	
*****0**0

tTestMutuallyExclusiveInGroupcBseZd
dZddgZdedddd
fdedd
ddfgZd	edd
dd
fgZd
ZdZ	dZ
RS(cCsctdd}|jdddd}|jd|}|jdd	d
|jdd	d|S(
NRpRqRsTitled groupRrsGroup descriptionRs--barRssbar helps--bazsbaz help(R]RjRRd(R
RRettitled_grouptmutex_group((s./usr/local/lib/python2.7/test/test_argparse.pyR	s	s--bar X --baz Ys--baz X --bar Ys--bar XRRRs--baz YRRs9        usage: PROG [-h] [--bar BAR | --baz BAZ]
        s9        usage: PROG [-h] (--bar BAR | --baz BAZ)
        s
        optional arguments:
          -h, --help  show this help message and exit

        Titled group:
          Group description

          --bar BAR   bar help
          --baz BAZ   baz help
        N(RRRFRRR8RRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyR	s
t1TestMutuallyExclusiveOptionalsAndPositionalsMixedcBsbeZdZdddgZdedddeded	d
defdedddeded	d
defd
edddeded	d
defdedddeded	d
defdedddeded	d
defgZd
edddeded	d
defdedddeded	d
defgZ	dZ
ZdZRS(cCstdd}|jddd|jddddd	|jd
|}|jddd
dd|jddddd|jddddd|S(NRpRqRRssx helps-yRRsy helpRRRRsa helps-bsb helps-csc help(R]RdR(R
RReRk((s./usr/local/lib/python2.7/test/test_argparse.pyR
ssX A -bs-b -cs-c X AsX ARRRRRRRsX -bsX -csX A -ysX -y -bsX -ys6        usage: PROG [-h] [-y] [-b] [-c] x [a]
        s
        positional arguments:
          x           x help
          a           a help

        optional arguments:
          -h, --help  show this help message and exit
          -y          y help
          -b          b help
          -c          c help
        N(
RRRRR8RRFR&RRRRRs(((s./usr/local/lib/python2.7/test/test_argparse.pyR
s	
****0*0
tMEPBasecBseZddZRS(cCs@tt|jd|}td|jdtd|g}|S(NRRpRR(RRRR]RpR(R
RRRe((s./usr/local/lib/python2.7/test/test_argparse.pyRH
sN(RRRFR(((s./usr/local/lib/python2.7/test/test_argparse.pyRF
st&TestMutuallyExclusiveGroupErrorsParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRO
st!TestMutuallyExclusiveSimpleParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRT
stTestMutuallyExclusiveLongParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRY
st*TestMutuallyExclusiveFirstSuppressedParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyR^
st)TestMutuallyExclusiveManySuppressedParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRc
st0TestMutuallyExclusiveOptionalAndPositionalParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRh
st)TestMutuallyExclusiveOptionalsMixedParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRm
st7TestMutuallyExclusiveOptionalsAndPositionalsMixedParentcBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyRr
stTestSetDefaultscBsGeZdZdZdZdZdZdZdZRS(c	Cst}|jdd|jdddd|jtdddddd|jg|jtdddddd|jgt|jtdddddd|jgtdd|jtdddddd|jgtdddddS(	NRRiRRRiRi(R]tset_defaultsR	R8RW(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_set_defaults_no_args|
s	cCs\t}|jdddd|jddd|jtdddd|jg|jtdddd|jgt|jtdddd|jgtdd|jtdd	dd|jd
j|jtdd	dd|jd
jt|jtdd	dd|jd
jtdddS(NRRiRRs-xRtxfooxRRs-x 1(R]RRdR	R8RWR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_set_defaults_with_args
s	cCsvt}|jdd|j}|jd}|jdd|jtdddd|jdjdS(NRRiRRR(R]RRxRzR	R8RWR(R
ReR|tparser_a((s./usr/local/lib/python2.7/test/test_argparse.pyttest_set_defaults_subparsers
s	cCsWtdt}|jddtd|g}|jtdd|jgdS(NRRRiR(R]RRR	R8RW(R
RRe((s./usr/local/lib/python2.7/test/test_argparse.pyttest_set_defaults_parents
scCsjtj}|jjd}|jdd|jdd|jtdd|jdgdS(NRRiii(R"R^RxRzRR	R8RW(R
Retxparser((s./usr/local/lib/python2.7/test/test_argparse.pyt)test_set_defaults_on_parent_and_subparser
s
c
Cst}|jdddddddd|jd	|jd
dd|jdd
d|jdd
ddd|jtdddddddd|jg|jdddddddd|jtdddddddd|jgdS(NR,tWRRRRRRs-ws-xRtXXRRtZZtWWtYY(R]RRdR	R8RW(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyt&test_set_defaults_same_as_add_argument
s	"
$"$c
Cst}|jdddddddd|jd	}|jd
|jddd
|jddd|jddddd|jtdddd
dddd|jg|jdddddddd|jtdddddddd|jgdS(NR,RRRRRRRRis-ws-xRRRRRRR(R]RRjRdR	R8RW(R
ReRk((s./usr/local/lib/python2.7/test/test_argparse.pyt,test_set_defaults_same_as_add_argument_group
s	"
$"$(	RRRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRz
s	
						tTestGetDefaultcBseZdZRS(cCst}|jd|jd|jd|jd|jd|jd|jd|jd|jd|jddtdd|jd|jd|jd|jd|jdd|jd|jd|jd|jddS(	NRiRs--foos--barR=Ri*R(R]R	RFtget_defaultRdRR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_get_default
s	
(RRR(((s./usr/local/lib/python2.7/test/test_argparse.pyR	
stTestNamespaceContainsSimplecBseZdZdZRS(cCsRtj}|jd|kt|jd|kt|jd|ktdS(NRR(R"t	NamespaceR	RR&(R
tns((s./usr/local/lib/python2.7/test/test_argparse.pyt
test_empty
scCstjdddd}|jd|kt|jd|kt|jd|kt|jd|kt|jd|kt|jd|ktdS(NRiRiRtxxR(R"R
R	R&R(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyttest_non_empty
s(RRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyR
s	tTestHelpFormattingMetaclasscBseZdZRS(cCsZ|dkrdSdtfdY}x-d	d
dgD]\}}||||q6WdS(NtHelpTestCaseRtcBs>eZdZdZdZdZdZdZRS(cSs||_||_xp|j|j|jgD]V}d|j|f}|d}y
||_Wntk
rpnXt|||q+WdS(Ns%s_%scSs||dS(N((R
Rv((s./usr/local/lib/python2.7/test/test_argparse.pyttest_wrappers(tfunc_suffixtstd_namettest_formatt
test_printttest_print_fileRR|RS(R
t
test_classRRRvRR((s./usr/local/lib/python2.7/test/test_argparse.pyR7s			

cSstj|jj|jj}x0t|dgD]}|j|j|jq1Wt|dg}xS|D]K\}}|j|j|j}x$|D]}|j|j|jqWqjWt|dg}|r|j}	x'|D]}
|	j	|
j|
jqWn|S(NRftargument_group_signaturestsubparsers_signatures(
R"R^RbR5R6RRRdRjRxRz(R
RRetargument_sigt
group_sigst	group_sigt
argument_sigsRktsubparsers_sigsR|t
subparser_sig((s./usr/local/lib/python2.7/test/test_argparse.pyRs(	

cSst||j}tj|}||krt|GHt|GHx?t||D]+\}}||krSd||fGHPqSqSWn|j||dS(Nsfirst diff: %r %r(RRRRRRtzipR	(R
Rtparser_textt
expected_texttchar1tchar2((s./usr/local/lib/python2.7/test/test_argparse.pyt_test3scSs<|j|}t|d|j}|j||dS(Ns	format_%s(RRRRR((R
RReR((s./usr/local/lib/python2.7/test/test_argparse.pyR?scSs|j|}t|d|j}tt|j}tt|jtz#|tt|jj}Wdtt|j|X|j||dS(Nsprint_%s(	RRRRRPRRSRRVR((R
RRetprint_t
old_streamR$((s./usr/local/lib/python2.7/test/test_argparse.pyRDscSsX|j|}t|d|j}t}|||j}|j||dS(Nsprint_%s(RRRRRRVR((R
RReR)tsfileR$((s./usr/local/lib/python2.7/test/test_argparse.pyRPs	
(RRR7RR(RRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRt
s					tusageRKRsR'RL(R,RK(RsRK(R'RL(R(RR*RRRtRR((s./usr/local/lib/python2.7/test/test_argparse.pyR7sO(RRR7(((s./usr/local/lib/python2.7/test/test_argparse.pyRsRtTestHelpBiggerOptionalsc	BseZdZeddddddddZed	d
ddd
edddedddedddgZgZdZedZdZ	RS(s;Make sure that argument help aligns when options are longerRpRqRrtDESCRIPTIONtepilogtEPILOGR's0.1s-xRRRssX HELPs--ysY HELPRisFOO HELPRsBAR HELPs;        usage: PROG [-h] [-v] [-x] [--y Y] foo bar
        sb
        DESCRIPTION

        positional arguments:
          foo            FOO HELP
          bar            BAR HELP

        optional arguments:
          -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
    s        0.1
        (
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR-bstTestShortColumnscBsKeZdZdZejZejZejZdZedZ	ej
Z
RS(sTest 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 case. Only ugly representation.
    cCs0tj}|jdd|j|jdS(NR
R(RRRRR(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyRss        usage: PROG
               [-h]
               [-v]
               [-x]
               [--y Y]
               foo
               bar
        s
        DESCRIPTION

        positional arguments:
          foo
            FOO HELP
          bar
            BAR HELP

        optional arguments:
          -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
    (RRRRR-RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR1s					tTestHelpBiggerOptionalGroupsc	BseZdZeddddddddZed	d
ddd
edddedddedddgZedddedddedddddgfgZdZedZdZ	RS(s;Make sure that argument help aligns when options are longerRpRqRrR.R/R0R's0.1s-xRRRssX HELPs--ysY HELPRisFOO HELPRsBAR HELPsGROUP TITLEsGROUP DESCRIPTIONRsBAZ HELPs-zRRsZ HELPsN        usage: PROG [-h] [-v] [-x] [--y Y] [-z Z [Z ...]] foo bar baz
        s
        DESCRIPTION

        positional arguments:
          foo            FOO HELP
          bar            BAR HELP

        optional arguments:
          -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
    s        0.1
        (
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR2s!tTestHelpBiggerPositionalscBseZdZeddddZeddddd	ed
ddeddd
edddgZgZdZedZdZ	RS(s4Make sure that help aligns when arguments are longerR,tUSAGERrR.s-xRRRssX HELPs--ysY HELPtekiekiekifekangsEKI HELPRsBAR HELPs        usage: USAGE
        s 
        DESCRIPTION

        positional arguments:
          ekiekiekifekang  EKI HELP
          bar              BAR HELP

        optional arguments:
          -h, --help       show this help message and exit
          -x               X HELP
          --y Y            Y HELP
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR3stTestHelpReformattingcBseZdZeddddZeddddd	ed
ddddgZed
ddedddddgfgZdZedZdZ	RS(s>Make sure that text after short names starts on the first lineRpRqRrse   oddly    formatted
description

that is so long that it should go onto multiple lines when wrappeds-xtmetavarRRssoddly
    formatted -x helpRRs
normal y helpRs'
    oddly formatted group

descriptions-aRRs` oddly 
formatted    -a  help  
    again, so long that it should be wrapped over multiple liness2        usage: PROG [-h] [-x XX] [-a] yyy
        s
        oddly formatted description that is so long that it should go onto multiple
        lines when wrapped

        positional arguments:
          yyy         normal y help

        optional arguments:
          -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(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR6	s	tTestHelpWrappingShortNamescBseZdZedddddZedddd	d
deddd
d	ddgZededddd	ddgfgZdZedZdZ	RS(s>Make sure that text after short names starts on the first lineRpRqRrsD
Dis-xR7RRssXHH HXiRRsYH YHtALPHASs-aRRsAHHH HHAi
s2        usage: PROG [-h] [-x XX] [-a] yyy
        s
        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

        optional arguments:
          -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(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR8=s	%tTestHelpWrappingLongNamesc	BseZdZeddddddddZedd	d
ddd
dedd	dddddgZededd	dddddedd	dddddgfgZdZedZdZ	RS(s<Make sure that text after long names starts on the next lineR,R4RrsD DiR'sV Vs-xR7RiRssXH XHiRsYH YHR9s-aRsAH AHRsZH ZHs        usage: USAGE
        sr
        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

        optional arguments:
          -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
        ss        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
        (
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR:es
#	)t
TestHelpUsagec
BseZdZeddZedddddeddd	dd
edddeddddd
edddddgZededddddedddddeddddd	edddddgfgZdZedZdZ	RS(sTest basic usage messagesRpRqs-wRRRsR,s-xRRRRiRRRks-yRs-ziRRRfs        usage: PROG [-h] [-w W [W ...]] [-x [X [X ...]]] [-y [Y]] [-z Z Z Z]
                    a b b [c] [d [d ...]] e [e ...]
        s
        positional arguments:
          a               a
          b               b
          c               c

        optional arguments:
          -h, --help      show this help message and exit
          -w W [W ...]    w
          -x [X [X ...]]  x

        group:
          -y [Y]          y
          -z Z Z Z        z
          d               d
          e               e
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR;s 	!tTestHelpOnlyUserGroupscBseZdZedddeZgZededddedddgfed	ed
dd
edddgfgZd
ZedZ	dZ
RS(sTest basic usage messagesRpRqRtxxxxs-xRsRRtyyyyRs-yRs.        usage: PROG [-x X] [-y Y] a b
        sn
        xxxx:
          -x X  x
          a     a

        yyyy:
          b     b
          -y Y  y
        R(RRRR4RRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR<s			tTestHelpUsageLongProgcBsseZdZedddZedddeddded	ed
gZgZdZedZd
Z	RS(s*Test usage messages where the prog is longRptPi<s-wR7Rs-xRRRsz        usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
               [-h] [-w W] [-x X] a b
        s
        positional arguments:
          a
          b

        optional arguments:
          -h, --help  show this help message and exit
          -w W
          -x X
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR?s	
t TestHelpUsageLongProgOptionsWrapcBseZdZedddZeddddeddd	ded
dddeddd
dededgZgZdZedZdZ	RS(sATest usage messages where the prog is long and the optionals wrapRpR@i<s-wR7Ris-xRs-yRs-zRRRs        usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
               [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] [-x XXXXXXXXXXXXXXXXXXXXXXXXX]
               [-y YYYYYYYYYYYYYYYYYYYYYYYYY] [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
               a b
        s8
        positional arguments:
          a
          b

        optional arguments:
          -h, --help            show this help message and exit
          -w WWWWWWWWWWWWWWWWWWWWWWWWW
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRA
s	t$TestHelpUsageLongProgPositionalsWrapcBspeZdZeddddeZeddeddeddgZgZd	Zed
Z	dZ
RS(sCTest usage messages where the prog is long and the positionals wrapRpR@i<RRiRRs        usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
               aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
               ccccccccccccccccccccccccc
        s
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc
        R(RRRR4RRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRB'
s

tTestHelpUsageOptionalsWrapcBseZdZeddZeddddedddded	dd
dedddded
ededgZgZdZedZdZ	RS(s,Test usage messages where the optionals wrapRpRqs-wR7Ris-xRs-yRs-zRRRRs        usage: PROG [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] [-x XXXXXXXXXXXXXXXXXXXXXXXXX]
                    [-y YYYYYYYYYYYYYYYYYYYYYYYYY] [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
                    a b c
        sD
        positional arguments:
          a
          b
          c

        optional arguments:
          -h, --help            show this help message and exit
          -w WWWWWWWWWWWWWWWWWWWWWWWWW
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRC@
s		
tTestHelpUsagePositionalsWrapcBseZdZeddZededededdedded	dgZgZd
ZedZdZ	RS(
s.Test usage messages where the positionals wrapRpRqs-xs-ys-zRiRRs        usage: PROG [-h] [-x X] [-y Y] [-z Z]
                    aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
                    ccccccccccccccccccccccccc
        s
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc

        optional arguments:
          -h, --help            show this help message and exit
          -x X
          -y Y
          -z Z
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRDf
s			

t%TestHelpUsageOptionalsPositionalsWrapcBseZdZeddZeddddedddded	dd
deddedded
dgZgZdZedZdZ	RS(s<Test usage messages where the optionals and positionals wrapRpRqs-xR7Ris-yRs-zRRRRs        usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] [-y YYYYYYYYYYYYYYYYYYYYYYYYY]
                    [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
                    aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
                    ccccccccccccccccccccccccc
        se
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc

        optional arguments:
          -h, --help            show this help message and exit
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRE
s

tTestHelpUsageOptionalsOnlyWrapcBsxeZdZeddZeddddedddded	dd
dgZgZdZedZd
Z	RS(s@Test usage messages where there are only optionals and they wrapRpRqs-xR7Ris-yRs-zRs        usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] [-y YYYYYYYYYYYYYYYYYYYYYYYYY]
                    [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
        s
        optional arguments:
          -h, --help            show this help message and exit
          -x XXXXXXXXXXXXXXXXXXXXXXXXX
          -y YYYYYYYYYYYYYYYYYYYYYYYYY
          -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRF
st TestHelpUsagePositionalsOnlyWrapcBsleZdZedddeZeddeddeddgZgZdZed	Z	d
Z
RS(sBTest usage messages where there are only positionals and they wrapRpRqRRiRRs~        usage: PROG aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
                    ccccccccccccccccccccccccc
        s
        positional arguments:
          aaaaaaaaaaaaaaaaaaaaaaaaa
          bbbbbbbbbbbbbbbbbbbbbbbbb
          ccccccccccccccccccccccccc
        R(RRRR4RRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRG
s

tTestHelpVariableExpansionc
BseZdZeddZeddeddeddd	d
ddd
ddedddddedd
ddddgddddedddedd
dddgZeded dd!ed"d
d#dd$gfgZd%Zed&Z	d'Z
RS((s:Test that variables are expanded properly in help messagesRpRqs-xR=Rss"x %(prog)s %(default)s %(type)s %%s-yRRRi*RtXXXs y %(prog)s %(default)s %(const)ss--fooRRs$foo %(prog)s %(default)s %(choices)ss--barRiiR7tBBBs!bar %(prog)s %(default)s %(dest)sRsspam %(prog)s %(default)sRg?sbadger %(prog)s %(default)sRks-asa %(prog)s %(default)ss-bisb %(prog)s %(default)ssw        usage: PROG [-h] [-x X] [-y] [--foo {a,b,c}] [--bar BBB] [-a A] [-b B]
                    spam badger
        s
        positional arguments:
          spam           spam PROG None
          badger         badger PROG 0.5

        optional arguments:
          -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(RRRR4RbRRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRH
s&!	!t&TestHelpVariableExpansionUsageSuppliedcBsEeZdZeddddZgZgZdZedZdZ	RS(s@Test that variables are expanded properly when usage= is presentRpRqR,s%(prog)s FOOs         usage: PROG FOO
        s[
        optional arguments:
          -h, --help  show this help message and exit
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRKst$TestHelpVariableExpansionNoArgumentscBsAeZdZedddeZgZgZdZeZ	dZ
RS(s;Test that variables are expanded properly with no argumentsRpRqRs        usage: PROG
        R(RRRR4RRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRLstTestHelpSuppressUsagecBsbeZdZedddejZedddedddgZgZd	Z	d
Z
d
ZRS(s3Test that items can be suppressed in usage messagesRpRqR,s--fooRssfoo helpRs	spam helps        positional arguments:
          spam        spam help

        optional arguments:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        R(RRRR4R"R#RbRfRRsR,R'(((s./usr/local/lib/python2.7/test/test_argparse.pyRM*stTestHelpSuppressOptionalcBsfeZdZedddeZeddejedddgZgZ	dZ
e
d	Zd
ZRS(s?Test that optional arguments can be suppressed in help messagesRpRqRs--fooRsRs	spam helps!        usage: PROG spam
        sA
        positional arguments:
          spam  spam help
        R(
RRRR4RRbR"R#RfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRN?stTestHelpSuppressOptionalGroupcBs~eZdZeddZedddedddgZeded	dejgfgZd
Z	e	dZ
dZRS(
s<Test that optional groups can be suppressed in help messagesRpRqs--fooRssfoo helpRs	spam helpRks--bars2        usage: PROG [-h] [--foo FOO] spam
        s
        positional arguments:
          spam        spam help

        optional arguments:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        R(RRRR4RbRfR"R#RR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyROSs'tTestHelpSuppressPositionalcBs`eZdZeddZedddeddejgZgZdZ	e	dZ
d	ZRS(
sATest that positional arguments can be suppressed in help messagesRpRqs--fooRssfoo helpRs-        usage: PROG [-h] [--foo FOO]
        sz
        optional arguments:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        R(RRRR4RbR"R#RfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRPmstTestHelpRequiredOptionalcBsTeZdZeddZeddeddgZgZdZedZ	d	Z
RS(
s.Test that required options don't look optionalRpRqs--fooRRssfoo helps+        usage: PROG [-h] --foo FOO
        sz
        optional arguments:
          -h, --help  show this help message and exit
          --foo FOO   foo help
        R(RRRR4RbR&RfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRQstTestHelpAlternatePrefixCharscBsreZdZedddddeZedddd	d
eddd	d
gZgZdZedZ	dZ
RS(s:Test that options display with different prefix charactersRpRqRs^;Rs^^fooRRRssfoo helps;bs;;barsbar helps-        usage: PROG [^^foo] [;b BAR]
        sq
        optional arguments:
          ^^foo              foo help
          ;b BAR, ;;bar BAR  bar help
        R(RRRR4RRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRRstTestHelpNoHelpOptionalcBsceZdZedddeZedddedddgZgZd	Zed
Z	dZ
RS(s=Test that the --help argument can be suppressed help messagesRpRqRs--fooRssfoo helpRs	spam helps-        usage: PROG [--foo FOO] spam
        s
        positional arguments:
          spam       spam help

        optional arguments:
          --foo FOO  foo help
        R(RRRR4RRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRSstTestHelpVersionOptionalcBsceZdZeddddZedddeddd	gZgZd
ZedZdZ	RS(
s@Test that the --version argument can be suppressed help messagesRpRqR's1.0s--fooRssfoo helpRs	spam helps7        usage: PROG [-h] [-v] [--foo FOO] spam
        s
        positional arguments:
          spam           spam help

        optional arguments:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
          --foo FOO      foo help
        s        1.0
        (
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRTs	tTestHelpNonecBsQeZdZeddZededgZgZdZedZdZ	RS(s1Test that no errors occur if no help is specifiedRpRqs--fooRs2        usage: PROG [-h] [--foo FOO] spam
        s
        positional arguments:
          spam

        optional arguments:
          -h, --help  show this help message and exit
          --foo FOO
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRUs	tTestHelpTupleMetavarcBseZdZeddZedddddddeddddd
ddedddddddeddddddd gZgZdZedZdZ	RS(!s"Test specifying metavar as a tupleRpRqs-wRsR,RRR7tW1tW2s-xRRtX1tX2s-yRitY1tY2tY3s-zRRtZ1s]        usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]]
        s
        optional arguments:
          -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(RWRX(RYRZ(R[R\R](R^(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRVs!tTestHelpRawTextcBseZdZedddejddZeddded	dd
gZeddded
ddgfgZdZ	e	dZ
dZRS(sTest the RawTextHelpFormatterRpRqtformatter_classRrs7Keep the formatting
    exactly as it is written

here
s--fooRss-    foo help should also
appear as given hereRs	spam helpRs?    This text
  should be indented
    exactly like it is here
s--barsbar helps>        usage: PROG [-h] [--foo FOO] [--bar BAR] spam
        s
        Keep the formatting
            exactly as it is written

        here

        positional arguments:
          spam        spam help

        optional arguments:
          -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(RRRR4R"tRawTextHelpFormatterRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyR_s	tTestHelpRawDescriptioncBseZdZedddejddZeddded	dd
gZeddded
ddgfgZdZ	e	dZ
dZRS(sTest the RawTextHelpFormatterRpRqR`Rrs7Keep the formatting
    exactly as it is written

here
s--fooRss4  foo help should not
    retain this odd formattingRs	spam helpRs?    This text
  should be indented
    exactly like it is here
s--barsbar helps>        usage: PROG [-h] [--foo FOO] [--bar BAR] spam
        s
        Keep the formatting
            exactly as it is written

        here

        positional arguments:
          spam        spam help

        optional arguments:
          -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(RRRR4R"tRawDescriptionHelpFormatterRbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRbAs	tTestHelpArgumentDefaultscBseZdZedddejddZedddedd	d
ddeddd
edddddddgZedddeddeddddgfgZ	dZ
e
dZdZRS(s&Test the ArgumentDefaultsHelpFormatterRpRqR`Rrs--fooRss)foo help - oh and by the way, %(default)ss--barRRsbar helpRs	spam helpRRRRtwoodensbadger helpRs--bazR=i*sbaz helpsO        usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger]
        s
        description

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

        optional arguments:
          -h, --help  show this help message and exit
          --foo FOO   foo help - oh and by the way, None
          --bar       bar help (default: False)

        title:
          description

          --baz BAZ   baz help (default: 42)
        R(
RRRR4R"tArgumentDefaultsHelpFormatterRbRfRRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRdqs	!'tTestHelpVersionActioncBs]eZdZeddddZeddddddgZgZd	Zed
ZdZ	RS(s,Test the default help for the version actionRpRqRrs-Vs	--versionRR's3.6s&        usage: PROG [-h] [-V]
        s
        description

        optional arguments:
          -h, --help     show this help message and exit
          -V, --version  show program's version number and exit
        R(
RRRR4RbRfRR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRgstTestHelpSubparsersOrderingcBsaeZdZeddddddZgdD]Zede^q.Zd
ZedZdZ	RS(s5Test ordering of subcommands in help matches the codeRpRqRrsdisplay some subcommandsR's0.1RRRRRfR*s6        usage: PROG [-h] [-v] {a,b,c,d,e} ...
        s
        display some subcommands

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

        optional arguments:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
        s        0.1
        (RRRRRf(
RRRR4RbR*RR,RsR'(((s./usr/local/lib/python2.7/test/test_argparse.pyRhs	
t"TestHelpSubparsersWithHelpOrderingcBseZdZeddddddZdddddfZgeD]!\ZZedede^qCZdZ	e	dZdZ
RS(s5Test ordering of subcommands in help matches the codeRpRqRrsdisplay some subcommandsR's0.1Rsa subcommand helpRsb subcommand helpRsc subcommand helpRsd subcommand helpRfse subcommand helpR*Rss6        usage: PROG [-h] [-v] {a,b,c,d,e} ...
        s
        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

        optional arguments:
          -h, --help     show this help message and exit
          -v, --version  show program's version number and exit
        s        0.1
        (Rsa subcommand help(Rsb subcommand help(Rsc subcommand help(Rsd subcommand help(Rfse subcommand help(RRRR4Rbtsubcommand_dataR*RsRR,R'(((s./usr/local/lib/python2.7/test/test_argparse.pyRis		+tTestInvalidArgumentConstructorscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZRS(s-Test a bunch of invalid Argument constructorscOs)tj}|jt|j||dS(N(R"R^RR|Rd(R
R5R6Re((s./usr/local/lib/python2.7/test/test_argparse.pytassertTypeErrorscOs)tj}|jt|j||dS(N(R"R^RRRd(R
R5R6Re((s./usr/local/lib/python2.7/test/test_argparse.pytassertValueErrorscCsP|jddd|jddd|jddd|jddidS(	Ns-xRs-ytcallbackRit
callback_argstcallback_kwargs((RlRF(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_invalid_keyword_argumentsscCs5|jx$ddgD]}|jd|qWdS(NRRR(Rl(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyttest_missing_destination
s
cCs|jd|jddS(Ns--s---(Rm(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_invalid_option_stringss
cCs0|jddd|jddttfdS(Ns--fooR=R(RmRR (R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_invalid_typescCs|jddd|jddd|jdddtj}y|jdddWnStk
rtjd	}d
}d||f}|j|t|k|nXdS(
Ns-xRRiRs--fooRRs
store-trueisunknown actionsexpected %r, found %r(RR(	RmR"R^RdRRPRTt
assertTrueR(R
ReRfRtmsg((s./usr/local/lib/python2.7/test/test_argparse.pyttest_invalid_actions
cCstj}|jddy|jdddWnStk
rtjd}d}d||f}|j|t|k|nXdS(NRRiRRis+dest supplied twice for positional argumentsexpected %r, found %r(R"R^RdRRPRTRuR(R
ReRfRRv((s./usr/local/lib/python2.7/test/test_argparse.pyttest_multiple_dest$s
cCsoxhdddddgD]Q}xHtdttddtd	d
gD]}|jdd||qGWqWdS(
NRRRRRR=RRRtabs-xR(RyRRl(R
Rtattrs((s./usr/local/lib/python2.7/test/test_argparse.pyttest_no_argument_actions/s
cCsPxIdddgD]8}|jdddd||jddd	d|qWdS(
NRRRs-xRRiRRR(Rl(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyt!test_no_argument_no_const_actions6sc
CsxddgD]}|jdddd||jdddd|xUdd	d
gD]D}|jdddd|d||jdddd|d|qUWq
WdS(
NRRs-xRiRRiRRRRi(Rm(R
RR((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_more_than_one_argument_actions@s
cCs4x-ddgD]}|jdddd|q
WdS(NRRs-xRRR(Rl(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyttest_required_const_actionsNscCsL|jddd|jddddd|jddddtjdS(NtcommandRtparsersRpRqRc(RlR"R^(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt"test_parsers_action_missing_paramsTscCs|jddtdS(NRiR(RlR&(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_required_positionalZsc
sdtfdYdtffdY}tj}|j|jdd|dd|j|jd	d|dddS(
NtSuccesscBseZRS((RR(((s./usr/local/lib/python2.7/test/test_argparse.pyR_sRics#eZefdZdZRS(cs:|dkr6|kr6|kr3q3q6ndS(NR((R
toption_stringsRRRR(R(s./usr/local/lib/python2.7/test/test_argparse.pyR7dsc_sdS(N((R
R5R6((s./usr/local/lib/python2.7/test/test_argparse.pyRgos(RRRR7Rg((R(s./usr/local/lib/python2.7/test/test_argparse.pyRibss--spamRRRR(RIRR"R^RRd(R
RiRe((Rs./usr/local/lib/python2.7/test/test_argparse.pyttest_user_defined_action]s(RRRRlRmRqRrRsRtRwRxR{R|R}R~RRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRks 							
			
				tTestActionsReturnedcBseZdZdZRS(cCs|tj}|jd}|j|jd|jdd}|j|jd|jdd}|j|jddS(	Ns--fooRis-bs--barRs-xs-yR(R"R^RdR	R(R
ReR((s./usr/local/lib/python2.7/test/test_argparse.pyR~scCstj}|jddddddddtd	d
dgdd
dddd}|j|jd|j|jd|j|jd|j|jt|j|j	d
dg|j|j
d
|j|jd|j|jddS(Ns--fooRRRi*RiTR=RiiRsRR7tBARRR(
R"R^RdRR	RRRR=RRsR7R(R
ReR((s./usr/local/lib/python2.7/test/test_argparse.pyt	test_miscs(RRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyR|s		tTestConflictHandlingcBs#eZdZdZdZRS(cCs|jttjdddS(Ntconflict_handlerRi(RRR"R^(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt
test_bad_typescCs\tj}|jd|jtj|jd|jd|jtj|jddS(Ns-xs--spam(R"R^RdRR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_conflict_errors


cCstj}|dddd}|jddd|jddd|j|jtjd	|jd
dd|jd
dd
|j|jtjddS(NRpRqRtresolves-xRssOLD XsNEW Xs            usage: PROG [-h] [-x X]

            optional arguments:
              -h, --help  show this help message and exit
              -x X        NEW X
            s--spamR7tOLD_SPAMtNEW_SPAMs            usage: PROG [-h] [-x X] [--spam NEW_SPAM]

            optional arguments:
              -h, --help       show this help message and exit
              -x X             NEW X
              --spam NEW_SPAM
            (R"R^RdR	RRR(R
RRe((s./usr/local/lib/python2.7/test/test_argparse.pyttest_resolve_errors	
(RRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs			tTestOptionalsHelpVersionActionscBsqeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
RS(s!Test the help and version actionscOsJy|||Wntk
r/tjdSX|jt|||dS(Ni(RHRPRTR(R
tfuncR5R6((s./usr/local/lib/python2.7/test/test_argparse.pyt
_get_errors

cCs2|j|j|j|j|jjdS(N(R	RRRWRRK(R
ReR((s./usr/local/lib/python2.7/test/test_argparse.pytassertPrintHelpExits	cCs2|j|j|j|j|jjdS(N(R	tformat_versionRRWRRL(R
ReR((s./usr/local/lib/python2.7/test/test_argparse.pytassertPrintVersionExits	cGs|jt|j|dS(N(RRHRW(R
ReR5((s./usr/local/lib/python2.7/test/test_argparse.pyRoscCsStdd}|j|d|j|d|j|d|j|ddS(NR's1.0s-hs--helps-vs	--version(R]RR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_versions
cCsDtdddd}|j|jdgj}|jd|dS(NRptPPPR's%(prog)s 3.5s-vsPPP 3.5
(R]RRWRLR	(R
ReRv((s./usr/local/lib/python2.7/test/test_argparse.pyttest_version_formatscCsYtdtdd}|j|d|j|d|j|d|j|ddS(NRR's1.0s-hs--helps-vs	--version(R]RRoR(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_version_no_helps
cCsWtdd}|jddddd|j|jdgj}|jd|dS(NRpRIs-VRR's%(prog)s 3.7sXXX 3.7
(R]RdRRWRLR	(R
ReRv((s./usr/local/lib/python2.7/test/test_argparse.pyttest_version_actionscCsStdt}|j|d|j|d|j|d|j|ddS(NRs-hs--helps-vs	--version(R]RRo(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_no_helps
cCsst}|jddd|jddd|j|d|j|d|j|d|j|ddS(Ns-xRRss-yR's-vs	--version(R]RdRRRo(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_alternate_help_versions	cCstdd}|jddd|jddddd	d
g}|ddg}x|D]w}x|D]}d
||f}qhW|j||d|j||d|j||d|j||dq[WdS(NR's1.0s-xRRRRRis-x barsbaz -xs--bad-optionsfoo bar bazs	%s %%s %ss-hs--helps-vs	--version(R]RdRR(R
Retvalid_prefixestvalid_suffixestprefixtsuffixR((s./usr/local/lib/python2.7/test/test_argparse.pyt!test_help_version_extra_argumentss


(RRRRRRRoRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs											tTestStringscBs;eZdZdZdZdZdZdZRS(s3Test str()  and repr() on Optionals and PositionalscCs1x*ttgD]}|j|||q
WdS(N(RRR	(R
tobjt
result_stringR((s./usr/local/lib/python2.7/test/test_argparse.pytassertStringEqual scCshtjddddgddddd	d
ddd
dddgdddd}d}|j||dS(NRs--foos-as-bRRR=RRRRi*RiiiRstHELPR7tMETAVARsAction(option_strings=['--foo', '-a', '-b'], dest='b', nargs='+', const=None, default=42, type='int', choices=[1, 2, 3], help='HELP', metavar='METAVAR')(R"RiR(R
toptionR[((s./usr/local/lib/python2.7/test/test_argparse.pyt
test_optional$s		cCsctjdgdddtddddd	d
ddgdd
dd}dt}|j||dS(NRRRR=RRRg@Rg?g?RssH HH HR7sMV MV MVsAction(option_strings=[], dest='x', nargs='?', const=None, default=2.5, type=%r, choices=[0.5, 1.5, 2.5], help='H HH H', metavar='MV MV MV')(R"RiR R(R
targumentR[((s./usr/local/lib/python2.7/test/test_argparse.pyt
test_argument4s		cCs2tjdddd}d}|j||dS(NRii*RRsNamespace(bar='spam', foo=42)(R"R
R(R
RR[((s./usr/local/lib/python2.7/test/test_argparse.pyttest_namespaceDscCs3tjdd}dtj}|j||dS(NRpRqsArgumentParser(prog='PROG', usage=None, description=None, version=None, formatter_class=%r, conflict_handler='error', add_help=True)(R"R^t
HelpFormatterR(R
ReR[((s./usr/local/lib/python2.7/test/test_argparse.pyttest_parserIs
(RRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs				t
TestNamespacecBs#eZdZdZdZRS(cCsdtj}|jtt|dtjdddd}|j|jd|j|jddS(NRRi*RR(R"R
RtAttributeErrorRRR	RR(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyttest_constructorWs
cCstjdddd}tjdddd}tjdd}tjdd}|j|||j|||j|||j|||j|||j||k|j||k|j||k|j||kdS(NRiRi(R"R
R	tassertNotEqualRu(R
tns1tns2tns3tns4((s./usr/local/lib/python2.7/test/test_argparse.pyt
test_equality_scCsNtjdddd}|j|jdt|j|jdtdS(NRiRi(R"R
tassertIsRDRFtNotImplementedRE(R
R((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_equality_returns_notimplemetedos(RRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRUs		tTestEncodingcBs#eZdZdZdZRS(cCsNtjj|\}}|d7}tj|dd}|jWdQXdS(Ns.pyR8tutf8(RR tsplitexttcodecsR-R@(R
R RuR((s./usr/local/lib/python2.7/test/test_argparse.pyt_test_module_encoding|s
cCs|jtjdS(N(RR"t__file__(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_argparse_module_encodingscCs|jtdS(N(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt"test_test_argparse_module_encodings(RRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRzs		tTestArgumentErrorcBseZdZRS(cCs2d}tjd|}|jt||dS(Ns
my error here(R"RRFR	R(R
RvR_((s./usr/local/lib/python2.7/test/test_argparse.pyttest_argument_errors(RRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestArgumentTypeErrorcBseZdZRS(cCsd}tdddt}|jdd|y|jdgWn:tk
rd}tjd	j}|j||nX|j	dS(
NcSstjddS(Nsspam!(R"tArgumentTypeError(R[((s./usr/local/lib/python2.7/test/test_argparse.pyRsRpRqRRR=RIs-usage: PROG x
PROG: error: argument x: spam!
i(
R]RRdRWRHRPRTRLR	tfail(R
RReRRv((s./usr/local/lib/python2.7/test/test_argparse.pyttest_argument_type_errors	
(RRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestTypeFunctionCallOnlyOncecBseZdZRS(csffd}tj}|jdd|dd|jdj}jtdd|dS(	Ncsj|ddS(Nsspam!t
foo_converted(R	(tstring_to_convert(R
(s./usr/local/lib/python2.7/test/test_argparse.pyRss--fooR=RRs--foo spam!RiR(R"R^RdRWRR	R8(R
RReR5((R
s./usr/local/lib/python2.7/test/test_argparse.pyt!test_type_function_call_only_onces
(RRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRstTestTypeFunctionCalledOnDefaultcBs,eZdZdZdZdZRS(cs`fd}tj}|jdd|dd|jg}jtdd|dS(Ncsj|ddS(NiR(R	(tint_to_convert(R
(s./usr/local/lib/python2.7/test/test_argparse.pyRss--fooR=RiRi(R"R^RdRWR	R8(R
RReR5((R
s./usr/local/lib/python2.7/test/test_argparse.pyt/test_type_function_call_with_non_string_defaults
cCsZd}tj}|jdd|dd|jg}|jtdd|dS(NcSsdS(NR((R((s./usr/local/lib/python2.7/test/test_argparse.pyRss--fooR=Rt0RiR(R"R^RdRWR	R8(R
RReR5((s./usr/local/lib/python2.7/test/test_argparse.pyt+test_type_function_call_with_string_defaults
	cCsZd}tj}|jdd|dd|jg}|jtdd|dS(NcSs|dS(NR((tstr_to_convert((s./usr/local/lib/python2.7/test/test_argparse.pytextendss--testR=RRR`s**(R"R^RdRWR	R8(R
RReR5((s./usr/local/lib/python2.7/test/test_argparse.pyt)test_no_double_type_conversion_of_defaults
	c
CsWtj}|jddddtdgdd|jg}|j|jgdS(Ns--testRR`R=RRR(R"R^RdRRWR	R`(R
ReR5((s./usr/local/lib/python2.7/test/test_argparse.pyttest_issue_15906s

(RRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs		
	tTestParseKnownArgscBs>eZdZdZdZdZdZdZRS(cCstj}|jddS(N((R"R^RW(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_arguments_tuplescCstj}|jgdS(N(R"R^RW(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_arguments_listscCs*tj}|jd|jddS(NR(R(R"R^RdRW(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_arguments_tuple_positionals
cCs-tj}|jd|jdgdS(NR(R"R^RdRW(R
Re((s./usr/local/lib/python2.7/test/test_argparse.pyttest_arguments_list_positionals
cCsgtj}|jd|jdj\}}|jtdd||jddg|dS(Ns--foos--foo F --bar --bazRitFs--bars--baz(R"R^RdRRR	R8(R
ReR5textras((s./usr/local/lib/python2.7/test/test_argparse.pyttest_optionalss

cCstj}|jddddddt|jddd	|jd
ddd
dddg}|j|\}}|jtdddtd
d||jdd
dg|dS(Ns-vRRRiR=s--spamRRRRRYs--fooRuRtviR(R"R^RdRRR	R8R&(R
ReRqR5R((s./usr/local/lib/python2.7/test/test_argparse.pyt
test_mixed	s
%(RRRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs					tTestAddArgumentMetavarcBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1RS(0s,length of metavar tuple does not match nargscCs)tj}|jdd|d|dS(Ns--fooRR7(R"R^Rd(R
RR7Re((s./usr/local/lib/python2.7/test/test_argparse.pytdo_test_no_exceptionsc
Cs^tj}|jt }|jdd|d|WdQX|j|jjd|jdS(Ns--fooRR7i(	R"R^RRRdR	t	exceptionR5tEXPECTED_MESSAGE(R
RR7Retcm((s./usr/local/lib/python2.7/test/test_argparse.pytdo_test_exception scCs|jdddddS(NRR7R(RRF(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_None_metavar_string(scCs|jdddtdS(NRR7(RRFttuple(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_None_metavar_length0+scCs|jdddddS(NRR7R(R(RRF(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_None_metavar_length1.scCs|jdddddS(NRR7RR(RR(RRF(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_None_metavar_length21scCs|jdddddS(NRR7RRRu(RRRu(RRF(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_None_metavar_length34scCs|jdddddS(NRRR7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt"test_nargs_optional_metavar_string9scCs|jdddtdS(NRRR7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_nargs_optional_metavar_length0<scCs|jdddddS(NRRR7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_nargs_optional_metavar_length1?scCs|jdddddS(NRRR7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_nargs_optional_metavar_length2BscCs|jdddddS(NRRR7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_nargs_optional_metavar_length3EscCs|jdddddS(NRRR7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_zeroormore_metavar_stringJscCs|jdddtdS(NRRR7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt%test_nargs_zeroormore_metavar_length0MscCs|jdddddS(NRRR7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt%test_nargs_zeroormore_metavar_length1PscCs|jdddddS(NRRR7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt%test_nargs_zeroormore_metavar_length2SscCs|jdddddS(NRRR7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt%test_nargs_zeroormore_metavar_length3VscCs|jdddddS(NRRR7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_nargs_oneormore_metavar_string[scCs|jdddtdS(NRRR7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_oneormore_metavar_length0^scCs|jdddddS(NRRR7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_oneormore_metavar_length1ascCs|jdddddS(NRRR7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_oneormore_metavar_length2dscCs|jdddddS(NRRR7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_oneormore_metavar_length3gscCs|jdddddS(NRs...R7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt#test_nargs_remainder_metavar_stringlscCs|jdddtdS(NRs...R7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_remainder_metavar_length0oscCs|jdddddS(NRs...R7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_remainder_metavar_length1rscCs|jdddddS(NRs...R7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_remainder_metavar_length2uscCs|jdddddS(NRs...R7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt$test_nargs_remainder_metavar_length3xscCs|jdddddS(NRsA...R7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt test_nargs_parser_metavar_string}scCs|jdddtdS(NRsA...R7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt!test_nargs_parser_metavar_length0scCs|jdddddS(NRsA...R7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt!test_nargs_parser_metavar_length1scCs|jdddddS(NRsA...R7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt!test_nargs_parser_metavar_length2scCs|jdddddS(NRsA...R7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyt!test_nargs_parser_metavar_length3scCs|jdddddS(NRiR7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_1_metavar_stringscCs|jdddtdS(NRiR7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_1_metavar_length0scCs|jdddddS(NRiR7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_1_metavar_length1scCs|jdddddS(NRiR7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_1_metavar_length2scCs|jdddddS(NRiR7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_1_metavar_length3scCs|jdddddS(NRiR7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_2_metavar_stringscCs|jdddtdS(NRiR7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_2_metavar_length0scCs|jdddddS(NRiR7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_2_metavar_length1scCs|jdddddS(NRiR7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_2_metavar_length2scCs|jdddddS(NRiR7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_2_metavar_length3scCs|jdddddS(NRiR7R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_3_metavar_stringscCs|jdddtdS(NRiR7(RR(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_3_metavar_length0scCs|jdddddS(NRiR7R(R(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_3_metavar_length1scCs|jdddddS(NRiR7RR(RR(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_3_metavar_length2scCs|jdddddS(NRiR7RRRu(RRRu(R(R
((s./usr/local/lib/python2.7/test/test_argparse.pyttest_nargs_3_metavar_length3s(2RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR	R
RRR
RRRRRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs`																																														tTestImportStarcBseZdZdZRS(cCs.x'tjD]}|jtt|q
WdS(N(R"t__all__RuR(R
R*((s./usr/local/lib/python2.7/test/test_argparse.pyR`scCslgttjD]0\}}|jdstj|s|^q}|jt|ttjdS(NRu(	RBR"R<t
startswithtinspecttismoduleR	R;R(R
R*RWR<((s./usr/local/lib/python2.7/test/test_argparse.pyt'test_all_exports_everything_but_moduless
(RRR`R(((s./usr/local/lib/python2.7/test/test_argparse.pyRs	tTestWrappingMetavarcBseZdZdZRS(cCs/td|_d}|jjdd|dS(Nt9this_is_spammy_prog_with_a_long_name_sorry_about_the_names<http[s]://example:1234>s--proxyR7(R]ReRd(R
R7((s./usr/local/lib/python2.7/test/test_argparse.pyRscCs,|jj}|j|tjddS(Ns(            usage: this_is_spammy_prog_with_a_long_name_sorry_about_the_name
                   [-h] [--proxy <http[s]://example:1234>]

            optional arguments:
              -h, --help            show this help message and exit
              --proxy <http[s]://example:1234>
            (ReRR	RR(R
t	help_text((s./usr/local/lib/python2.7/test/test_argparse.pyttest_help_with_metavars(RRRR(((s./usr/local/lib/python2.7/test/test_argparse.pyRs		cCsKtjdtfdtftjtWdQXit_tt_dS(Ns7The "version" argument to ArgumentParser is deprecated.s/The (format|print)_version method is deprecated(	Rtcheck_warningstDeprecationWarningtrun_unittestRR=R?RRJ(((s./usr/local/lib/python2.7/test/test_argparse.pyt	test_mains
	t__main__(RRRR$R"RPRRtunittestR"RRR`RRRRR4R8RIRHR\R^R]R=R`RRaRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR	R
RRR
RRRRRRRRRR!R$R&R(R1R7R=RBRFRHRJtskipIfRRNRORPRQRURXRZRaRjRnRRRRRRRRRRRRRRRRRRRRRRR	RRRR-R1R2R3R6R8R:R;R<R?RARBRCRDRERFRGRHRKRLRMRNRORPRQRRRSRTRURVR_RbRdRgRhRiRkRRRRRRRRRRRRRRR"R(((s./usr/local/lib/python2.7/test/test_argparse.pyt<module>s
	 q	











##$	C'&0#+!$-*(-	^Z	#7.4(6,$&"$.
10(.-V8%1*	

Zerion Mini Shell 1.0