[ VSSKrSSKrSSKrSSKrSSKrSSKJr SSKJr SSK J r SSK J r J r SSKrSSKJrJrJrJrJrJrJrJrJrJrJr SSKJr SSKJr "S S \5r"S S \5r"S S\R>5r "SS\ 5r!"SS\ 5r""SS\ 5r#"SS\ 5r$SSSSS.r%Sr&"SS\5r'"SS \ 5r("S!S"\ 5r)"S#S$\ 5r*"S%S&\ 5r+"S'S(\ 5r,"S)S*\ 5r-"S+S,\ 5r."S-S.\ 5r/"S/S0\ 5r0"S1S2\ 5r1"S3S4\ 5r2"S5S6\ 5r3"S7S8\ 5r4"S9S:\ 5r5"S;S<\ 5r6"S=S>\ 5r7"S?S@\ 5r8"SASB\ 5r9"SCSD\ 5r:"SESF\ 5r;"SGSH\ 5r<"SISJ\<5r="SKSL\<5r>"SMSN\ 5r?SOr@SPrASQrBSRrCSSrD"STSU\ 5rE"SVSW\ 5rF"SXSY\ 5rG"SZS[\R>5rH"S\S]\ 5rI\JS^:XaU\K"\R5S:a-\RSS_:Xa\ "\5 \R"S5 \R"5 gg)`N)StringIO)support) os_helper)TestTranslationsBaseupdate_translation_snapshots) make_optionOptionTitledHelpFormatter OptionParser OptionGroupSUPPRESS_USAGE OptionErrorOptionConflictErrorBadOptionErrorOptionValueErrorValues) _match_abbrev) _parse_numc*\rSrSrSSjrSrSrg)InterceptedErrorNc(XlX lX0lgN) error_message exit_status exit_message)selfrrrs 9/opt/alt/python313/lib64/python3.13/test/test_optparse.py__init__InterceptedError.__init__s+&(cRUR=(d UR=(d S$)Nzintercepted error)rrrs r__str__InterceptedError.__str__%s!!MT%6%6M:MMr!)rrr)NNN)__name__ __module__ __qualname____firstlineno__rr$__static_attributes__r!rrrs#!")Nr!rc$\rSrSrSSjrSrSrg)InterceptingOptionParser(Nc[XS9e)N)rrr)rstatusmsgs rexitInterceptingOptionParser.exit)s 6DDr!c[US9e)N)rr0)rr2s rerrorInterceptingOptionParser.error,s S11r!r+rN)r&r'r(r)r3r6r*r+r!rr-r-(s E2r!r-c@\rSrSrSrSrSrS SjrSrSr S r g) BaseTest0cURRU5upE[U5nURXbS[ 5-5 URXSS[ 5-5 XE4$)abAssert the options are what we expected when parsing arguments. Otherwise, fail with a nicely formatted message. Keyword arguments: args -- A list of arguments to parse with OptionParser. expected_opts -- The options expected. expected_positional_args -- The positional arguments expected. Returns the options and positional args for further testing. zJ Options are %(optdict)s. Should be %(expected_opts)s. Args were %(args)s.zj Positional arguments are %(positional_args)s. Should be %(expected_positional_args)s. Args were %(args)s.)parser parse_argsvars assertEquallocals)rargs expected_optsexpected_positional_argsoptionspositional_argsoptdicts r assertParseOKBaseTest.assertParseOK1ss&*[[%;%;D%A"w-  " #  # $ ))r!c UcSnUc0nU"U0UD6 URS[5-5 g!Uan[U5n[U[R 5(a5UR URU5SUR<SU<S35 OURUUSU<SU<S35 UsSnA$SnAff=f) a Assert that the expected exception is raised when calling a function, and that the right error message is included with that exception. Arguments: func -- the function to call args -- positional arguments to `func` kwargs -- keyword arguments to `func` expected_exception -- exception that should be raised expected_message -- expected exception message (or pattern if a compiled regex object) Returns the exception raised for further testing. Nr+znexpected exception %(expected_exception)s not raised called %(func)r with args %(args)r and kwargs %(kwargs)r z%expected exception message pattern: /z/ actual exception message: '''z''' zexpected exception message: '''z!''' actual exception message: ''') failrAstr isinstancerePattern assertTruesearchpatternr@)rfuncrBkwargsexpected_exceptionexpected_messageerractual_messages r assertRaisesBaseTest.assertRaisesOs* <D >F  $ !& !. II i  -"  XN*BJJ77 0 7 7 G  12  !1  ")*J) s1B>A9B>cURRU5 URS5 g![a&nUR UR U5 SnAgSnAff=f)zy Assert the parser fails with the expected message. Caller must ensure that self.parser is an InterceptingOptionParser. zexpected parse failureN)r=r> assertFalserr@r)r cmdline_argsexpected_outputrWs rassertParseFailBaseTest.assertParseFailsW  7 KK " "< 0   5 6  A   S.. @ @ As/ AAANc[Rn[5[lURR U5 [RR 5nU[lUR S5 g![RR 5nU[lf=f![anUR[W[5S[U5-5 Xb:waURSU-S-U-S-5 URURU5 URURU5 SnAgSnAff=f)z7Assert the parser prints the expected output on stdout.zexpected parser.exit()z0expected output to be an ordinary string, not %rzexpected: ''' z''' but got ''' z'''N)sysstdoutrr=r>getvaluer\rrPrMrLtyperKr@rr)rr]r^expected_statusexpected_error save_stdoutoutputrWs r assertOutputBaseTest.assertOutputs jj  7 )%Z  &&|4,,.(    5 6,,.(  ? OO63'Bv, ( -?0139:   S--~ > > ?s*.A=)B+=+B((B++ E5BEEc4URXS[U5 g)z4Assert that TypeError is raised when executing func.N)rY TypeError)rrSrVrBs rassertTypeErrorBaseTest.assertTypeErrors $dI7GHr!chUR5nX2:waURSU-S-U-S-5eg)Nzhelp text failure; expected: "z "; got: "z" ) format_helpfailureException)rr= expected_help actual_helps r assertHelpBaseTest.assertHelpsQ((*  '''1 ,-#$% % (r!r+r8) r&r'r(r)rHrYr_rjrnrur*r+r!rr:r:0s**<6v 7&'$( 7:I%r!r:c\rSrSrSr/04SjrSrSrSrSr Sr S r S r S r S rS rSrSrSrSrSrSrSrSrSrSrSrSrg)TestOptionChecksc([[S9UlgNusager r r=r#s rsetUpTestOptionChecks.setUp"8 r!c<UR[X#[U5 gr)rYrr)rrVrBrTs rassertOptionError"TestOptionChecks.assertOptionErrors +t%'7 9r!c0UR[S5 g)Nz+at least one option string must be supplied)rnrr#s rtest_opt_string_empty&TestOptionChecks.test_opt_string_emptys [J Lr!c*URSS/5 g)Nz?invalid option string 'b': must be at least two characters longbrr#s rtest_opt_string_too_short*TestOptionChecks.test_opt_string_too_shorts  M E r!c*URSS/5 g)NzOinvalid short option string '--': must be of the form -x, (x any non-dash char)--rr#s rtest_opt_string_short_invalid.TestOptionChecks.test_opt_string_short_invalids  4 F r!c*URSS/5 g)NzJinvalid long option string '---': must start with --, followed by non-dashz---rr#s rtest_opt_string_long_invalid-TestOptionChecks.test_opt_string_long_invalids  7 G r!c2URSS/SSS.5 g)Nz.option -b: invalid keyword arguments: bar, foo-bfoobarrr#s rtest_attr_invalid"TestOptionChecks.test_attr_invalids  < FD. 0r!c0URSS/SS05 g)Nz option -b: invalid action: 'foo'ractionrrr#s rtest_action_invalid$TestOptionChecks.test_action_invalids  . FXu% 'r!cdURSS/SS05 URSS/S[05 g)Nz%option -b: invalid option type: 'foo'rrerz'option -b: invalid option type: 'tuple')rtupler#s rtest_type_invalid"TestOptionChecks.test_type_invalids<  3 FVUO %  5 FVUO %r!c2URSS/SSS.5 g)Nz4option -b: must not supply a type for action 'count'rcountint)rrerr#s rtest_no_type_for_action(TestOptionChecks.test_no_type_for_actions  B Fw6 8r!c2URSSS/SS05 g)Nz@option -b/--bad: must supply a list of choices for type 'choice'r--badrechoicerr#s rtest_no_choices_list%TestOptionChecks.test_no_choices_lists#  ( 7Ofh/ 1r!cd[S5RnURSU-SS/SSS.5 g)NzBoption -b/--bad: choices must be a list of strings ('%s' supplied)rrrz bad choicesrechoices)rer&r)rtypenames rtest_bad_choices_list&TestOptionChecks.test_bad_choices_lists;8$$  &(0 1 7O 7  9r!c2URSS/SSS.5 g)Nz1option -b: must not supply choices for type 'int'rrbadrrr#s rtest_no_choices_for_type)TestOptionChecks.test_no_choices_for_types  ? FUe4 6r!c2URSS/SSS.5 g)Nz:option -b: 'const' must not be supplied for action 'store'rstore)rconstrr#s rtest_no_const_for_action)TestOptionChecks.test_no_const_for_action   H Fw3 5r!c2URSS/SSS.5 g)Nz:option -b: 'nargs' must not be supplied for action 'count'rr)rnargsrr#s rtest_no_nargs_for_action)TestOptionChecks.test_no_nargs_for_actionrr!c2URSS/SSS.5 g)Nz'option -b: callback not callable: 'foo'rcallbackrrrrr#s rtest_callback_not_callable+TestOptionChecks.test_callback_not_callables"  5 Fz!&( )r!cgrr+r#s rdummyTestOptionChecks.dummy r!cHURSS/SURSS.5 g)NzAoption -b: callback_args, if supplied, must be a tuple: not 'foo'rrr)rr callback_argsrrr#s rtest_callback_args_no_tuple,TestOptionChecks.test_callback_args_no_tuples+  ) Fz!%&+- .r!cHURSS/SURSS.5 g)NzBoption -b: callback_kwargs, if supplied, must be a dict: not 'foo'rrr)rrcallback_kwargsrr#s rtest_callback_kwargs_no_dict-TestOptionChecks.test_callback_kwargs_no_dict's+  ( Fz!%(-/ 0r!c2URSS/SSS.5 g)Nz