tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
P\¬Qc@sÑdZddlZddlZddlZddlmZdejfd„ƒYZdefd„ƒYZdejfd    „ƒYZ    d
e    fd „ƒYZ
d e    fd „ƒYZ d„Z e dkrÍe ƒndS(sTests for HTMLParser.py.iÿÿÿÿN(t test_supporttEventCollectorcBsteZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z RS( cCs,g|_|jj|_tjj|ƒdS(N(teventstappendt
HTMLParsert__init__(tself((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyR s    cCs‰g}d}xm|jD]b}|d}||ko=dknred|dd|df|d<n |j|ƒ|}qW||_|S(Nitdataiÿÿÿÿi(tNoneRR(RtLtprevtypeteventttype((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt
get_eventss
# 
    cCs|jd||fƒdS(Ntstarttag(R(Rttagtattrs((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pythandle_starttag!scCs|jd||fƒdS(Nt startendtag(R(RRR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pythandle_startendtag$scCs|jd|fƒdS(Ntendtag(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt handle_endtag'scCs|jd|fƒdS(Ntcomment(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pythandle_comment,scCs|jd|fƒdS(Ntcharref(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pythandle_charref/scCs|jd|fƒdS(NR(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt handle_data2scCs|jd|fƒdS(Ntdecl(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt handle_decl5scCs|jd|fƒdS(Nt    entityref(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pythandle_entityref8scCs|jd|fƒdS(Ntpi(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt    handle_pi;scCs|jd|fƒdS(Ns unknown decl(R(RR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt unknown_decl>s(t__name__t
__module__RR RRRRRRRRR R!(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyR    s                                            tEventCollectorExtracBseZd„ZRS(cCs0tj|||ƒ|jd|jƒfƒdS(Nt starttag_text(RRRtget_starttag_text(RRR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyRDs(R"R#R(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyR$Bst TestCaseBasecBs&eZed„Zd„Zd„ZRS(cCs{|ƒ}x|D]}|j|ƒqW|jƒ|jƒ}||krw|jdtj|ƒdtj|ƒƒndS(Ns8received events did not match expected events
Expected:
s
Received:
(tfeedtcloseR tfailtpprinttpformat(Rtsourcetexpected_eventst    collectortparsertsR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt
_run_checkKs     
  cCs|j||tƒdS(N(R2R$(RR-R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt_run_check_extraVscCs#|d„}|jtj|ƒdS(NcSs'tjƒ}|j|ƒ|jƒdS(N(RR(R)(R-R0((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pytparseZs  (t assertRaisesRtHTMLParseError(RR-R4((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt _parse_errorYs (R"R#RR2R3R7(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyR'Is    tHTMLParserTestCasecBsÅeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs*|jddgƒ|jddgƒdS(Ns<?processing instruction>Rsprocessing instructions<?processing instruction ?>sprocessing instruction ?(spisprocessing instruction(spisprocessing instruction ?(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt test_processing_instruction_onlycs    
    cCs_|jddddddgfdddddddddgfd d!d"d#d$d%d&gƒdS('Ns¿
<!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>
Rs
RsDOCTYPE html PUBLIC 'foo'RthtmlRtentityRt32Rs4comment1a
-></foo><bar>&lt;<?pi?></foo<bar
comment1btimgtsrctBartismaps sample
text
tx201Cscomment2a-- --comment2bR(sdatas
(sdeclsDOCTYPE html PUBLIC 'foo'(sdatas
(s    entityrefsentity(scharrefR<(sdatas
(scomments4comment1a
-></foo><bar>&lt;<?pi?></foo<bar
comment1b(sdatas
(R>R?(R@N(sdatas sample
text
(scharrefRA(sdatas
(scommentscomment2a-- --comment2b(sdatas
(sendtagshtml(sdatas
(R2R(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_simple_htmlks&  cCs|jdddgƒdS(Ns&entityref fooRRs foo(s    entityrefs    entityref(sdatas foo(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_unclosed_entityref‹s    cCs2|jdddgfddgfddgƒdS(Ns<a><b></a></b>RtatbR(sendtagRD(sendtagRE(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_bad_nesting‘s
      cCs|jddgƒdS(Ns#this text & contains & ampersands &R(sdatas#this text & contains & ampersands &(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_bare_ampersandsœs    cCs|jddgƒdS(Ns.this < text > contains < bare>pointy< bracketsR(sdatas.this < text > contains < bare>pointy< brackets(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_bare_pointy_brackets¡s    cCs|jddgƒdS(Ns"<!spacer type="block" height="25">Rsspacer type="block" height="25"(scommentsspacer type="block" height="25"(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_illegal_declarations¦s    cCsB|jddddgfgƒ|jdddd    gfgƒdS(
Ns    <a b='<'>RRDREt<s    <a b='>'>t>(RERJ(RERK(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_starttag_end_boundaryªscCs+ddd*gfg}|jdg|ƒ|jddg|ƒ|jdd    g|ƒ|jd
d g|ƒ|jd d g|ƒ|jddg|ƒddd+gfg}|jdg|ƒ|jddg|ƒ|jddg|ƒ|jd
dg|ƒ|jdd g|ƒ|jddg|ƒd,g}|jddg|ƒ|jddg|ƒ|jddg|ƒ|jddg|ƒ|jdd g|ƒ|jd!d"g|ƒ|jd#d$g|ƒ|jd%d&g|ƒ|jd'd(g|ƒ|jd)dg|ƒ|jddg|ƒdS(-NRRDRERJs    <a b='<'>s<a sb='<'>s<a bs='<'>s<a b=s'<'>s<a b='<s'>s<a b='<'RKs    <a b='>'>sb='>'>s='>'>s'>'>s<a b='>s<a b='>'Rtabcts
<!--abc-->s    !--abc-->s<!s--abc-->s<!-s-abc-->s<!--sabc-->s<!--asbc-->s<!--absc-->s<!--abcs-->s<!--abc-s->s    <!--abc--(RERJ(RERK(scommentsabc(R2(Rtoutput((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_buffer_artefacts®s4    cCsñ|jdgƒ|jddgƒ|jddgƒ|jddgƒ|jddd
d gfgƒ|jd dgƒ|jddgƒ|jd    dgƒ|jddgƒ|jddgƒ|jddgƒ|jddgƒdS(Ns</>s</$>Rt$s</Rs</as<a<a>s<aRRDs</a<a>Rsa<as<!s <a foo='bar's <a foo='bars
<a foo='>'s    <a foo='>(scommentRQ(sdatas</(sdatas</a(sdatas<a(sendtagsa<a(sdatas<!(sdatas<a(sdatas <a foo='bar'(sdatas <a foo='bar(sdatas
<a foo='>'(sdatas    <a foo='>(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_starttag_junk_charsÌsc
CsZddddddddd    d
g
}x/|D]'}|jd |d d |fgƒq+WdS(NtHTMLsOHTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"s[HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"sbhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"sfhtml PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"sYmath PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"s‚html 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"sWsvg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"s'html PUBLIC "-//IETF//DTD HTML 2.0//EN"s,html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"s <!DOCTYPE %s>RsDOCTYPE (R2(Rtdtdstdtd((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_valid_doctypesÛs      c Cs%|jddddgfgƒd}ddddddddd d!gfg}|j||ƒd}ddd"d#d$gfddd%d&d'gfg}|j||ƒd}ddgfddgfddgfddgfddgfddgfddgfddgfg}|j||ƒdS((Ns<a foo="var"/>RRDtfootvarsj<img width=902 height=250px src="/sites/default/files/images/homepage/foo.jpg" /*what am I doing here*/ />R=twidtht902theightt250pxR>s,/sites/default/files/images/homepage/foo.jpgs*whattamtitdoingshere*s9<a / /foo/ / /=/ / /bar/ / /><a / /foo/ / /=/ / /bar/ / >t=tbarRsD<meta><meta / ><meta // ><meta / / ><meta/><meta /><meta //><meta//>tmeta(RWsvar(swidthRZ(R[R\(ssrcs,/sites/default/files/images/homepage/foo.jpg(s*whatN(R]N(R^N(R_N(shere*N(RWN(R`N(RaN(RWN(R`N(RaN(R2R(RR:texpected((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_slashes_in_starttagós$    cCs|jddgƒdS(Ns<!DOCTYPE foo $ >RsDOCTYPE foo $ (sdeclsDOCTYPE foo $ (R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_declaration_junk_charsscCsm|jdddgfgƒ|jdddgfd gƒ|jdddgfddd gfd gƒdS(Ns<p/>Rtps<p></p>RRs<p><img src='foo' /></p>R=R>RW(sendtagRf(ssrcsfoo(sendtagRf(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_startendtags         
     cCsƒd}ddgfd
ddgfd ddgfd ddgfd ddgfdddgfddgfg }|j||ƒdS(Nsn<br></label</p><br></div end tmAd-leaderBoard><br></<h4><br></li class="unit"><br></li
                       </ul><br></><br>RtbrRslabel<tdivRs<h4tli(sendtagslabel<(sendtagRi(scomments<h4(sendtagRj(sendtagRj(R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_invalid_end_tags#s      cCs5d}ddgfdd    d
g}|j||ƒdS( Ns(<b>This</b attr=">"> confuses the parserRRERtThisRs"> confuses the parser(sdataRl(sendtagRE(sdatas"> confuses the parser(R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_broken_invalid_end_tag=s      cCs5d}|j|ddd    d
gfd|fgƒdS( Ns <foo:bar   
   one="1"    two=2   >Rsfoo:bartonet1ttwot2R%(RnRo(RpRq(R3(RR1((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_get_starttag_textIs    c Cs·ddddddddd    d
d g }d d ddddg}xq|D]i}x`|D]X}|jƒ}djd|d|ƒ}|j|d|gfd|fd|fgƒqSWqFWdS(Ns*<!-- not a comment --> &not-an-entity-ref;s<not a='start tag'>s<a href="" /> <p> <span></span>sfoo = "</scr" + "ipt>";sfoo = "</SCRIPT" + ">";sfoo = <
/script> s*<!-- document.write("</scr" + "ipt>"); -->s
//<![CDATA[
document.write('<s'+'cript type="text/javascript" src="http://www.example.org/r='+new Date().getTime()+'"><\/s'+'cript>');
//]]>s 
<!-- //
var foo = 3.14;
// -->
sfoo = "</sty" + "le>";u <!-- â˜ƒ -->tscripttstyletSCRIPTtSTYLEtScripttStyleu <{element}>{content}</{element}>telementtcontentRRR(tlowertformatR2(RtcontentstelementsRzRyt element_lowerR1((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_cdata_contentOs(               cCs‰dtfd„ƒY}d}xfdddddd    gD]L}d
jd |d |ƒ}|j|d dgfd|fdgd|ƒq5WdS(Nt    CollectorcBseZd„ZRS(cSs|jS(N(R(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyR ts(R"R#R (((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyRsss®<!-- not a comment --> &not-an-entity-ref;
                  <a href="" /> </p><p> &amp; <span></span></style>
                  '</script' + '>' </html> </head> </scripter>!s scriptsscript s script s
scriptsscript
s
script
u<script>{content}</{element}>RyRzRRsRRR/(sendtagsscript(RR|R2(RRRzRyR1((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_cdata_with_closing_tagsns             cCs&|jdddgfddgƒdS(    Ns <p>&#bad;</p>RRfRs&#bad;R(sdatas&#bad;(sendtagRf(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_malformatted_charrefƒs     cCsBtjƒ}|j|jdƒdƒ|j|jdƒdƒdS(Ns&#bad;s&#0038;t&(Rt assertEqualtunescape(RR0((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_unescape_functionŠs (R"R#R9RBRCRFRGRHRIRLRPRRRVRdReRgRkRmRrR€R‚RƒR‡(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyR8as*                                                                                 tAttributesTestCasecBs¡eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„Zd„Zd„ZRS(cCsbddd d ddgfg}|jd|ƒ|jd    |ƒ|jd
|ƒ|jd |ƒdS(NRRDREtvtctdtes<a b='v' c="v" d=v e>s<a  b = 'v' c = "v" d = v e>s<a
b
=
'v'
c
=
"v"
d
=
v
e>s<a    b    =    'v'    c    =    "v"    d    =    v    e>(RER‰(RŠR‰(R‹R‰(RŒN(RR2(RRO((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_attr_syntax“s
cCs‰|jddddddgfgƒ|jd
ddddgfgƒ|jd dd dgfgƒ|jddddgfgƒdS(Ns'<a b='xxx
   xxx' c="yyy    
yyy" d='    xyz
'>RRDREsxxx
   xxxRŠsyyy    
yyyR‹s    xyz
s <a b='' c="">RNs<e a=rgb(1,2,3)>RŒs
rgb(1,2,3)s<a href=mailto:xyz@example.com>threfsmailto:xyz@example.com(REsxxx
   xxx(RŠsyyy    
yyy(R‹s    xyz
(RERN(RŠRN(RDs
rgb(1,2,3)(RŽsmailto:xyz@example.com(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_attr_valuesœs                cCsj|jdddddgfgƒ|jddd    ddgfgƒ|jddd    ddgfgƒdS(Nu!<img src=/foo/bar.png alt=中文>RR=R>s /foo/bar.pngtaltu中文u+<a title='テスト' href='テスト.html'>RDttitleu    ãƒ†ã‚¹ãƒˆRŽuテスト.htmlu+<a title="テスト" href="テスト.html">(ssrcs /foo/bar.png(Ru中文(stitleu    ãƒ†ã‚¹ãƒˆ(shrefuテスト.html(stitleu    ãƒ†ã‚¹ãƒˆ(shrefuテスト.html(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_attr_nonascii«s            cCs#|jddddgfgƒdS(Ns!<a b='&amp;&gt;&lt;&quot;&apos;'>RRDREs&><"'(REs&><"'(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_attr_entity_replacementºscCsf|jddddddgfgƒ|jddddgfdd
dgfdd dgfgƒdS(Ns<a a.b='v' c:d=v e-f=v>RRDsa.bR‰sc:dse-fs<a $><b $=%><c \=/>RQREt%RŠs\t/(sa.bR‰(sc:dR‰(se-fR‰(RQN(RQR”(s\R•(R2R(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_attr_funky_names¿scCs#|jddddgfgƒdS(Ns0<html foo='&euro;&amp;&#97;&#x61;&unsupported;'>RR:RWu€&aa&unsupported;(sfoou€&aa&unsupported;(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_entityrefs_in_attributesÉscCsŠxƒddddgD]o}|jd|ddd gfgƒ|jd    |ddd gfgƒ|jd
|ddd gfgƒqWdS(NR„s&amp;s&#38;s&#x26;s <a href="%s">RRDRŽs <a href='%s'>s <a href=%s>(shrefR„(shrefR„(shrefR„(R2(RR;((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt test_entities_in_attribute_valueÎs   c Cstd}dddgfdddddgfdddddgfdddddgfddg }|j||ƒdS(NsÜ<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>RRDRŽstest'style='color:red;bad1'Rs test - bad1Rstest'+style='color:red;ba2's test - bad2utest' style='color:red;bad3's test - bad3utest' style='color:red;bad4's test - bad4(shrefstest'style='color:red;bad1'(sdatas test - bad1(sendtagRD(shrefstest'+style='color:red;ba2'(sdatas test - bad2(sendtagRD(shrefutest' style='color:red;bad3'(sdatas test - bad3(sendtagRD(shrefutest' style='color:red;bad4'(sdatas test - bad4(sendtagRD(R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_malformed_attributesØs cCsf|jdddgfddd d gfdgƒ|jd
ddgfddddgfdgƒdS(Ns<x><y z=""o"" /></x>RtxRtytzRNso""Rs<x><y z="""" /></x>s""(RœRN(so""N(sendtagRš(RœRN(s""N(sendtagRš(R2R(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt"test_malformed_adjacent_attributesìs     
     cCsH|jdddd dgfgƒ|jdddddgfgƒdS(Ns<a width="100%"cellspacing=0>RRDRYs100%t cellspacingt0s<a id="foo"class="bar">tidRWtclassRa(swidths100%(RžRŸ(sidsfoo(R¡sbar(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_adjacent_attributesøs         cCs#|jddddgfgƒdS(Ns<a v=>RRDR‰RN(R‰RN(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_missing_attribute_values    cCs#|jddddgfgƒdS(Ns-<a href=javascript:popup('/popup/help.html')>RRDRŽs$javascript:popup('/popup/help.html')(shrefs$javascript:popup('/popup/help.html')(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_javascript_attribute_values    cCs)|jdddd    gfd
d gƒdS( Ns-<a href='http://www.example.org/">;'>spam</a>RRDRŽshttp://www.example.org/">;RtspamR(shrefshttp://www.example.org/">;(sdataR¥(sendtagRD(R2(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_end_tag_in_attribute_value
s        cCs5d}d
d d d dddg}|j||ƒdS(Nsž<!-- I'm a valid comment --><!--me too!--><!------><!----><!----I have many hyphens----><!-- I have a > in the middle --><!-- and I have -- in the middle! -->Rs I'm a valid comment sme too!s--RNs--I have many hyphens--s I have a > in the middle s and I have -- in the middle! (scomments I'm a valid comment (scommentsme too!(scomments--(scommentRN(scomments--I have many hyphens--(scomments I have a > in the middle (scomments and I have -- in the middle! (R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt test_commentss    cCs2d}d    d
d d d dg}|j||ƒdS(NsŒ<! not really a comment ><! not a comment either --><! -- close enough --><!><!<-- this was an empty comment><!!! another bogus comment !!!>Rs not really a comment s not a comment either --s -- close enough --RNs<-- this was an empty comments!! another bogus comment !!!(scomments not really a comment (scomments not a comment either --(scomments -- close enough --(scommentRN(scomments<-- this was an empty comment(scomments!! another bogus comment !!!(R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_broken_comments"s    cCs)d}dddg}|j||ƒdS(    Nss<!--[if IE & !(lte IE 8)]>aren't<![endif]--><!--[if IE 8]>condcoms<![endif]--><!--[if lte IE 7]>pretty?<![endif]-->Rs%[if IE & !(lte IE 8)]>aren't<![endif]sf IE 8]>condcoms<![endif]s[if lte IE 7]>pretty?<![endif](scomments%[if IE & !(lte IE 8)]>aren't<![endif](scommentsf IE 8]>condcoms<![endif](scomments[if lte IE 7]>pretty?<![endif](R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt test_condcoms2s
    cCs€d}dddddd    dgfdddd dgfdd ddgfd!d"d#d$dd d%gfd&g}|j||ƒdS('Nsá<![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]>s unknown declsif !(IE)Rsbroken condcomtendifsif ! IERtlinkRŽs favicon.tiffsif !IE 6R=R>s firefox.pngsif !ie 6RRERWRsif (!IE)|(lt IE 9)s mammoth.bmp(s unknown declsif !(IE)(sdatasbroken condcom(s unknown declRª(s unknown declsif ! IE(shrefs favicon.tiff(s unknown declRª(s unknown declsif !IE 6(ssrcs firefox.png(s unknown declRª(s unknown declsif !ie 6(sdatasfoo(sendtagRE(s unknown declRª(s unknown declsif (!IE)|(lt IE 9)(ssrcs mammoth.bmp(s unknown declRª(R2(RR:Rc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyttest_broken_condcoms;s&      (R"R#RRR’R“R–R—R˜R™RR¢R£R¤R¦R§R¨R©R¬(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyRˆ‘s"                        
       
                                           cCstjttƒdS(N(Rt run_unittestR8Rˆ(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt    test_main]st__main__(t__doc__RR+tunittestttestRRR$tTestCaseR'R8RˆR®R"(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_htmlparser.pyt<module>s   9ÿ1Ì