python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_configparser.cpython-312.pyc

͑eRddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZGddejZ
GddZGdd	eZGd
deej ZGdd
eej ZGddeej ZGddeZGddej ZGddeZGddeZGddeej ZGddeej ZGddeZGddeej ZGd d!eej ZGd"d#eZGd$d%eej ZGd&d'ej ZGd(d)eZ Gd*d+eej Z!Gd,d-eej Z"Gd.d/Z#d0Z$Gd1d2ej Z%Gd3d4ej Z&Gd5d6ej Z'Gd7d8ej Z(Gd9d:ej Z)Gd;d<eej Z*Gd=d>ej Z+Gd?d@ej Z,e-dAk(rej\yy)BN)support)	os_helperc4eZdZdZdZdZdZdZdZeZ	y)
SortedDictcHt|jjSN)sorteddataitemsselfs J/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_configparser.pyrzSortedDict.itemssdiioo'((cHt|jjSr)r	r
keysrs rrzSortedDict.keyssdiinn&''rcN|jDcgc]}|d	c}Scc}w)N)r)r
is  rvalueszSortedDict.valuess "jjl+!+++s"c4t|jSr)iterrrs r	iteritemszSortedDict.iteritemssDJJL!!rc4t|jSr)rrrs riterkeyszSortedDict.iterkeyssDIIK  rc4t|jSr)rrrs r
itervalueszSortedDict.itervaluessDKKM""rN)
__name__
__module____qualname__rrrrrr__iter__rrrrs')(,"!#Hrrc|eZdZdZdZdZdZdZejZ
dZejZ
ejZddZddZy)	CfgParserTestCaseClassF)=:);#TNct||j|j|j|j|j
|j|j|j|j
}|jdi|}|S)N)
defaultsallow_no_value
delimiterscomment_prefixesinline_comment_prefixesempty_lines_in_values	dict_typestrictdefault_section
interpolationr!)dictr*r+r,r-r.r/r0r1r2config_class)r
r)	argumentsinstances    r	newconfigz CfgParserTestCaseClass.newconfig0sv..!22$($@$@"&"<"<nn;; 00,,
	%4$$1y1rcJ|j|}|j||Sr)r7read_string)r
stringr)cfs    r
fromstringz!CfgParserTestCaseClass.fromstring@s!
^^H
%
v	rr)rrrr*r+r,r-r.configparser
_default_dictr/r0DEFAULTSECTr1_UNSETr2r7r<r!rrr#r#%sNNJ!( **I
F"..O ''M rr#ceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZy)
BasicTestCasec<!gd}|jr|jd|jddg}|j}|j|j}||||jd}|j||||Dcgc]}|}}|j|j|j|j||||dj}tt|}||||j}tt|}|j	t|t||D]\}}|||j||j||j||jddd||jd	dd
||jddd||jddd
||jddd||jddd
||jddd||jddd||jddd||jddd|j|jddd||jddd||j!ddd||jddd||jd d!d"|jr||jdd#d||jddd$d||jddddi%d|j#t$j&5|jd&dddd|j#t$j(5|jdd'ddd||jd&dd$d||jdd'd$d||jd	dd$d
||jd(dd$d||jddd)$d||jdd*d)$d)||jdd*d+$d+|j#t$j(5|jdd*ddd|j|jddd,$d|j|jdd-d,$d,||jdd-d.$d.|j#t$j(5|jdd-ddd||j!ddd/$d||j!dd0d1$d1||j!dd0d/$d/|j#t$j(5|j!dd0ddd||j!d2dd/$d/|jr6||jdd#d$d||jdd3d$d||ddd||d	dd
|d}||jd|j+|j,||j#t.5d4|_
ddd|j#t.5d5|_ddd||dd||dd
||ddd||ddd
||ddd||ddd||d6dd7|jr||dd#d||djddd||djdd$d||djdddi%d|j#t05|d&dddd|j#t05|dd'ddd|j#t05|d&jdd$ddd||djd'dd||djd'd$d||djd'd||d	jddd
||d	jdd$d
|j#t05|d(jddddd||djdd)d||djdd)$d||djd*d)d)||djd*d)$d)||djd*d+d+||djd*d+$d+||djd*d|j|djdd,d|j|djdd,$d|j|djd-d,d,|j|djd-d,$d,||djd-d.d.||djd-d.$d.||djd-d||dj!dd/d||dj!dd/$d||dj!d0d1d1||dj!d0d1$d1||dj!d0d/d/||dj!d0d/$d/||dj!d0d|jrr||djd#dd||djd#d$d||djd3dd||djd3d$dd8||jd9<d:||jd;<|j3|j5d|j7|j9dd|j7|j5d|j7|j5|j|j3|j;ddd<|j7|j9ddd=|j7|j;ddd>|j3|j9dd9|j7|j;dd9|j3|j;|jd9|j7|j9dd9|j7|j;|jd9|j#t$j&5}|j;d?dddd|j	j<j>d@||jd6dd7|d=|j7d|v|j#t05|d=ddd|j#t@5||j=ddd|d	d=|j7d|d	v|j#t05|d	d=ddd|j3d;|d	v|j#t05|d	d;=ddd||jd;=|j7d;|d	v|j#t05||jd;=ddd|j#t05|d?d=dddycc}w#1swYxYw#1swYxYw#1swY
xYw#1swY
`xYw#1swY	xYw#1swY	xYw#1swY	xYw#1swYxYw#1swYxYw#1swYxYw#1swY!xYw#1swY2xYw#1swYxYw#1swYxYw#1swYxxYw#1swYKxYw#1swYxYw#1swYyxYw)AN)

Commented BarFoo BarInternationalized Stuff	Long LineSection\with$weird%characters[	Spaces
Spacey BarSpacey Bar From The BeginningTypesThis One Has A ] In ItNoValue)bazqwe)foobar3rKrErQbar1rJbar2rRrOrPrDbar4rIkey with spacesvalueanother with spacessplat!rLint*42float)\(?z0.44booleanF123strange but acceptablerMforksspoonsoption-without-valuefallbackvarszNo Such Foo Barzno-such-foozNo Such Spacey Barzno-such-int18gz
no-such-floatz0.0Tzno-such-booleanyesz
No Such Typeszno-such-option-without-valuezName is read-onlyzParser is read-onlyrG7this line is much, much longer than my editor
likes it.1
this_value2
that_valuez4remove_option() failed to report existence of optionz'remove_option() failed to remove optionzIremove_option() failed to report non-existence of option that was removedNo Such Section)rq)!r*appendsortsectionsassertEqualrr1r	listlennamer)getgetintassertAlmostEqualgetfloat
getbooleanassertRaisesr=NoSectionError
NoOptionErrorassertIsparserAttributeErrorKeyError
assertTrueremove_sectionassertFalse
has_option
remove_option	exceptionargs
ValueError)	r
r;EFLeqsectionrxcms	         r
basic_testzBasicTestCase.basic_testHs


HHY	
_-
KKM	



1aHH45	
1a%''W''		%%&	
1a./55747O
1aHHJ47OQQ(	#MD'tW\\"	#
2;;="T1123	266)U#V,
266,&/
2661596B
2661595A
266/5)62
266/5)51
266(-.8
266(12H=
299We$b)
266'5!4(r{{7G<dC
266'7#V,
2==),e4
266'5!#;<
266*G4h?rvvi!78$?	266)UU63V<
266)U%68%@


|::
;	-FF$e,	-


|99
:	-FF9m,	-
266#UU6;UC
266)]U6;UC
266,65v>
266&6=tD
299Web9126
299Wmb992>
299Wmd9;TB


|99
:	.IIg}-	.r{{7G47 + 9:>	@r{{7O47 + 9:=	?
2;;w%;@%H


|99
:	2KK1	2
2==)d=;UC
2=="3e=D	
2=="3d=CTJ


|99
:	6MM'#45	6
2==)d=CTJrvvi!7%vH$Orvvi!?$&',
.	2i=(
2lE"F+45
7<<89

gnnb)


~
.	/.GL	/


~
.	32GN	3
75>6"
75>5!
2ou%v.
2ou%u-
2h<)*G4
2h<-.9
2k?5!E	Gr)}34d;
2i=UE*F3
2i=UU3V<
2i=U%8%@


x
(	) !%(	)


x
(	)yM-(	)


x
(	= !%%ee%<	=
2i=]E2E:
2i=]U;UC
2i=]+T2
2lt,f5
2l5v>


x
(	6#$((5	6
2g;eR("-
2g;eb126
2g;mR0"5
2g;mb92>
2g;mT2D9
2g;md;TB
2g;m,d3r'{33GSA4Hr'{33G=@ 4 BCG	Ir'{33OSI3Or'{33O=@ 4 BCF	H
2g;7?
2g;%@%H
2g;0$7
2g;!!)T2E:
2g;!!)d!;UC
2g;!!"3U;UC
2g;!!"3e!D	
2g;!!"3T:DA
2g;!!"3d!CTJ
2g;!!"34d;r)}  !7?Fr)}  !7% H$Or)}  !?GOr)}  !?$!&',
.254 .144 .	
))(34x1BCD**845**4+?+?@A((E:N	Py%8=	?)))U;(	)	


i>?)))\BC(()=)=|LMy,?@))$*>*>MN


|::
;	7r.6	7**,@A
266+u%E	G
wKB'


x
(	7	


z
*	)4''(	)|U#"\"223


x
(	(< '	(<(889


x
(	/< .	/t##$\2L)99:


x
(	74''(6	7


x
(	-$%e,	-	-}
(R	-	-	-	-	.	.	2	2	6	6	/	/	3	3 	)	)	)	)	=	=	6	6r	7	7			)	)	(	(	/	/	7	7	-	-s	~0~5+6)6:A@5	A@	A@A@*A@7AAAA'AA.AA+(AA82AB AB5~?&)36A@@A@
@A@@A@'@*A@4@7AAAAAAAAAAA(A+AA5A8ABBABBABcdj|j|j}|jr|dz
}|j	|}|j||jr|jtj5|jtjdj|jddd|jtj5|jtjdj|jdddy|jtjdj|j|jtjdj|jy#1swYxYw#1swYyxYw)Nax[Foo Bar]
foo{0[0]}bar1
[Spacey Bar]
foo {0[0]} bar2
[Spacey Bar From The Beginning]
  foo {0[0]} bar3
  baz {0[0]} qwe
[Commented Bar]
foo{0[1]} bar4 {1[1]} comment
baz{0[0]}qwe {1[0]}another one
[Long Line]
foo{0[1]} this line is much, much longer than my editor
   likes it.
[Section\with$weird%characters[	]
[Internationalized Stuff]
foo[bg]{0[1]} Bulgarian
foo{0[0]}Default
foo[en]{0[0]}English
foo[de]{0[0]}Deutsch
[Spaces]
key with spaces {0[1]} value
another with spaces {0[0]} splat!
[Types]
int {0[1]} 42
float {0[0]} 0.44
boolean {0[0]} NO
123 {0[1]} strange but acceptable
[This One Has A ] In It]
  forks {0[0]} spoons
z[NoValue]
option-without-value
z                    [Duplicate Options Here]
                    option {0[0]} with a value
                    option {0[1]} with another value
                z                    [And Now For Something]
                    completely different {0[0]} True
                    [And Now For Something]
                    the larch {0[1]} 1
                z                [Duplicate Options Here]
                option {0[0]} with a value
                option {0[1]} with another value
            z                [And Now For Something]
                completely different {0[0]} True
                [And Now For Something]
                the larch {0[1]} 1
            )formatr+r,r*r<rr0r~r=DuplicateOptionErrorr9textwrapdedentDuplicateSectionErrorr

config_stringr;s   r
test_basiczBasicTestCase.test_basic(sn<F4??D112=	>)
M__]
+;;""<#D#DE
.x0F4??+	 -.
.""<#E#EF
.x0
F4??+ -.
.
.
NN8??,t'	)
*
NN8??,
t')
*)
.
.
.
.s>F,*>F8,F58Gc
ddiddiddddddddiid	d
ddd
ddddddddddid
}|jr|jdddii|j}|j||j	||j
r|j
tj5|jddiddidddd|j
tj5|jdd d!d"idddy|jddiddid#|jdd d!d"iy#1swYwxYw#1swYyxYw)$NrQrSrTrRrP)rQrOrUrl	BulgarianDefaultEnglishDeutsch)zfoo[bg]rQzfoo[en]zfoo[de]rWrY)rVrXr[r^Fra)rZr]r_{rbrc)
rErJrKrDrGrHrFrIrLrMrNrdkeykey2value2)rmrzDuplicate Options Herezwith a valuezwith another value)optionOPTION)rSECTION)
r*updater7	read_dictrr0r~r=rr)r
configr;s   rtest_basic_from_dictz"BasicTestCase.test_basic_from_dictksvv.

2' $$	($+'/
 -	'K(
RMM*D

^^

V;;""<#E#EF
))

""<#D#DE
,"0"6/


LL!7+"H-

LL(,2+
#




s'D6'E6D?Ec*|j}|jd|jd|jd|j}|j|j}||gd|jddd||j
ddg||jdddd|jtj5|jdddddd|j|jdd|j|jdd|jddd	d
D]$}|j|jd|d&||j
ddg||j
ddg|jdd||j
dg|jd
j!|j"d}||j
ddg||jddd|jdj!|j"dddi}|j|jddy#1swYxYw)NAaB)rrrrWb@could not locate option, expecting case-insensitive option namesA-B	A-B valuea-bzA-bza-Br9has_option() returned false for option which should existr3[MySection]
Option{} first line   
	second line   
r	MySectionrOptionfirst line
second line[section]
nekey{}nevalue
rr)rKey)r7add_sectionrtrsrusetoptionsryr~r=rrrrrr<rr+)r
r;rropts     rtest_case_sensitivityz#BasicTestCase.test_case_sensitivitys4
^^

s
s
sKKM	



1o
sC!
2::c?SE"
266#sWM	O


|::
;	&FF3W%	&	


c3/0sC01
sE;'/	MCOO

c3'K
M	M	2::c?UG$
2::c?SE"
c"
2::c?B__ELL"
$%	2::k"XJ/
266+x(*CD__006tq7I0J',Wo7	


i785	&	&s JJc	|j}i|d<ddi|d<i|d<|Dcgc]}|}}|j|j}|j}||t	dd|j
dg||dj
dh||dddd|jt5d|dd<ddd|jd|dvd|dd<d	D]}|j||dvd
||dj
dh||dj
dh|dd=||dj
i|jdj|jd
}||dj
dh||ddd|jdj|jd
ddi}|jd|dvycc}w#1swY@xYw)NrrrWrrrrrrrrrrrrrrrrrrr)
r7rsruassertCountEqualr	r1rr~rrr<rr+)r
r;rrrelem_eqrs       r$test_case_sensitivity_mapping_accessz2BasicTestCase.test_case_sensitivity_mapping_accesss!
^^
3.33$&'W''	


''
1fc3 4 4c:;<
2c7<<>C5!
2c73<M	O


x
(	#"BsGCL	#	
r#w'$3/	MCOOr#wK
M	M	2c7<<>E7#
2c7<<>C5!sGCL3#__ELL"
$%	2k?!H:.
2k?8$&?@__006tq7I0J',Wo7	
I./C
(	#	#s	G;9	HH
c|jddi}|j|j|jddd|jddi}|j|j|jdddy)NrQBarFoorz<could not locate option, expecting case-insensitive defaults)r7ruryr1r
r;s  rtest_default_case_sensitivityz+BasicTestCase.test_default_case_sensitivity	sx
^^UEN
+FF4''/N	P^^UEN
+FF4''/J	Lrch|j}|j|tjdj	|j
d|j|tjdj	|j
d|j|tjd}|j|jd|js|j|tjd}|j|jdtjd}|j
dd	k(rtj}|f}ntj}|dd
f}t|d5}|j|||}ddd|j|j|yy#1swY'xYw)
Nz[Foo]
{}val-without-opt-name
rrNo Section!
)<???>rrz[Foo]
  wrong-indent
)rcfgparser.3r$z.  # INI with as many tricky parts as possible
utf-8encoding)
r7parse_errorr=ParsingErrorrr+MissingSectionHeaderErrorrurr*rfindfileopen)r
r;etrickyerrorexpectedfs       rtest_parse_errorszBasicTestCase.test_parse_errorss|
^^
\6644:F4??1;M4N	P	
\6644:F4??1;M4N	P
R!G!G,
.!>?""  \%>%> 9;AQVVZ0%%m4Fq!S($11"9$>>"AMOfw/
31$$R2
3QVVX.#
3
3s.F((F1ct|dr|}ntj|}|j|5}|j	|ddd|j
S#1swYj
SxYw)Nreadline)hasattrioStringIOr~	read_filer)r
r;excsrcsiors      rrzBasicTestCase.parse_error/s_3
#C++c"C


s
#	rLL	||	||sAA0c|j}|j|jgd|j|j	dd|jtj5|jdddd|jtj5|jdddddd|j|tjdd}|j|jd|jd|j|tjdd}|j|jdy#1swYxYw#1swYxYw)	Nz0new ConfigParser should have no defined sectionsrz5new ConfigParser should have no acknowledged sectionsrQbarrW)rQ)rrQ)r7rurtrhas_sectionr~r=rrr	get_errorrrrr
r;rs   rtest_query_errorszBasicTestCase.test_query_errors8s 
^^
K	M.$	%

|::
;	JJu	


|::
;	*FF5%)	*NN2|::E5I*
uNN2|995%H0			*	*s2E+E!E!E*c	|j|||jd|jd|jy#|$r}|cYd}~Sd}~wwxYw)Nzexpected exception type .)ryfailrr)r
r;rrrrs      rrzBasicTestCase.get_errorIsN	<FF7F#
II)9)9;
<	H	sAAAAAc\|jdj|jd}tddD]o}|j	|jdd|z|j
|jdd|z|jt|j
dd	|zqy)
Nz[BOOLTEST]
T1{equals}1
T2{equals}TRUE
T3{equals}True
T4{equals}oN
T5{equals}yes
F1{equals}0
F2{equals}FALSE
F3{equals}False
F4{equals}oFF
F5{equals}nO
E1{equals}2
E2{equals}foo
E3{equals}-1
E4{equals}0.1
E5{equals}FALSE AND MORErequalsrBOOLTESTzt%dzf%dze%d)	r<rr+rangerr}rr~r)r
r;xs   rtest_booleanzBasicTestCase.test_booleanRs
__
'(.vT__Q5Gv'H!$q!	DAOOBMM*eai@AR]]:uqyABj mmZ
D	Drc	|j}|jd|jtj5}|jddddj
}|j
t|d|j
|jd|jr0|jtj5}|jtjdj|jddddd|j
}|j
t|d	|j
|jd
|jtj5}|j!ddd
diddd|j
}|j
t|d|j
|jdyy#1swYxYw#1swYxYw#1swYgxYw)NrzSection 'Foo' already exists)rNNz                    [Foo]
                    will this be added{equals}True
                    [Bar]
                    what about this{equals}True
                    [Foo]
                    oops{equals}this won't
                rr	<foo-bar>sourcezFWhile reading from '<foo-bar>' [line  5]: section 'Foo' already exists)rrrrvalzis really `opt`)rOPTzIWhile reading from '<dict>': option 'opt' in section 'Bar' already exists)rrz<dict>N)r7rr~r=rrrustrrr0r9rrrr+rr)r
r;rrs    rtest_weird_errorszBasicTestCase.test_weird_errorsks
^^

u


|AA
B	"bNN5!	"LLQ!?@!45;;""<#E#EF
L"x0F$//!"4F5 7@KL
LASV&O
PQVV%<=""<#D#DE
PeU;L%MNO
PASV&M
NQVV%CD)
	"	"
L
L
P
Ps%G
AG)8G5G&)G25G>cdj|j|jd|j}|jr|dz
}|j|}dD]}t
j}|j|||jd}|rdj|}dj||j	}|jr|d
z
}|j|j|y)Na8[Long Line]
foo{0[0]} this line is much, much longer than my editor
   likes it.
[{default_section}]
foo{0[1]} another very
 long line
[Long Line - With Comments!]
test {0[1]} we        {comment} can
            also      {comment} place
            comments  {comment} in
            multiline {comment} values
r)commentr1z![Valueless]
option-without-value
)TF)space_around_delimitersz {} z[{default_section}]
foo{equals}another very
	long line

[Long Line]
foo{equals}this line is much, much longer than my editor
	likes it.

[Long Line - With Comments!]
test{equals}we
	also
	comments
	multiline

)rr1z"[Valueless]
option-without-value

)rr+r,r1r*r<rrwriterugetvalue)r
rr;routput	delimiter
expect_strings       r
test_writezBasicTestCase.test_writes
1F1Fq1I(,(<(<>	
%
M
__]
+'4	?#[[]FHHV5LHM*I&"MM)4	
V9,0,@,@B
"""

V__.
>;	?rcz|jdj|jd}Gddt}|j	ddd|j	dd|d|j	dd	d|j	dd	|d|j	ddd|j	dd	dy)
N[sect]
option1{eq}foo
rrceZdZy)2BasicTestCase.test_set_string_types.<locals>.mystrN)rrrr!rrmystrrsrrsectoption1splatoption2)r<rr+rr)r
r;rs   rtest_set_string_typesz#BasicTestCase.test_set_string_typess
__006$//!:L0MO	C	
vy'*
vy%.1
vy'*
vy%.1
vy'*
vy'*rc`|jddk7r|jdtjd}|j	}|j|dgd}|j
||g|j
|jdd	d
|j	}|j|d}|j
||g|j
|jdd	d
|j	}|jtj|d}|j
||g|j
|jdd	d
|j	}|jtj||gd}|j
|||g|j
|jdd	d
|j	}|jdgd}|j
|g|j	}|jgd}|j
|gy)Nrr$incompatible formatcfgparser.1nonexistent-filerrrErQnewbar)
r+skipTestrrr7readrurypathlibPath)r
file1r;parsed_filess    rtest_read_returns_file_listz)BasicTestCase.test_read_returns_file_lists??1$MM/0  /
^^
ww'9:WwMw/	518<
^^
wwuww7w/	518<
^^
www||E2WwEw/	518<
^^
wwU 3U;gwNu~6	518<
^^
ww 23gwFr*
^^
wwrGw4r*rc|jddk7r|jdtjdj	}|j}|j
|d}|j||g|j}|j
dd}|j|g|j}|j
|dgd}|j||gy)Nrr$rrrrsnonexistent-file)r+rrrencoder7rru)r
file1_bytestringr;rs    r0test_read_returns_file_list_with_bytestring_pathz>BasicTestCase.test_read_returns_file_list_with_bytestring_paths??1$MM/0"++M:AAC
^^
ww/'wB(8'9:
^^
ww2WwEr*
^^
ww 02EFQXwY(8'9:rc^|jdj|jdS)Nah[Foo]
bar{equals}something %(with1)s interpolation (1 step)
bar9{equals}something %(with9)s lots of interpolation (9 steps)
bar10{equals}something %(with10)s lots of interpolation (10 steps)
bar11{equals}something %(with11)s lots of interpolation (11 steps)
with11{equals}%(with10)s
with10{equals}%(with9)s
with9{equals}%(with8)s
with8{equals}%(With7)s
with7{equals}%(WITH6)s
with6{equals}%(with5)s
With5{equals}%(with4)s
WITH4{equals}%(with3)s
with3{equals}%(with2)s
with2{equals}%(with1)s
with1{equals}with

[Mutual Recursion]
foo{equals}%(bar)s
bar{equals}%(foo)s

[Interpolation Error]
name{equals}%(reference)s
rr)r<rr+rs rget_interpolation_configz&BasicTestCase.get_interpolation_configs1
*.+1&8J&*K1M	Mrcj|jdj|jddi}t|j	dddi}|j|j
|||jtj5|j	ddddy#1swYyxYw)	Nz
            [section]
            name {0[0]} %(value)s
            key{0[1]} |%(name)s|
            getdefault{0[1]} |%(default)s|
        default	<default>rrrWrgzno such section)
r<rr+rvrrsrur~r=r)r
rr;rs    rcheck_items_configz BasicTestCase.check_items_configs
__

F4??#y+.FH
)7G*<=>	H%


|::
;	(HH&'	(	(	(sB))B2c|jdj|jddi}|j|j	dd|j|j	dd|j|j	dd|jt5|j	dddy#1swYyxYw)	N
            [section1]
            name1 {0[0]} value1
            [section2]
            name2 {0[0]} value2
            [section3]
            name3 {0[0]} value3
        r(r)rrsection1section2section3)r<rr+rupopitemr~rrs  rtest_popitemzBasicTestCase.test_popitem)s
__
F4??#y+.FH	
a*5a*5a*5


x
(	JJL			s-CCc"|jddi}|j|j|jdddddd|d<|j|j	dg|jt|dj
hd	|j|jt|j	t|jt||jj
dhy)
NrQrrrvalue1r)rrzing>rQrr)r7ruryr1rtrrclearrs  r
test_clearzBasicTestCase.test_clear8s
^^UEN
+FF4''/N	P"*h?6
1RZ__./1NO

R[[]+SU3R 4 45::<=wGrc:|jdj|jddi}|jt	|djddh|jt	|djd	dh|jt	|d
jddh|j|ddd|j|dd	d
|j|d
dd|j|j
gdddi|d<|jt	|djddh|j|ddd|jd	|d|j|j
gdi|d
<|jt	|d
jdh|jd|d
|j|j
gd||j||j<|jt	||jjt	i||j<|jt	||jjt	|jt	|djdh|jt	|djdh|jt	|d
jt	|j|j
gd|d|d<|jt	|djdhy)Nr,nameDvalueDrr-name1namedr.name2r/name3r3rvalue3)r-r.r/name22value22)
r<rr+rurrrtassertNotInr1assertNotEqualrs  rtest_setitemzBasicTestCase.test_setitemDs
__
F4??#w.AC	
R
^0023gw5GHR
^0023gw5GHR
^0023gw5GHJ0(;J0(;J0(;(LM"I.:R
^0023h5HIJ19="Z.1(LM:R
^0023gY?"Z.1(LM#%d&:&:#;4 C4#7#7 8 = = ?@#%H#%4 R 4 45::<=suER
^0023gY?R
^0023hZ@R
^0023SU;(LMJ:R
^0023hZ@rc|jr|jdtjdj	|j
d}|j
}|jtj5|j|ddd|j|jddd|j|dddy#1swYDxYw)Nz2if no_value is allowed, ParsingError is not raisedzC            [DEFAULT]
            test {0} test
            invalidrDEFAULTtest)
r*rrrrr+r7r~r=rr9rury)r
invalidr;s   rtest_invalid_multiline_valuez*BasicTestCase.test_invalid_multiline_valuejsMMNO//#vdooa01

^^



|88
9	$NN7#	$	62F;Iv.7	$	$s>CCN)rrrrrrrrrrrrrrrr	rr r$r&r*r1r6rCrHr!rrrBrBFs[-@A*FJX'9T&0PL/81"<D2E>4?l++B;$M6(

H$AL
8rrBc(eZdZejZdZy)StrictTestCaseTN)rrrr=RawConfigParserr4r0r!rrrJrJzs//L
FrrJcTeZdZejZdZdZdZdZ	dZ
dZdZdZ
y	)
ConfigParserTestCasec|j}|j}||jddd||jddd||jddd|j|tj
dd}|jtjk(r|j|jd	yt|jtjr|j|jd	yy)
Nrrz%something with interpolation (1 step)bar9z.something with lots of interpolation (9 steps)bar10z/something with lots of interpolation (10 steps)bar11)rQr5something %(with11)s lots of interpolation (11 steps))r&ruryrr=InterpolationDepthErrorr2r@r
isinstanceLegacyInterpolation)r
r;rrs    rtest_interpolationz'ConfigParserTestCase.test_interpolations

*
*
,



266%!HI
266% ;	=
266%!<	>NN2|CCUGT!4!44QVV&I
J
**L,L,L
MQVV&I
JNrc|j}|j|tjdd}|j	|j
d|j	|jd|j	|jd|jtjk(r|j	|jdyt|jtjr|j	|jdyy)NInterpolation Errorrx	reference)rxrXz
%(reference)srY)
r&rr=InterpolationMissingOptionErrorrurYrrr2r@rrTrUrs   r test_interpolation_missing_valuez5ConfigParserTestCase.test_interpolation_missing_values

*
*
,NN2|KK0&
:k2$9:6*!4!44QVV&B
C
**L,L,L
MQVV&B
CNrc*|jgdy)N)r(r))
getdefaultz|<default>|)rz|value|)rxrWr*rs r
test_itemszConfigParserTestCase.test_itemss!4	5rc|jdj|jd}|j|j	ddd|j
tjk(r#|j|j	dddyt|j
tjr1|jt5|j	dddddyy#1swYyxYw)	Nzc[section]
option1{eq}xxx
option2{eq}%(option1)s/xxx
ok{eq}%(option1)s/%%s
not_ok{eq}%(option2)s/%%srrrokzxxx/%snot_okz
xxx/xxx/%s)r<rr+ruryr2r=r@rTrUr~	TypeErrorrs  rtest_safe_interpolationz,ConfigParserTestCase.test_safe_interpolations
__9:@$(OOA$6:@:8	9	
	40(;!4!44RVVIx8,G
**L,L,L
M""9-
,y(+
,
,N
,
,s
C''C0c$|jdj|jd}|j|j	ddd|jt|jddd|jt|jddd|jt|jddd	|j|j	ddd|jdd
d|j|j	dd
dy)
NrrrrrrQ%foofoo%f%oorfoo%%barzfoo%bar)r<rr+ruryr~rrrs  r#test_set_malformatted_interpolationz8ConfigParserTestCase.test_set_malformatted_interpolations
__006$//!:L0MO	
	2E:*bfffiH*bfffiH*bfffiH	2E:	vy*-	2I>rc|jdj|jd}|jt|j
ddd|jt|j
ddd|jt|j
ddt
|jt|j
ddd|jt|j
ddd|jt|j
ddt
|jt|j
dd	d
|jt|jd	y)Nrrrrrrg?rrzinvalid opt name!)r<rr+r~rdrobjectrrs  rtest_set_nonstring_typesz-ConfigParserTestCase.test_set_nonstring_typess
__006$//!:L0MO	
)RVVVYB)RVVVYD)RVVVYI)RVVVYB)RVVVYD)RVVVYI)RVVVS:MN)R^^S9rcz|j}|jt|j|jyr)r7r~rrr1rs  rtest_add_section_defaultz-ConfigParserTestCase.test_add_section_defaults*
^^
*bnnd6J6JKrc|jddi}|j||jdd|j||jj	dd|jddi}|j||jdd	|j||jj	ddy
)zbpo-23835 fix for ConfigParserr333333@rrmz2.4r@rz5.2N)r7rur1r{r|rs  rtest_defaults_keywordz*ConfigParserTestCase.test_defaults_keywords
^^aX^
.D001#6>r$"6"67@@EsK
^^c3Z^
0D001#6>r$"6"67@@EsKrN)rrrr=ConfigParserr4rVr[r`rerkrnrprtr!rrrMrMs9,,LJ C5
,? :LLrrMceZdZejZdZejdjZ
dZdZdZ
dZy)#ConfigParserTestCaseNoInterpolationNz
        [numbers]
        one = 1
        two = %(one)s * 2
        three = ${common:one} * 3

        [hexen]
        sixteen = ${numbers:two} * 8
    c|j|ddd|j|ddd|j|ddd|j|dd	d
y)Nnumbersonermtwoz%(one)s * 2threez${common:one} * 3hexensixteenz${numbers:two} * 8)rurs  rassertMatchesIniz4ConfigParserTestCaseNoInterpolation.assertMatchesInishIu-s3Iu-}=Iw/1DEGY/1EFrc\|j|j}|j|yr)r<inirrs  rtest_no_interpolationz9ConfigParserTestCaseNoInterpolation.test_no_interpolations"
__TXX
&b!rcd|j}|j|jdyN)r7assertIsNoner9rs  rtest_empty_casez3ConfigParserTestCaseNoInterpolation.test_empty_cases%
^^
"..,-rcGddtj}|}|j|j|j	|y)NceZdZdZy)bConfigParserTestCaseNoInterpolation.test_none_as_default_interpolation.<locals>.CustomConfigParserN)rrr_DEFAULT_INTERPOLATIONr!rrCustomConfigParserrs%)"rr)r=rur9rr)r
rr;s   r"test_none_as_default_interpolationzFConfigParserTestCaseNoInterpolation.test_none_as_default_interpolations<	*!:!:	* 
!
txx b!r)rrrr=rur4r2rrstriprrrrrr!rrrwrwsH,,LM
(//	
G"."rrwceZdZejZej5ejde	ejZddddZy#1swYdZyxYw)'ConfigParserTestCaseLegacyInterpolationignoreNcL|jdj|jd}|j|j	ddd|jddd|j|j	ddd|jddd|j|j	ddd|jddd	|j|j	ddd	|jdd
d|j|j	dd
dy)NrrrrrrQrgrhrirrj)r<rr+ruryrrs  rrkzKConfigParserTestCaseLegacyInterpolation.test_set_malformatted_interpolations
__006$//!:L0MO	
	2E:
vy&)	2F;
vy&)	2F;
vy&)	2F;	vy*-	2J?r)
rrrr=rur4warningscatch_warningssimplefilterDeprecationWarningrUr2rkr!rrrrsZ,,L	 	 	 	";h(:;888:
;@	;@s%AArceZdZdZy),ConfigParserTestCaseInvalidInterpolationTypectjddfD]Q}|j|5|jt5tj
|ddddddSy#1swYxYw#1swYjxYw)Nr[za string)rWr2)r=ExtendedInterpolationsubTestr~rdru)r
rWs  r*test_error_on_wrong_type_for_interpolationzWConfigParserTestCaseInvalidInterpolationType.test_error_on_wrong_type_for_interpolations"882
K	CEE*
C&&y1C --EBC
C
C	CCC
C
Cs"A5A)A5)A2.A55A>	N)rrrrr!rrrrsCrrceZdZdZdZdZy))ConfigParserTestCaseNonStandardDelimitersz:=$//"Nrrrr+r,r-r!rrrr%J")rrceZdZdZy)-ConfigParserTestCaseNonStandardDefaultSectiongeneralN)rrrr1r!rrrr+sOrrcZeZdZejZdj
ddZdZdZ	dZ
y)MultilineValuesTestCasezSI'm having spam spam spam spam spam spam spam beaked beans spam spam spam and spam! 	
c|j}tdD]`}dj|}|j|tdD].}|j	|dj||j
0bt
tjdd5}|j|dddy#1swYyxYw)Ndz	section{}
z
lovely_spam{}wrr)
r7rrrrwonderful_spamrrTESTFNr)r
r;rsjrs      rsetUpzMultilineValuesTestCase.setUp5s
^^
s	JA""1%ANN12Y
Jq/003T5H5HI
J	J
)""C'
:	aHHQK			sB66B?cJtjtjyr)osunlinkrrrs rtearDownz MultilineValuesTestCase.tearDown?s
		)""#rc|j}ttjd5}|j	|ddd|j|j
dd|jjddy#1swYFxYw)Nrrsection8lovely_spam4r
)	r7rrrrruryrreplace)r
cf_from_filers   r test_dominating_multiline_valuesz8MultilineValuesTestCase.test_dominating_multiline_valuesBsy~~'
)""W
5	&""1%	&))*nE,,44VTB	D	&	&sBBN)rrrr=rur4rrrrrr!rrrr/s3,,L,-4WS&-A$Drrc<eZdZejZdZdZdZdZ	y)RawConfigParserTestCasec|j}|j}||jddd||jddd||jddd||jddd	y)
Nrrz*something %(with1)s interpolation (1 step)rOz3something %(with9)s lots of interpolation (9 steps)rPz5something %(with10)s lots of interpolation (10 steps)rQrR)r&ruryr
r;rs   rrVz*RawConfigParserTestCase.test_interpolationOs~

*
*
,



266%7	9
266% @	B
266%!B	D
266%!B	Drc*|jgdy)N)r])r^z
|%(default)s|)rz
|%(name)s|)rxz	%(value)sr_rs rr`z"RawConfigParserTestCase.test_items[s!8	9rc|j}|jd|jddd|jddgd|jddddi|j|j	ddd|j|j	ddgd|j|j	ddddi|jd	|jd	d
d|j|j	d	d
d|j
tjur>d|_|jddd|j|j	dddyy)
Nz
non-stringrZrrv)rrrr
r3pign!	@rzthis is sickTc|Srr!)rs r<lambda>zBRawConfigParserTestCase.test_set_nonstring_types.<locals>.<lambda>qsqr)	r7rrrury_dictr=r>optionxformrs  rrnz0RawConfigParserTestCase.test_set_nonstring_typesas)
^^

|$
|UA&
|V%>?
|VdG_5e4a8f52	4f5gG
s
sND)^4d;
88|111)BNFF<A&RVVL!4a82rc:|jt5}|jddidddj}|j	t|d|jddi}|j
||jddy#1swYgxYw)	z-bpo-23835 legacy behavior for RawConfigParserrrrrNz%'int' object has no attribute 'lower'rrsr)r~rr7rrurr{r1)r
ctxerrr;s    rrtz-RawConfigParserTestCase.test_defaults_keywordus


~
.	.#NNQHN-	.mmS#JK
^^c3Z^
0r$"6"67<cB	.	.sBBN)
rrrr=rKr4rVr`rnrtr!rrrrLs#//L
D99(CrrceZdZdZdZdZy),RawConfigParserTestCaseNonStandardDelimitersrrNrr!rrrrrrrc6eZdZejZdZdZdZdZ	y)RawConfigParserTestSambaConf)r'r&z----)rFctjd}|j}|j|dgd}|j	||ggd}|j	|j||j	|j
ddd|j	|jdd	d
|j	|j
ddd|j	|j
d
ddy)Nzcfgparser.2rrr)globalhomesprinterszprint$z
pdf-generatortmpAgustinr	workgroupMDKGROUPzmax log size2zhosts allowz127.rzecho commandz
cat %s; rm %s)rrr7rrurtryrz)r
smbconfr;rrts     rtest_readingz)RawConfigParserTestSambaConf.test_readings""=1
^^
ww);<wwOy1A1+6
C8^<bA-8&A~6HrN)
rrrr=rKr4r,r-r.rr!rrrrs%//L)%!IrrczeZdZejZejZdZdZ	ddZ
dZdZdZ
dZd	Zd
Zy))ConfigParserTestCaseExtendedInterpolationcommonTNc\|j|}|r||_|j||Sr)r7rr9)r
r:r)rr;s     rr<z4ConfigParserTestCaseExtendedInterpolation.fromstrings+
^^H
%(BN
v	rc~|jtjdj}|j}||ddd||ddd||ddd||ddd||ddd	||dd
d||ddd
||ddd||ddd||ddd||ddd||ddd||ddd||ddd||ddd||dd
d||dddy)Na
            [common]
            favourite Beatle = Paul
            favourite color = green

            [tom]
            favourite band = ${favourite color} day
            favourite pope = John ${favourite Beatle} II
            sequel = ${favourite pope}I

            [ambv]
            favourite Beatle = George
            son of Edward VII = ${favourite Beatle} V
            son of George V = ${son of Edward VII}I

            [stanley]
            favourite Beatle = ${ambv:favourite Beatle}
            favourite pope = ${tom:favourite pope}
            favourite color = black
            favourite state of mind = paranoid
            favourite movie = soylent ${common:favourite color}
            favourite song = ${favourite color} sabbath - ${favourite state of mind}
        rzfavourite BeatlePaulzfavourite colorgreentomzfavourite bandz	green dayzfavourite popezJohn Paul IIsequelz
John Paul IIIambvGeorgezson of Edward VIIzGeorge Vzson of George Vz	George VIstanleyblackzfavourite state of mindparanoidzfavourite moviez
soylent greenzfavourite songzblack sabbath - paranoid)r<rrrrurs   rtest_extended_interpolationzEConfigParserTestCaseExtendedInterpolation.test_extended_interpolations
__X__.
,UW-0


2h<*+V4
2h<)*G4
2e9'(&1
2e9&'1
2e9%&4
2e9%&7
2e9X0
2f:()84
2f:'('2
2f:)*J7
2f:'(+6
2i=+,h7
2i=*+W5
2i=23Z@
2i=*+_=
2i=)*N;
2i=)*%	'rcX|jtjdj}|j	t
j5|ddddd|j	t
j5|dddddy#1swY:xYw#1swYyxYw)Nz
            [one for you]
            ping = ${one for me:pong}

            [one for me]
            pong = ${one for you:ping}

            [selfish]
            me = ${me}
        zone for youpingselfishme)r<rrrr~r=rSrs  rtest_endless_loopz;ConfigParserTestCaseExtendedInterpolation.test_endless_loops
__X__	.	
UW	

|CC
D	&}f%	&


|CC
D	 yM$	 	 	&	&	 	 s	B	B B B)c|jd}|j|ddd|j|ddd|j|dddtj}|j	|5}|dd	ddd|jj
jd
|j|j
jddy#1swYYxYw)
Nz
            [dollars]
            $var = $$value
            $var2 = ${$var}
            ${sick} = cannot interpolate me

            [interpolated]
            $other = ${dollars:$var}
            $trying = ${dollars:${sick}}
        dollarsz$varz$valueinterpolatedz$otherz${sick}zcannot interpolate mez$tryingzdollars:${sickrz${dollars:${sick}})r<rur=rZr~rrYr)r
r;exception_classrs    rtest_strange_optionsz>ConfigParserTestCaseExtendedInterpolation.test_strange_optionss
__		
	
Iv.9N+H5x@Iy13JK&FF



/	*2~y)	*//1AB**1-/CD	*	*s;	CC%c8tjdj}|j|}|j}||ddd||ddd||ddd||ddd	||d
dd||d
d
dy)Naj
            [common]
            optionlower = value
            OptionUpper = Value

            [Common]
            optionlower = a better ${common:optionlower}
            OptionUpper = A Better ${common:OptionUpper}

            [random]
            foolower = ${common:optionlower} redefined
            FooUpper = ${Common:OptionUpper} Redefined
        roptionlowerrWOptionUpperValueCommona better valueA Better Valuerandomfoolowervalue redefinedFooUpperA Better Value Redefined)rrrr<rur
rr;rs    rtest_case_sensitivity_basiczEConfigParserTestCaseExtendedInterpolation.test_case_sensitivity_basicsoo
UW	__S
!



2h<
&0
2h<
&0
2h<
&(89
2h<
&(89
2h<
#%67
2h<
#%?@rctjdj}|jtj
5|j
|}ddd|j
|d}|j}||ddd||ddd||d	dd
||d	dd||dd
d||dddy#1swYxYw)Na8
            [common]
            option = value
            Option = Value

            [Common]
            option = a better ${common:option}
            Option = A Better ${common:Option}

            [random]
            foo = ${common:option} redefined
            Foo = ${Common:Option} Redefined
        c|Srr!)rs rrz[ConfigParserTestCaseExtendedInterpolation.test_case_sensitivity_conflicts.<locals>.<lambda>#s#r)rrrrWrrrrrrrQrrr)rrrr~r=rr<rurs    rtest_case_sensitivity_conflictszIConfigParserTestCaseExtendedInterpolation.test_case_sensitivity_conflictssoo
UW	

|@@
A	&%B	&__So_
>



2h<!7+
2h<!7+
2h<!#34
2h<!#34
2h< 12
2h< :;	&	&sCC!c|jd}|jtj5|ddddd|jtj5|ddddd|jtj5|ddddd|jtj5|ddddd|jtj5|ddddd|jt
5d|dd	<dddy#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swY`xYw#1swYyxYw)
Na
            [interpolation fail]
            case1 = ${where's the brace
            case2 = ${does_not_exist}
            case3 = ${wrong_section:wrong_value}
            case4 = ${i:like:colon:characters}
            case5 = $100 for Fail No 5!
        zinterpolation failcase1case2case3case4case5z
BLACK $ABBATHcase6)r<r~r=InterpolationSyntaxErrorrZrrs  rtest_other_errorsz;ConfigParserTestCaseExtendedInterpolation.test_other_errors,sg
__


|DD
E	.#$W-	.


|KK
L	.#$W-	.


|KK
L	.#$W-	.


|DD
E	.#$W-	.


|DD
E	.#$W-	.


z
*	@0?B#$W-	@	@	.	.	.	.	.	.	.	.	.	.	@	@sG	D)!	D5	E	E
1	E	E%)D25D>E

EE"%E.)NN)rrrr=rur4rr2r1r0r<rrrr	rrr!rrrrsN,,L6L668MO
F+'Z "E*A0<6@rrceZdZdZy)ConfigParserTestCaseNoValueTN)rrrr*r!rrrrDsNrrc@eZdZejZdhZdhZdZdZ	dZ
y)ConfigParserTestCaseTrickyFiler$r'Tctjd}|j}|jt	|j|dd|j|j
gd|j|j|jdddi	d
|jt5|j|jddddiddd|jt	|jd
djdd|jt	|jddjddd}|j|j|d|j|j|dd|jt	|jdd|jt j"5|jdddd|j|jddd|j|jdd|jdd|j|jdddy#1swYxYw#1swYxYw) Nrrrr)strange
corruption&yeah, sections can be indented as wellanother one!no values heretricky interpolationmore interpolationgointerpolatez-1rgT)rawrhrotherrrrWrrzare they subsectionszlets use some Unicodeu	片仮名rrrr letszdo thisr!zgo shopping)rrr7rurwrrtrzr1r~rrysplitrr}rr=rZ)r
rr;longnames    rtest_cfgparser_dot_3z3ConfigParserTestCaseTrickyFile.test_cfgparser_dot_3Ns$!!-0
^^
RWWVgW>?C)?	@	
4#7#7)6(=#?@B	D


z
*	2IId**Dd)40

2	2	
RVVIw7==dCDaHRVVL':@@FGL;x1GHI*ABKPRXXn56:


|KK
L	'HH%&	' 6?K 6? 6=	? 4f=}M!	2	2	'	's9"I6%J6JJctjd}|j}|jt5|j|ddddy#1swYyxYw)Nrasciir)rrr7r~UnicodeDecodeErrorr)r
rr;s   rtest_unicode_failurez3ConfigParserTestCaseTrickyFile.test_unicode_failurensR!!-0
^^



1
2	.GGFWG-	.	.	.sAA!N)rrrr=rur4r+r,r*r+r/r!rrrrHs-,,LJuNN@.rrc&eZdZdZdZdZdZdZy)Issue7005TestCasezrTest output when None is set() as a value and allow_no_value == False.

    http://bugs.python.org/issue7005

    z[section]
option = None

c|d}|jd|jdddtj}|j	||jSNF)r*rr)rrrrrr)r
r4cprs    rpreparezIssue7005TestCase.prepare~sJ

/
y!
y(D)kkm

||~rctjd}|jd|jt5|jddddddy#1swYyxYwr3)r=rurr~rdr)r
r4s  rtest_none_as_value_stringifiedz0Issue7005TestCase.test_none_as_value_stringifiedsQ

&
&e
<
y!


y
)	.FF9h-	.	.	.sAA#cz|jtj}|j||jyr)r5r=rKruexpected_output)r
rs  r"test_none_as_value_stringified_rawz4Issue7005TestCase.test_none_as_value_stringified_raws,l::;!5!56rN)rrr__doc__r9r5r7r:r!rrr1r1us5O.7rr1ceZdZeZdZy)SortedTestCasec|jd}tj}|j||j	|jdy)Nz [b]
o4=1
o3=2
o2=3
o1=4
[a]
k=v
z,[a]
k = v

[b]
o1 = 4
o2 = 3
o3 = 2
o4 = 1

)r<rrrrur)r
r;rs   rtest_sortedzSortedTestCase.test_sortedsJ
__%&
*&	'rN)rrrrr/r?r!rrr=r=sI'rr=c2eZdZejZdZdZdZy)CompatibleTestCasez#;r&ctjd}|j|}|j|j	ddd|j|j	ddd|j|j	dddy)	Nz        [Commented Bar]
        baz=qwe ; a comment
        foo: bar # not a comment!
        # but this is a comment
        ; another comment
        quirk: this;is not a comment
        ; a space must precede an inline comment
        rDrQzbar # not a comment!rOrPquirkzthis;is not a comment)rrr<ruryrs   rtest_comment_handlingz(CompatibleTestCase.test_comment_handlings| )

__]
+7/	17?90	2rN)	rrrr=rKr4r,r-rDr!rrrArAs//L!2rrAc,eZdZejZddZy)CopyTestCaseNcL|j|}|j||j}|j||jD]M}|j|j
k(r||j
j
D]\}}|||k(s||=O|Sr)r7r9rrrxr1r)r
r:r)r;cf_copyrr(rWs        rr<zCopyTestCase.fromstrings
^^H
%
v..""~~'	)G||t333"$T%9%9":"@"@"B
)7#u,(
)	)rr)rrrr=rur4r<r!rrrFrFs,,L
rrFceZdZdZdZy)FakeFilectjd}t|d5}|j|_|jjdddy#1swYyxYw)Nrrr)rrr	readlineslinesreverse)r
	file_pathrs   r__init__zFakeFile.__init__sP$$]3	
)g
.	!!DJJJ 	!	!	!s0AA%cbt|jr|jjSyr)rwrMpoprs rrzFakeFile.readlines!tzz?::>>##rN)rrrrPrr!rrrJrJs!rrJc#`K|j}|r||j}|ryyw)z+As advised in Doc/library/configparser.rst.N)r)rlines  rreadline_generatorrUs)::<D

zz|s)..c$eZdZdZdZdZdZy)ReadFileTestCasectjdg}	|j|djd|D]|}tj}t|d5}|j|ddd|jd||jd|d|j|ddd~y#t$rYwxYw#1swYZxYw)	Nrrutf8rrrErQr)rrrrr"UnicodeEncodeErrorr=rurrassertInru)r

file_pathsrOrrs     r	test_filezReadFileTestCase.test_files&&}56
	jm226:;$	AI!..0Fi'2
$a  #
$MM)V,MM%	!23VI.u5x@
	A"		
$
$s#B=!C=	C	C	C	c0tjdjjd}t	j
}|j
||jd||jd|d|j|dddy)Nz%
        [Foo Bar]
        foo=newbarrrErQr)	rrrr)r=rurr[ru)r
rMrs   r
test_iterablezReadFileTestCase.test_iterables!uwuuT{	**,

i(

eVI./	*518<rcttj}|jt5|j	tddd|j	t
t|jd||jd|d|j|dddy#1swYkxYw)z
Issue #11670.NrErQr)	r=rur~rdrrJrUr[rur
rs  rtest_readline_generatorz(ReadFileTestCase.test_readline_generators**,


y
)	)XZ(	)+HJ78

i(

eVI./	*518<	)	)sB..B7ctjdjjd}t	j
}|j
tj5}|j|dddd|jtjdtjdjjd}t	j
}|j
tj5}|j|dddd|jt|jdtjd	jjd}t	j
}|j
tj5}|j|dddd|jt|jd
tjdjjd}t	j
}|j
tj5}|j|dddd|jt|jdy#1swY"xYw#1swYxYw#1swYxYw#1swYUxYw)
z
Issue #18260.z"
        [badbad]
        [badbad]rsbadbadrNzGWhile reading from b'badbad' [line  2]: section 'badbad' already existsz5
        [badbad]
        bad = bad
        bad = badzWWhile reading from b'badbad' [line  3]: option 'bad' in section 'badbad' already existsz
        [badbad]
        = badz=Source contains parsing errors: b'badbad'
	[line  2]: '= bad'z"
        [badbad
        bad = badzDFile contains no section headers.
file: b'badbad', line: 1
'[badbad')rrrr)r=rur~rrrurrrrr)r
rMrdses    rtest_source_as_bytesz%ReadFileTestCase.test_source_as_bytes
sQ!UWUU4[	**,


|AA
B	6cU95	6


	

!egeeDk	**,


|@@
A	6SU95	6


&	

!%'%%+	**,


|88
9	6SU95	6

M	
!egeeDk	**,


|EE
F	6#U95	6


	
G	6	6	6	6	6	6	6	6s0&JJ'2J4KJ$'J14J=K	N)rrrr]r_rbrer!rrrWrWsA==-
rrWc:eZdZdZdZdZdZdZdZdZ	dZ
y	)
CoverageOneHundredTestCasez"Covers edge cases in the codebase.c~tjdd}|j|jd|j|jd|j|j
d|j|jd|j|jd|jt|dy)Nrr)rrNNz3Option 'option' in section 'section' already exists)	r=rrurrrlinenorrr
rs  rtest_duplicate_option_errorz6CoverageOneHundredTestCase.test_duplicate_option_error=s11)XF	2x0t,t,%FGU&6	7rctjddd}|j|jd|j|jd|j|j
dy)Nrrrawval)rrrm)r=rSrurrrrjs  rtest_interpolation_depth_errorz9CoverageOneHundredTestCase.test_interpolation_depth_errorGsV44Xy5=?%DEx0	2rcF|jt5}tjdddtjd}|j	|j
dtjd}|j	|j
dy#1swYmxYw)Nrr)r~rdr=rrur)r
rrs   rtest_parsing_errorz-CoverageOneHundredTestCase.test_parsing_errorNs{


y
)	(R%%'	()):x0))(3x0	(	(sBB ctj}|jd|jtj5}|ddddd|jt
jd|jtj5}|ddddd|jt
|jdy#1swYxYw#1swY;xYw)Nz
            [section]
            invalid_percent = %
            invalid_reference = %(()
            invalid_variable = %(does_not_exist)s
        rinvalid_percentz.'%' must be followed by '%' or '(', found: '%'invalid_referencez+bad interpolation variable reference '%(()')r=rur9r~rrurrr
rrs   rtest_interpolation_validationz8CoverageOneHundredTestCase.test_interpolation_validationVs**,	


|DD
E	19/0	1R\\*->	?


|DD
E	3912	3R\\*-?	@
	1	1	3	3s	C	CCC&c:tjd5}tjdtt	j
ddd|j
td|D]"}|j|jt$y#1swYLxYw)NT)recordalwaysr)
rrrrr=rUassertGreaterEqualrwrcategory)r
rwarnings   r$test_legacyinterpolation_deprecationz?CoverageOneHundredTestCase.test_legacyinterpolation_deprecationgs

$
$D
1	/Q!!(,>?,,.	/	
A*	@GMM'**,>?	@		/	/s/BBctj}|jd|jt	|ddy)Nz7
            [section]
            key = value
        rz<Section: section>)r=rur9rureprras  rtest_sectionproxy_reprz1CoverageOneHundredTestCase.test_sectionproxy_repros@**,	
	
fY/02FGrcNtj}ddl}|j|jd<|jd|j
d|j|j|jddd|j|jddd	|j|djdd|j|djdd	|`|jt5|jddddd|j
d|j|jd=|jd|j|jt5|jddddd|jt5|djdddd|jt5|djddddy#1swYxYw#1swYzxYw#1swYTxYw#1swYyxYw)
NrdecimalzS
            [s1]
            one = 1
            [s2]
            two = 2
        s1rzrs2r{r)r=rurDecimal
convertersr9r[ru
getdecimalr~rrA)r
rrs   r"test_inconsistent_converters_statez=CoverageOneHundredTestCase.test_inconsistent_converters_statews**,'.)$	
	


i!2!23**47;**47;007;007;


~
.	+dE*	+

i!2!23i(F$5$56


~
.	+dE*	+


~
.	+4L##E*	+


~
.	+4L##E*	+	+	+	+
	+	+	+	+	+	+s0G77H'HH7HHHH$N)rrrr;rkrnrprur|rrr!rrrgrg:s+,731@"@H+rrgcReZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZy
)ExceptionPicklingTestCasezBTests for issue #13760: ConfigParser exceptions are not picklable.cJddl}tjd}t|jdzD]o}|j||}|j
|}|j|j|j|jt|t|qy)NrrWr)
pickler=ErrorrHIGHEST_PROTOCOLdumpsloadsrumessager~r
re1protopicklede2s      r
test_errorz$ExceptionPicklingTestCase.test_errors



(622Q67	1Ell2u-Gg&BRZZ4T"XtBx0		1rcddl}tjd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|jt|t|y)Nrrr)rr=rrrrrrurrrr~rs      rtest_nosectionerrorz-ExceptionPicklingTestCase.test_nosectionerrors

(
(
3622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4T"XtBx0
	1rc0ddl}tjdd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|y)Nrrrr)
rr=rrrrrrurrrrr~rs      rtest_nooptionerrorz,ExceptionPicklingTestCase.test_nooptionerrors

'
')
<622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2T"XtBx0	1rcddl}tjddd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|y)Nrrrrr)rr=rrrrrrurrrrrir~rs      rtest_duplicatesectionerrorz4ExceptionPicklingTestCase.test_duplicatesectionerrors

/
/	8S
I622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2RYY		2T"XtBx0	1rcddl}tjdddd}t|jdzD].}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|1y)Nrrrrrr)rr=rrrrrrurrrrrrir~rs      rtest_duplicateoptionerrorz3ExceptionPicklingTestCase.test_duplicateoptionerrors

.
.y(H622Q67		1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2RYY		2RYY		2T"XtBx0		1rc2ddl}tjddd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|yNrrrmsgr)
rr=InterpolationErrorrrrrrurrrrr~rs      rtest_interpolationerrorz1ExceptionPicklingTestCase.test_interpolationerrors

,
,Xy%
H622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2T"XtBx0	1rcddl}tjdddd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|y)NrrrrmrYr)rr=rZrrrrrurrrrrYr~rs      r$test_interpolationmissingoptionerrorz>ExceptionPicklingTestCase.test_interpolationmissingoptionerrors

9
9(Ik#622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2R\\2<<8T"XtBx0	1rc2ddl}tjddd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|yr)
rr=rrrrrrurrrrr~rs      rtest_interpolationsyntaxerrorz7ExceptionPicklingTestCase.test_interpolationsyntaxerrors

2
28Y
N622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2T"XtBx0	1rc2ddl}tjddd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|y)Nrrrrmr)
rr=rSrrrrrurrrrr~rs      rtest_interpolationdeptherrorz6ExceptionPicklingTestCase.test_interpolationdeptherrors

1
1(I622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RZZ4RYY		2T"XtBx0	1rc(ddl}tjd}|jdd|jdd|jddt	|j
dzD]}|j
||}|j|}|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|tjd	}|jdd|jdd|jddt	|j
dzD]}|j
||}|j|}|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|y)
Nrrrline1rline2rline3filename)rr=rrrrrrrrurrrerrorsr~rs      rtest_parsingerrorz+ExceptionPicklingTestCase.test_parsingerrors

&
&x
0
		!W
		!W
		!W622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RYY		2RYY		2T"XtBx0	1
&
&z
2
		!W
		!W
		!W622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RYY		2RYY		2T"XtBx0	1rcddl}tjddd}t|jdzD]}|j||}|j
|}|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|jt|t|y)NrrrrTr)rr=rrrrrrurrrTrrir~rs      rtest_missingsectionheadererrorz8ExceptionPicklingTestCase.test_missingsectionheadererror!s

3
3JV
L622Q67	1Ell2u-Gg&BRZZ4RWWbgg.RWWbgg.RYY		2RYY		2T"XtBx0	1rN)rrrr;rrrrrrrrrrrr!rrrrs<L1	1
11
1
11
11161rrceZdZdZdZy)InlineCommentStrippingTestCasez}Tests for issue #14590: ConfigParser doesn't strip inline comment when
    delimiter occurs earlier without preceding space..c
tjd}|jd|d}|j|dd|j|dd|j|d	d
|j|dd|j|d
d|j|dd|j|dd|d}|j|dd|j|dd|j|d	dy)N)r&r'r)r-a
        [section]
        k1 = v1;still v1
        k2 = v2 ;a comment
        k3 = v3 ; also a comment
        k4 = v4;still v4 ;a comment
        k5 = v5;still v5 ; also a comment
        k6 = v6;still v6; and still v6 ;a comment
        k7 = v7;still v7; and still v7 ; also a comment

        [multiprefix]
        k1 = v1;still v1 #a comment ; yeah, pretty much
        k2 = v2 // this already is a comment ; continued
        k3 = v3;#//still v3# and still v3 ; a comment
        rk1zv1;still v1k2v2k3v3k4zv4;still v4k5zv5;still v5k6zv6;still v6; and still v6k7zv7;still v7; and still v7multiprefixzv3;#//still v3# and still v3)r=rur9ru)r
cfgrs   rtest_strippingz-InlineCommentStrippingTestCase.test_stripping3s	''A	

	N4-04$'4$'4-04-04"=>4"=>
4-04$'4"@ArN)rrrr;rr!rrrr/s
:Brrc.eZdZdZdZdZdZdZdZy)ExceptionContextTestCasezO Test that implementation details doesn't leak
    through raising exceptions. c*tj}|jd|jtj}|5|jddddd|j
|jjdy#1swY0xYw)Nz
        [Paths]
        home_dir: /Users
        my_dir: %(home_dir1)s/lumberjack
        my_pictures: %(my_dir)s/Pictures
        Pathsmy_dirT)	r=rur9r~rZryrr__suppress_context__rts   rtest_get_basic_interpolationz5ExceptionContextTestCase.test_get_basic_interpolationWsy**,	


|KK
L
	*JJw)	*

bll77>	*	*sB		BcRtjtj}|jd|j	tj
}|5|j
ddddd|j|jjdy#1swY0xYw)Nrz
        [Paths]
        home_dir: /Users
        my_dir: ${home_dir1}/lumberjack
        my_pictures: ${my_dir}/Pictures
        rrT)
r=rurr9r~rZryrrrrts   rtest_get_extended_interpolationz8ExceptionContextTestCase.test_get_extended_interpolationds**$::<>	


|KK
L
	*JJw)	*

bll77>	*	*sBB&c$tj}|jd|jtj5}|jdddd|j
jjdy#1swY0xYw)Nz2
        [Paths]
        home_dir: /Users
        rFT)	r=rur9r~rrrrrrts   rtest_missing_optionsz-ExceptionContextTestCase.test_missing_optionsrst**,	


|::
;	#rNN6"	#

bll77>	#	#sBBctj}|jtj5}|j	dddddd|jjjdy#1swY0xYw)NSection1an_int15T)r=rur~rrrrrr
rrs   rtest_missing_sectionz-ExceptionContextTestCase.test_missing_section|sc**,


|::
;	3rJJz8T2	3

bll77>	3	3sA77Bctj}|jtj5}|j	ddddd|jjjdy#1swY0xYw)NrrT)r=rur~rrrrrrs   rtest_remove_optionz+ExceptionContextTestCase.test_remove_optionsc**,


|::
;	7r  X6	7

bll77>	7	7sA66A?N)	rrrr;rrrrrr!rrrrSs $?????rrcBeZdZdZej
Zdfd	ZdZxZ	S)ConvertersTestCasez Introduced in 3.5, issue #18159.cHt||}d|jd<|S)Nrc|jDcgc]"}|jr|j$c}Scc}wr)r)r)vrs  rrz.ConvertersTestCase.newconfig.<locals>.<lambda>s2AGGI1?q45GGI231?1?s'=rv)superr7r)r
r)r6	__class__s   rr7zConvertersTestCase.newconfigs,7$h$7'?F#rc
|j}|jd|j|jd|j|j|jd|j|jd|j|jd|j	|jd|jt
|jd|jt5d|jd<ddd|jt5d|jd<ddd|jd	|d
}|j|dd|j|dd
|j|dd|j|dd|j|dd|j|jd
dd|j|jd
dd
|j|jd
dd|j|jd
dd|j|jd
dd|j|jd
dd|j|jd
dd|j|jd
dd|j|jd
dgd|j|jd
dd|j|jdd|j|jdd|j|jdd|j|jdgd|j|jdd|jt5|j!d
dddd|jt5|j!ddddddl}|j$|jd<|jd|j|j	|jd|jt
|jd|j%d}|j|j!d
d||j|j!d||jd=|j'd|j|jt
|jd|jt5|j!d
dddd|jt5|j!dddd|jt(5|jd=ddd|jt(5|jd=ddd|jt(5|jd=dddy#1swYxYw#1swYxYw#1swYRxYw#1swY0xYw#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYyxYw)Nr_rvrZr]r'c|Srr!rs rrz4ConvertersTestCase.test_converters.<locals>.<lambda>s1rrc|Srr!rs rrz4ConvertersTestCase.test_converters.<locals>.<lambda>sQrz~
        [s]
        str = string
        int = 1
        float = 0.5
        list = a b c d e f g
        bool = yes
        rrr:rmz0.5z
a b c d e f gboolrkrg?)rrcdrrgTrrr)r7r[rrassertIsNotNonerurwr~rr9ryrzr|getlistr}rrrrrAr)r
rrrdec0_5s     rtest_convertersz"ConvertersTestCase.test_converterssDnn

i0

fcnn-#../0#..12#..34S^^F34S^^,a0


z
*	-!,CNN2	-


z
*	/#.CNN4 	/	

H58,53'7U+6O46E*e,h7e,c2g.6f-?f-u5e,h7C/3c73S9S&14C	DV4d;ux0%!,G,c26*-<	=f-t4


~
.	)NN3(	)


~
.	"
LL!	"$+OOy!

i0S^^I67S^^,a0'W5v>g.7NN9%CNN3S^^,a0


~
.	)NN3(	)


~
.	"
LL!	"


x
(	*y)	*


x
(	#r"	#


x
(	%t$	%	%u	-	-	/	/B	)	)	"	"	)	)	"	"	*	*	#	#	%	%sl;X)X)X6YYY/Y(Y4ZX&)X36YY
YY%(Y14Y=Z	r)
rrrr;r=rur4r7r
__classcell__rs@rrrs*,,LD%rrc,eZdZdZdZdZdZdZdZy)!BlatantOverrideConvertersTestCasez}What if somebody overrode a getboolean()? We want to make sure that in
    this case the automatic converters do not kick in.z
        [one]
        one = false
        two = false
        three = long story short

        [two]
        one = false
        two = false
        three = four
    ctjdti}|j|j|j||j
|jdy)Nrw)r)r=rurwr9r	_test_lenrrr
rs  rtest_converters_at_initz9BlatantOverrideConvertersTestCase.test_converters_at_initsI''E3<@$sS^^E23rcGddtj}|}|j|j|j	||j|jd|j|jdd|j|jdd|j|jdd|j|jdd|j|jd<|j|jdd|j|jdd|j|jdd|j|jddy)NcdeZdZdZddej
dfd
Zddej
ddZxZS)OBlatantOverrideConvertersTestCase.test_inheritance.<locals>.StrangeConfigParserz0a historic borough in south central PennsylvaniaFNr%rhrfc8||k(ryt||||||S)NTr)rr})r
rrr%rhrfrs      rr}zZBlatantOverrideConvertersTestCase.test_inheritance.<locals>.StrangeConfigParser.getbooleans0f$w)'6s3;*==rc8|j||t|||S)Nr)	_get_convrw)r
rrr%rhrfs      rgetlenzVBlatantOverrideConvertersTestCase.test_inheritance.<locals>.StrangeConfigParser.getlens%~~gvs$/7&99r)	rrr
gettysburgr=r@r}rrrs@rStrangeConfigParserrs5KJ9>T!-!4!4
=6; , 3 3
9
9rrrwrzr{r_)r=rur9rrrrrr}r_convert_to_boolean)r
rrs   rtest_inheritancez2BlatantOverrideConvertersTestCase.test_inheritances)	9,";";	9"#$s#../0ue45ue45u56u56$'$;$;y!u56u56u56u56rcZ|jt|jd|jd|j|jd|j|j	d|j|j|jd|j|jd|j|jd|j|j
ddd|j|j
dd	d|j|j
dd
d|j|j
d	dd|j|j
d	d	d|j|j
d	d
d|j|j
d	dd
d
|jtj5|j
d	dddd|j|dj
dd|j|dj
d	d|j|dj
d
d|j|d	j
dd|j|d	j
d	d|j|d	j
d
d|j|d	j
dd
d
|j|d	j
ddy#1swY,xYw)Nr'r_rwtysburgrZr]rzrr{r|fourrre)
rurwrr[rArrr~r=rrs  rrz+BlatantOverrideConvertersTestCase._test_lensS^^,a0

i0

eS^^,CNN3#../0#..12#..34E5115E5115E73R8E5115E5115E73Q7E6A>B


|99
:	&JJuf%	&U**5115U**5115U**73R8U**5115U**5115U**73Q7U**615q9U**62D9	&	&s#L  L*ctjd_fd_j	|j
|j
tjd|jdj|jdj|jjd|jjd|jjd|jjdd|jjd	d	|jjdd	|jjd	djjd<|jjdd|jjd	d	|jjdd	|jjd	d|j
jddd
|j
jdd	d
|j
jddd|j
jd	dd
|j
jd	d	d
|j
jd	dd
|jt 5|j
djdd
ddd|jt 5|j
d	jdd
dddy#1swYLxYw#1swYyxYw)Ncy)NTr!)rrs  rrzLBlatantOverrideConvertersTestCase.test_instance_assignment.<locals>.<lambda>*src&t||Sr)rw)rrrs  rrzLBlatantOverrideConvertersTestCase.test_instance_assignment.<locals>.<lambda>+sSWf1E-Frrr_rwrZr]rzr{rr|rr')r=rur}rr9rrurwrr[rArrrrr~rrs @rtest_instance_assignmentz:BlatantOverrideConvertersTestCase.test_instance_assignment(s'')5F
$S^^,a0

i0/#../0#..12#..34ue45ue45ue45ue45$'$;$;y!u56u56u56u56E5115E5115E73R8E5115E5115E73Q7

~
.	:SZ..u5q9	:


~
.	:SZ..u5q9	:	:	:	:	:	:s<%M,>%M8,M58NN)	rrrr;rrrrrr!rrrrs":
F47::4:rrceZdZdZy)MiscTestCasec>tj|tdhy)Nr)not_exported)rcheck__all__r=rs rtest__all__zMiscTestCase.test__all__KsT<wiHrN)rrrr	r!rrrrJsIrr__main__)/collectionsr=rrrrunittestrrFrtest.supportrUserDictrr#rBTestCaserJrMrwrrrrrrrrrrrr1r=rArFrJrUrWrgrrrrrrrmainr!rr<module>rst		"%%.Bq8*q8h]H$5$5
_L=(*;*;_LD!"-9J9J!"H@.B@0C83D3DC*0D* 4H DmX->->D:0CmX->->0Cf*3J*I#98;L;LI(h@
x?P?Ph@V"6*.%;X=N=N*.Z7))7:','.2/1B1B2,=("3"3&

P
x((P
fW+!2!2W+tX1 1 1X1v!BX%6%6!BH3?x003?lO%(9(9O%dl:(9(9l:^I8$$I
zHMMOr