python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_htmlparser.cpython-311.opt-1.pyc

edZddlZddlZddlZGddejjZGddeZGddeZ	Gd	d
ej
ZGddeZGd
deZ
edkrejdSdS)zTests for HTMLParser.py.NcVeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
S)EventCollectorctg|_|jj|_tjjj|g|Ri|dSN)eventsappendhtmlparser
HTMLParser__init__)selfargskws   H/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_htmlparser.pyrzEventCollector.__init__
sAk(':t:::r:::::cg}d}|jD]N}|d}||cxkrdkr nnd|dd|dzf|d<n|||}O||_|S)Nrdata)rr)r
Lprevtypeeventtypes     r
get_eventszEventCollector.get_eventss
[		E8Dx))))6)))))2qE!H!45"HHrc6|d||fdS)Nstarttagrr
tagattrss   rhandle_starttagzEventCollector.handle_starttag s!Ze,-----rc6|d||fdS)Nstartendtagrrs   rhandle_startendtagz!EventCollector.handle_startendtag#s!]C/00000rc4|d|fdS)Nendtagr)r
rs  r
handle_endtagzEventCollector.handle_endtag&sXsO$$$$$rc4|d|fdS)Ncommentrr
rs  rhandle_commentzEventCollector.handle_comment+Y%&&&&&rc4|d|fdS)Ncharrefrr*s  rhandle_charrefzEventCollector.handle_charref.r,rc4|d|fdS)Nrrr*s  rhandle_datazEventCollector.handle_data1VTN#####rc4|d|fdS)Ndeclrr*s  rhandle_declzEventCollector.handle_decl4r2rc4|d|fdS)N	entityrefrr*s  rhandle_entityrefzEventCollector.handle_entityref7s[$'(((((rc4|d|fdS)Npirr*s  r	handle_pizEventCollector.handle_pi:sT4L!!!!!rc4|d|fdS)Nunknown declr)r
r4s  runknown_declzEventCollector.unknown_decl=s^T*+++++rN)__name__
__module____qualname__rrr!r$r'r+r/r1r5r8r;r>rrrrs;;;



"...111%%%
''''''$$$$$$)))""",,,,,rrceZdZdZdS)EventCollectorExtract||||d|fdS)N
starttag_text)rr!rget_starttag_textrs   rr!z#EventCollectorExtra.handle_starttagCsC&&tS%888_d&<&<&>&>?@@@@@rN)r?r@rAr!rBrrrDrDAs(AAAAArrDceZdZdZdZdS)EventCollectorCharrefsc0|ddSNz6This should never be called with convert_charrefs=Truefailr*s  rr/z%EventCollectorCharrefs.handle_charrefJ		JKKKKKrc0|ddSrKrLr*s  rr8z'EventCollectorCharrefs.handle_entityrefMrNrN)r?r@rAr/r8rBrrrIrIHs:LLLLLLLLrrIc"eZdZdZddZdZdS)TestCaseBasec"tdSNFconvert_charrefs)rr
s r
get_collectorzTestCaseBase.get_collectorSsu5555rNct||}|}|D]}||||}||krW|dt|zdzt
j|zdzt
j|zdSdS)Nz6received events did not match expected events
Source:
z
Expected:
z
Received:
)rWfeedcloserrMreprpprintpformat)r
sourceexpected_events	collectorr
srs       r
_run_checkzTestCaseBase._run_checkVs**,,I		AKKNNNN""$$_$$II$&*6ll3%&(.(G(GH&&)/v(>(>?
@
@
@
@
@%$rcP|||tddSrS)rbrD)r
r^rs   r_run_check_extrazTestCaseBase._run_check_extrads9+UCCC	E	E	E	E	Err)r?r@rArWrbrdrBrrrQrQQsO666@@@@EEEEErrQceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdS)HTMLParserTestCasecb|ddg|ddgdS)Nz<?processing instruction>)r:zprocessing instructionz<?processing instruction ?>)r:zprocessing instruction ?rbrVs r test_processing_instruction_onlyz3HTMLParserTestCase.test_processing_instruction_onlyksP3,6				
5.8					rcd|ddddddgfddddddd	d
dgfdd
dddddgdS)Nz
<!DOCTYPE html PUBLIC 'foo'>
<HTML>&entity;&#32;
<!--comment1a
-></foo><bar>&lt;<?pi?></foo<bar
comment1b-->
<Img sRc='Bar' isMAP>sample
text
&#x201C;
<!--comment2a-- --comment2b-->
</Html>
)r
)r4zDOCTYPE html PUBLIC 'foo'rr	)r7entity)r.32)r)z4comment1a
-></foo><bar>&lt;<?pi?></foo<bar
comment1bimg)srcBar)ismapN)rzsample
text
)r.x201C)r)zcomment2a-- --comment2br&r	rhrVs rtest_simple_htmlz#HTMLParserTestCase.test_simple_htmlsst)I9:*#					rcx|dddgfddg|dgddgfddgdS)	Nz
<p>&#bad;</p>rp)rz&#bad;r&rvz<div>&#bad;</div>divr&rxrhrVs rtest_malformatted_charrefz,HTMLParserTestCase.test_malformatted_charrefsl
b!*
				
,-
#0
					rc6|dddgdS)Nz&entityref foo)r7r7)rz foorhrVs rtest_unclosed_entityrefz*HTMLParserTestCase.test_unclosed_entityrefs0(&+					rcF|dddgfddgfddgdS)Nz<a><b></a></b>rabr&r~r&rrhrVs rtest_bad_nestingz#HTMLParserTestCase.test_bad_nestingsF	
(
b!
b!	+					rc4|ddgdS)N#this text & contains & ampersands &)rrrhrVs rtest_bare_ampersandsz'HTMLParserTestCase.test_bare_ampersandss.=;@					rc4|ddgdS)N.this < text > contains < bare>pointy< brackets)rrrhrVs rtest_bare_pointy_bracketsz,HTMLParserTestCase.test_bare_pointy_bracketss.HFK					rcr|ddddgfg|ddddgfgdS)N	<a b='<'>rr~r<	<a b='>'>r>rhrVs rtest_starttag_end_boundaryz-HTMLParserTestCase.test_starttag_end_boundarysH:sZL*I)JKKK:sZL*I)JKKKKKrctdddgfg}|dg||ddg||ddg||d	d
g||ddg||d
dg|dddgfg}|dg||ddg||ddg||d	dg||ddg||ddg|dg}|ddg||ddg||ddg||ddg||dd g||d!d"g||d#d$g||d%d&g||d'd(g||d)dg||ddg|dS)*Nrr~rrz<a zb='<'>z<a bz='<'>z<a b=z'<'>z<a b='<z'>z<a b='<'rrrzb='>'>z='>'>z'>'>z<a b='>z<a b='>')r)abcz
<!--abc-->rz	!--abc--><!z--abc-->z<!-z-abc-->z<!--zabc-->z<!--azbc-->z<!--abzc-->z<!--abcz-->z<!--abc-z->z	<!--abc--rhr
outputs  rtest_buffer_artefactsz(HTMLParserTestCase.test_buffer_artefactssksZL12
v...)6222)6222&)6222D)6222S)6222sZL12
v...)6222)6222&)6222D)6222S)6222$%\*F333k*F333z*F333	*F333*F333'*F3336*F333E*F333T*F333c*F333r*F33333rcVgd}|D]!}|d|zdd|zfg"dS)N)
HTMLzOHTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"z[HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"zbhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"zfhtml PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"zYmath PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"zhtml PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"zWsvg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"z'html PUBLIC "-//IETF//DTD HTML 2.0//EN"z,html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"z
<!DOCTYPE %s>r4zDOCTYPE rh)r
dtdsdtds   rtest_valid_doctypesz&HTMLParserTestCase.test_valid_doctypessc@@@$	:	:COOOc1$j3&678
:
:
:
:	:	:rc|dddgfg|dddgfdg|dddgfddd	gfdgdS)
Nz<p/>r#rvz<p></p>rrwz<p><img src='foo' /></p>rn)rofoorhrVs rtest_startendtagz#HTMLParserTestCase.test_startendtags
C$!				
	
b!$				
2
b!
EN#345					rcHd}||ddddgfd|fgdS)Nz <foo:bar   
   one="1"	two=2   >rzfoo:bar)one1)two2rF)rd)r
ras  rtest_get_starttag_textz)HTMLParserTestCase.test_get_starttag_textsG4a
\<$@A
a ""	#	#	#	#	#rc	gd}gd}|D]R}|D]M}|}d||}||d|gfd|fd|fgNSdS)N)z*<!-- not a comment --> &not-an-entity-ref;z<not a='start tag'>z<a href="" /> <p> <span></span>zfoo = "</scr" + "ipt>";zfoo = "</SCRIPT" + ">";zfoo = <
/script> z*<!-- document.write("</scr" + "ipt>"); -->z
//<![CDATA[
document.write('<s'+'cript type="text/javascript" src="http://www.example.org/r='+new Date().getTime()+'"><\/s'+'cript>');
//]]>z 
<!-- //
var foo = 3.14;
// -->
zfoo = "</sty" + "le>";u<!-- ☃ -->)scriptstyleSCRIPTSTYLEScriptStylez <{element}>{content}</{element}>elementcontentrrr&)lowerformatrb)r
contentselementsrr
element_lowerras       rtest_cdata_contentz%HTMLParserTestCase.test_cdata_content	s


(MLL	@	@G#
@
@ '


6==gGN>PPZ$C%+W$5%-}$=$?@@@@	
@	@	@rcGddt}d}dD]k}|}d||}||d|gfd|fd	|fg|d
ldS)
NceZdZdZdS)BHTMLParserTestCase.test_cdata_with_closing_tags.<locals>.Collectorc|jSr)rrVs rrzMHTMLParserTestCase.test_cdata_with_closing_tags.<locals>.Collector.get_events.s
{"rN)r?r@rArrBrr	Collectorr-s#
#
#
#
#
#rrz<!-- not a comment --> &not-an-entity-ref;
                  <a href="" /> </p><p> <span></span></style>
                  '</script' + '>')z scriptzscript z script z
scriptzscript
z
script
z<script>{content}</{element}>rrrr&FrTr`)rrstriprrb)r
rrrrras      rtest_cdata_with_closing_tagsz/HTMLParserTestCase.test_cdata_with_closing_tags(s
	#	#	#	#	#	#	#	#&>	I	IG#MMOO1133M/66w?F7HHAOOA]B ?!' 1!)= 9 ;'0i&G&G&G

I
I
I
I	I	Irc>d}gd}|||dS)Nz<!-- I'm a valid comment --><!--me too!--><!------><!----><!----I have many hyphens----><!-- I have a > in the middle --><!-- and I have -- in the middle! -->))r)z I'm a valid comment )r)zme too!)r)z--r)r)r)z--I have many hyphens--)r)z I have a > in the middle )r)z and I have -- in the middle! rhr
r	expecteds   r
test_commentsz HTMLParserTestCase.test_comments>s98CCC	
h'''''rc>d}gd}|||dS)Nzs<!--[if IE & !(lte IE 8)]>aren't<![endif]--><!--[if IE 8]>condcoms<![endif]--><!--[if lte IE 7]>pretty?<![endif]-->))r)z%[if IE & !(lte IE 8)]>aren't<![endif])r)zf IE 8]>condcoms<![endif])r)z[if lte IE 7]>pretty?<![endif]rhrs   r
test_condcomsz HTMLParserTestCase.test_condcomsOs98CCC	
h'''''rc
d}||jgd}dddgfddg}|D]5}|d|||	6d
ddgdfd
dd
g}|D]5}|d|||	6|D]d}d
|gdz}d
ddgfd|fdd
ddgfd|fdd
g	}|d||||	ed}tdt
|D]5}||d|d|d|fg|	6|ddg|	dS)NctSr)rIrBrr<lambda>z:HTMLParserTestCase.test_convert_charrefs.<locals>.<lambda>Zs
244r)z&quot;z&#34;z&#x22;z&quotz&#34z&#x22rr~)hrefzfoo"zar)rza"zrz<a href="foo{0}zar">a{0}z</a>r)r"))xr)yz"X)zzX"z*{0}<a x="{0}" y="{0}X" z="X{0}">{0}</a>{0}Xrr)r&rr)r&rz/{1}<script>{0}</script>{1}<style>{0}</style>{1}z&quo &# &#xrno charrefs here)rr)
assertTruerUrbrjoinrangelen)r
r`charrefsrr.textr	rs        rtest_convert_charrefsz(HTMLParserTestCase.test_convert_charrefsXsG44			4555JJJ':&;<#_6	=	=GOO;BB7KK$		

=
=
=
="&L&L&LM!?MC 	=	=GOO))/$		

=
=
=
= 		=		=G88WIaK((D%#Xr2VTN,m#Wb1FD>+]	<H

OO44:F44I4I$		

=
=
=
=q#d))$$	3	3AOOD!HRaR'9&:&/ikk

3
3
3
3	
*-I,J"+)++		/	/	/	/	/rcT|ddddgfdddddd	gfd
ddd
g	dS)NzF<html <html>te>>xt&a<<bc</a></html>
<img src="URL><//img></html</html>rr	)z<htmlN)rzte>>xt)r7r~)rrzbc<)r~Nrs)rz
<img src="URL>)r)z/img)r&zhtml<rhrVs rtest_tolerant_parsingz(HTMLParserTestCase.test_tolerant_parsingsZ='/1BC..)'
>.8//	?1
	2
	2
	2
	2
	2rc6|dg|ddg|ddg|ddg|dd	d
gfg|ddg|d
dg|ddg|ddg|ddg|ddg|ddg|dd	dgfg|dd	dgfg|dddgfg|dd	dgfg|d ddgfgdS)!Nz</>z</$>)r)$</)rr</a)rrz<a<a>ra<az</a<a>)r&rr)rr<a)rr<a foo='bar')rr<a foo='bar)rr
<a foo='>')rr	<a foo='>)rrz<a$>za$z<a$b>za$bz<a$b/>r#z<a$b  >z<a$b  />rhrVs rtest_starttag_junk_charsz+HTMLParserTestCase.test_starttag_junk_charssr"""!1 2333~.///0111:ub"9!:;;;#4"5666~.///~.///)A(BCCC
(?'@AAA'=&>???&;%<===*dB!7 8999:ub"9!:;;;M5"#=">???	Z$;#<===
mUB%?$@AAAAArc
<|ddddgfgd}ddgdfg}|||d}ddgd	fd
dgd	fg}|||d}d
dgfd
dgfd
dgfd
dgfddgfddgfddgfddgfg}|||dS)
Nz<a foo="var"/>r#r~)rvarzj<img width=902 height=250px src="/sites/default/files/images/homepage/foo.jpg" /*what am I doing here*/ />rn))width902)height250px)roz,/sites/default/files/images/homepage/foo.jpg)z*whatN)amN)iN)doingN)zhere*Nz9<a / /foo/ / /=/ / /bar/ / /><a / /foo/ / /=/ / /bar/ / >))rN)=N)barNrzD<meta><meta / ><meta // ><meta / / ><meta/><meta /><meta //><meta//>metarhrs   rtest_slashes_in_starttagz+HTMLParserTestCase.test_slashes_in_starttags#(M3@P+Q*RSSS.
5
/
/
/
	
h'''/C!L!L!LM
IIIJ
	
h'''3$z62&>
$z62&>
FB'-)D
FB'-)D	
	
h'''''rc4|ddgdS)Nz<!DOCTYPE foo $ >)r4zDOCTYPE foo $ rhrVs rtest_declaration_junk_charsz.HTMLParserTestCase.test_declaration_junk_charss!+.H-IJJJJJrc4|ddgdS)Nz"<!spacer type="block" height="25">)r)zspacer type="block" height="25"rhrVs rtest_illegal_declarationsz,HTMLParserTestCase.test_illegal_declarationss0<GH	J	J	J	J	Jrc|d}ddgfdddgfdddgfdddgfdddgfdddgfddgfg}|||dS)Nzn<br></label</p><br></div end tmAd-leaderBoard><br></<h4><br></li class="unit"><br></li
						</ul><br></><br>rbr)r&zlabel<ry)r)z<h4)r&lirhrs   rtest_invalid_end_tagsz(HTMLParserTestCase.test_invalid_end_tagssMr*(r*%r*&r*$r*$r*r*#,$	
h'''''rcHd}ddgfdddg}|||dS)Nz(<b>This</b attr=">"> confuses the parserrr)rThisr)rz"> confuses the parserrhrs   rtest_broken_invalid_end_tagz.HTMLParserTestCase.test_broken_invalid_end_tags?
:b)$#68	
h'''''rcd}dddgfddgfddddgfd	d
ddd
gfdddgfddddg}|||d}ddgdfddgfddddgfd	d
g}|||dS)Nz[<div style=""    ><b>The <a href="some_url">rain</a> <br /> in <span>Spain</span></b></div>rrxrrr)rzThe r~)rsome_url)rrainrr r#r)rz in span)rSpainr&rrryz><div style="", foo = "bar" ><b>The <a href="some_url">rain</a>)r,N)rrrhrs   r$test_correct_detection_of_start_tagsz7HTMLParserTestCase.test_correct_detection_of_start_tagss90
b!
345
D"%
$
 	
h'''O
 L L LM
b!
345

	
h'''''rcjddgfddgfdgdfddd	gfg}|D]\}}|||dS)
Na&)rr	za&b)rabza&b )rr~r7rrza&b;rrrh)r
rr	rs    rtest_EOF_in_charrefz&HTMLParserTestCase.test_EOF_in_charrefstN#$
^$%
GGGH
m%789	
#	,	,ND(OOD(++++	,	,rc>d}gd}|||dS)Nz<! not really a comment ><! not a comment either --><! -- close enough --><!><!<-- this was an empty comment><!!! another bogus comment !!!>))r)z not really a comment )r)z not a comment either --)r)z -- close enough --r)r)z<-- this was an empty comment)r)z!! another bogus comment !!!rhrs   rtest_broken_commentsz'HTMLParserTestCase.test_broken_commentss62



	
h'''''rczd}dddddddgfdd	dd
dgfddd
dgfdddddd
dgfdg}|||dS)Nz<![if !(IE)]>broken condcom<![endif]><![if ! IE]><link href="favicon.tiff"/><![endif]><![if !IE 6]><img src="firefox.png" /><![endif]><![if !ie 6]><b>foo</b><![endif]><![if (!IE)|(lt IE 9)]><img src="mammoth.bmp" /><![endif]>)r=zif !(IE))rzbroken condcom)r=endif)r=zif ! IEr#link)rzfavicon.tiff)r=zif !IE 6rn)rozfirefox.png)r=zif !ie 6rr)rrr)r=zif (!IE)|(lt IE 9))rozmammoth.bmprhrs   rtest_broken_condcomsz'HTMLParserTestCase.test_broken_condcoms,sM
)&%'
F%=$>?%(
E$:#;<%(
b!%2
E$:#;<%#
&	
h'''''rctd}|d||dddgfddd	gdS)
NTrTzfoo <a>link</a> bar &amp; baz)rzfoo rr~)rrr)rz
 bar & baz)rrYassertEqualr)r
r
s  r"test_convert_charrefs_dropped_textz5HTMLParserTestCase.test_convert_charrefs_dropped_textMsr 6663444

C46F
4
6	
	
	
	
	
rN) r?r@rArirtrzr|rrrrrrrrrrrrrrrrrrrrrr
rrrrBrrrfrfis@			

LLL444<:::0###@@@>III,((("(((%/%/%/R222BBB&(((>KKKJJJ(((4
(
(
((((B,,,((( (((B









rrfcteZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdS)AttributesTestCasecddgdfg}|d||d||d||d|dS)Nrr~))rv)cr)dr)eNz<a b='v' c="v" d=v e>z<a  b = 'v' c = "v" d = v e>z<a
b
=
'v'
c
=
"v"
d
=
v
e>z<a	b	=	'v'	c	=	"v"	d	=	v	e>rhrs  rtest_attr_syntaxz#AttributesTestCase.test_attr_syntax\svsMMM
N
	
3V<<<:FCCCCVLLLCVLLLLLrc|dddgdfg|dddddgfg|ddd	d
gfg|ddddgfgdS)
Nz'<a b='xxx
	xxx' c="yyy	
yyy" d='	xyz
'>rr~))rzxxx
	xxx)rzyyy	
yyy)rz	xyz
z
<a b='' c="">)rr)rrz<e a=rgb(1,2,3)>r)r~z
rgb(1,2,3)z<a href=mailto:xyz@example.com>)rzmailto:xyz@example.comrhrVs rtest_attr_valuesz#AttributesTestCase.test_attr_valuesesK$c,>,>,>?@	A	A	A	
+$cIy+ABC	E	E	E	
*$c,?+@AB	D	D	D	
-# BC
DE	G	G	G	G	Grc|dddddgfg|ddddd	gfg|d
dddd	gfgdS)Nu!<img src=/foo/bar.png alt=中文>rrn)roz/foo/bar.png)altu中文u+<a title='テスト' href='テスト.html'>r~)titleu	テスト)ruテスト.htmlu+<a title="テスト" href="テスト.html">rhrVs rtest_attr_nonasciiz%AttributesTestCase.test_attr_nonasciits5%"9"9";<
=	>	>	>	
K# ? C EF
G	H	H	H	
K# ? C EF
G	H	H	H	H	Hrc<|ddddgfgdS)Nz!<a b='&amp;&gt;&lt;&quot;&apos;'>rr~)rz&><"'rhrVs rtest_attr_entity_replacementz/AttributesTestCase.test_attr_entity_replacements5/#0
12	4	4	4	4	4rc>|dddgdfgdS)Nz<a a.b='v' c:d=v e-f=v>rr~))za.br)zc:dr)ze-frrhrVs rtest_attr_funky_namesz(AttributesTestCase.test_attr_funky_namess>%#III
JK	M	M	M	M	Mrc<|ddddgfgdS)Nz0<html foo='&euro;&amp;&#97;&#x61;&unsupported;'>rr	)ru€&aa&unsupported;rhrVs rtest_entityrefs_in_attributesz0AttributesTestCase.test_entityrefs_in_attributess;>&#D"E
FG	I	I	I	I	IrcP|ddddgfdddgfdddgfgdS)	Nz<a $><b $=%><c \=/>rr~)rNr)r%r)\/rhrVs rtest_attr_funky_names2z)AttributesTestCase.test_attr_funky_names2sN"#}
-#
|
,#}
-
/	0	0	0	0	0rcdD]\}|d|zdddgfg|d|zdddgfg|d|zdddgfg]dS)N)&z&amp;z&#38;z&#x26;z
<a href="%s">rr~)rr1z
<a href='%s'>z<a href=%s>rh)r
rls  r test_entities_in_attribute_valuez3AttributesTestCase.test_entities_in_attribute_values7	B	BFOOOf4(#
?@
B
B
BOOOf4(#
?@
B
B
BOOMF2(#
?@
B
B
B
B	B	Brcrd}dddgfdddddgfddddd	gfd
ddddgfddg}|||dS)
Nz<a href=test'style='color:red;bad1'>test - bad1</a><a href=test'+style='color:red;ba2'>test - bad2</a><a href=test'&nbsp;style='color:red;bad3'>test - bad3</a><a href = test'&nbsp;style='color:red;bad4'  >test - bad4</a>rr~)rztest'style='color:red;bad1')rztest - bad1r)rztest'+style='color:red;ba2')rztest - bad2)rutest' style='color:red;bad3')rztest - bad3)rutest' style='color:red;bad4')rztest - bad4rhrs   rtest_malformed_attributesz,AttributesTestCase.test_malformed_attributess~
L	
FGH#_
FGH#_
JKL#_
JKL#_	
	
h'''''rc|dddgfddddgfdg|d	ddgfdddd
gfdgdS)Nz<x><y z=""o"" /></x>rrr#r)rr)zo""N)r&rz<x><y z="""" /></x>)z""NrhrVs r"test_malformed_adjacent_attributesz5AttributesTestCase.test_malformed_adjacent_attributess.$c2.*C)]1KL+-	.	.	.	
-$c2.*C)\1JK+-	.	.	.	.	.rcv|dddddgfg|dddddgfgdS)	Nz<a width="100%"cellspacing=0>rr~rz100%cellspacing0z<a id="foo"class="bar">)idrclassrrhrVs rtest_adjacent_attributesz+AttributesTestCase.test_adjacent_attributesst7$c,.ABDE	F	F	F	
1$c(/:<=	>	>	>	>	>rc<|ddddgfgdS)Nz<a v=>rr~)rrrhrVs rtest_missing_attribute_valuez/AttributesTestCase.test_missing_attribute_values3$cI;78	:	:	:	:	:rc<|ddddgfgdS)Nz-<a href=javascript:popup('/popup/help.html')>rr~)rz$javascript:popup('/popup/help.html')rhrVs rtest_javascript_attribute_valuez2AttributesTestCase.test_javascript_attribute_valuesAG$cKLNO	P	P	P	P	Prc@|ddddgfddgdS)Nz-<a href='http://www.example.org/">;'>spam</a>rr~)rzhttp://www.example.org/">;)rspamrrhrVs rtest_end_tag_in_attribute_valuez2AttributesTestCase.test_end_tag_in_attribute_values@H$cBCE)?<	=	=	=	=	=rcd}ddgfddddgfddgdfdd	gfdd
dgfddd
gfddddgfdddgfdddddddgfdddgfddddg}|||dS)Nz<html><body bgcolor=d0ca90 text='181008'><table cellspacing=0 cellpadding=1 width=100% ><tr><td align=left><font size=-1>- <a href=/rabota/><span class=en> software-and-i</span></a>- <a href='/1/'><span class=en> library</span></a></table>rr	body)bgcolord0ca90)r181008table)r9)cellpaddingrr8trtd)alignleftfont)sizez-1)rz- r~)rz/rabota/r)r>en)rz software-and-irr)rz/1/)rz library)r&rLrhrs   rtest_with_unquoted_attributesz0AttributesTestCase.test_with_unquoted_attributessM$
"79K!LM
OOO
Q
r"
 123
.!12Z/C.DE
/!235PZ.?@
/!235I1D
	
h'''''rcd}dddgfddddgfddddgfddgd	fdddd
gfddddgfddd
dgfddddgfddddgfg	}|||dS)Nz<div class=bar,baz=asd><div class="bar",baz="asd"><div class=bar, baz=asd,><div class="bar", baz="asd",><div class="bar",><div class=,bar baz=,asd><div class=,"bar" baz=,"asd"><div ,class=bar ,baz=asd><div class,="bar" baz,="asd">rrx)r>zbar,baz=asdr=)z,bazasd)r>zbar,)bazzasd,)r=r)rXrWrr)r>z,bar)rXz,asd)r>z,"bar")rXz,"asd")z,classr)zclass,r)zbaz,rWrhrs   rtest_comma_between_attributesz0AttributesTestCase.test_comma_between_attributess0!9 ;<
!1? CD
!2O DE
!>!>!>
?
!1; ?@
!2O DE
!46G HI
!2O DE
!2O DE
	
h'''''rc<|ddddgfgdS)Nz<form action=bogus|&#()value>rform)actionzbogus|&#()valuerhrVs r-test_weird_chars_in_unquoted_attribute_valuesz@AttributesTestCase.test_weird_chars_in_unquoted_attribute_valuessA7'!> ?A:B	C	C	C	C	CrN)r?r@rArr r$r&r(r*r/r2r4r6r?rArCrFrUrYr]rBrrrrZs-MMM
G
G
G
H
H
H444
MMM
III000BBB((((	.	.	.>>>:::PPP
===(((0(((8CCCCCrr__main__)__doc__html.parserr	r\unittestr
rrrDrITestCaserQrfrr?mainrBrr<module>rds



6,6,6,6,6,T[+6,6,6,rAAAAA.AAALLLLL^LLLEEEEE8$EEE0n
n
n
n
n
n
n
n
bzCzCzCzCzCzCzCzCxzHMOOOOOr