zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
U
¡ý°d½ã@shdZdZddlZddlZddlZddlZddlZddlmZddl    m
Z
m Z m Z m Z mZmZmZmZmZddlmZmZmZeZzddlmZdZWnek
r¬d    ZYnXzddlZdZWnek
rÖd    ZYnXzddlZdZ ej!j"Z"Wnek
rd    Z d
Z"YnXd Z#Gd d „d e$ƒZ%Gdd„de$ƒZ&Gdd„de&ƒZ'Gdd„de&ƒZ(Gdd„de'ƒZ)dS)zHelper classes for tests.ÚMITéN)Ú BeautifulSoup)    ÚCharsetMetaAttributeValueÚCommentÚContentMetaAttributeValueÚDoctypeÚPYTHON_SPECIFIC_ENCODINGSÚ SoupStrainerÚScriptÚ
StylesheetÚTag)ÚDetectsXMLParsedAsHTMLÚHTMLParserTreeBuilderÚXMLParsedAsHTMLWarning)ÚSelectorSyntaxErrorTF)ru-
A bare string
<!DOCTYPE xsl:stylesheet SYSTEM "htmlent.dtd">
<!DOCTYPE xsl:stylesheet PUBLIC "htmlent.dtd">
<div><![CDATA[A CDATA section where it doesn't belong]]></div>
<div><svg><![CDATA[HTML5 does allow CDATA sections in SVG]]></svg></div>
<div>A <meta> tag</div>
<div>A <br> tag that supposedly has contents.</br></div>
<div>AT&T</div>
<div><textarea>Within a textarea, markup like <b> tags and <&<&amp; should be treated as literal</textarea></div>
<div><script>if (i < 2) { alert("<b>Markup within script tags should be treated as literal.</b>"); }</script></div>
<div>This numeric entity is missing the final semicolon: <x t="pi&#241ata"></div>
<div><a href="http://example.com/</a> that attribute value never got closed</div>
<div><a href="foo</a>, </a><a href="bar">that attribute value was closed by the subsequent tag</a></div>
<! This document starts with a bogus declaration ><div>a</div>
<div>This document contains <!an incomplete declaration <div>(do you see it?)</div>
<div>This document ends with <!an incomplete declaration
<div><a style={height:21px;}>That attribute value was bogus</a></div>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">The doctype is invalid because it contains extra whitespace
<div><table><td nowrap>That boolean attribute had no value</td></table></div>
<div>Here's a nonexistent entity: &#foo; (do you see it?)</div>
<div>This document ends before the entity finishes: &gt
<div><p>Paragraphs shouldn't contain block display elements, but this one does: <dl><dt>you see?</dt></p>
<b b="20" a="1" b="10" a="2" a="3" a="4">Multiple values for the same attribute.</b>
<div><table><tr><td>Here's a table</td></tr></table></div>
<div><table id="1"><tr><td>Here's a nested table:<table id="2"><tr><td>foo</td></tr></table></td></div>
<div>This tag contains nothing but whitespace: <b>    </b></div>
<div><blockquote><p><b>This p tag is cut off by</blockquote></p>the end of the blockquote tag</div>
<div><table><div>This table contains bare markup</div></table></div>
<div><div id="1">
 <a href="link1">This link is never closed.
</div>
<div id="2">
 <div id="3">
   <a href="link2">This link is closed.</a>
  </div>
</div></div>
<div>This document contains a <!DOCTYPE surprise>surprise doctype</div>
<div><a><B><Cd><EFG>Mixed case tags are folded to lowercase</efg></CD></b></A></div>
<div><our☃>Tag name contains Unicode characters</our☃></div>
<div><a â˜ƒ="snowman">Attribute name contains Unicode characters</a></div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
c@sXeZdZedd„ƒZdd„Zdd„Zddd    „ZeZd
d „Z    dd d„Z
dd„Z dd„Z dS)ÚSoupTestcCstS©N)Údefault_builder©Úself©rúId:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\bs4/tests/__init__.pyr^szSoupTest.default_buildercKs"| d|j¡}t|fd|i|—ŽS)z*Build a Beautiful Soup object from markup.Úbuilder)Úpoprr)rÚmarkupÚkwargsrrrrÚsoupbsz SoupTest.soupcKs|jf|Ž |¡S)z[Turn an HTML fragment into a document.
 
        The details depend on the builder.
        )rZtest_fragment_to_document)rrrrrrÚ document_forgszSoupTest.document_forNcCst|j}t||d}|dkr|}| ¡| |¡ks4t‚tdd„t|j ¡ƒDƒƒsTt‚|j    gdd„|j
Dƒkspt‚dS)ziParse some markup using Beautiful Soup and verify that
        the output markup is as expected.
        )rNcss|]}|dkVqdS)rNr)Ú.0ÚvrrrÚ    <genexpr>sz'SoupTest.assert_soup.<locals>.<genexpr>cSsg|]
}|j‘qSr)Úname)rÚxrrrÚ
<listcomp>ƒsz(SoupTest.assert_soup.<locals>.<listcomp>) rrÚdecoderÚAssertionErrorÚallÚlistZopen_tag_counterÚvaluesZ ROOT_TAG_NAMEZtagStack)rZto_parseZcompare_parsed_torÚobjrrrÚ assert_soupns  zSoupTest.assert_soupcCs8d}|jD](}|r.||jks t‚||jks.t‚|}q
dS)zyEnsure that next_element and previous_element are properly
        set for all descendants of the given element.
        N)Z descendantsÚ next_elementr%Úprevious_element)rÚelementZearlierÚerrrÚassertConnectedness‡s 
zSoupTest.assertConnectednessFc        Csþd}|jdkrh|jdks,td ||jd¡ƒ‚|jdksJtd ||jd¡ƒ‚|jdkshtd ||jd¡ƒ‚d}d}d}t|jƒd}|jD]Ä}d}|dkr|jdk    rÈ|j|ksÆtd ||j|¡ƒ‚|j|ksätd ||j|¡ƒ‚|jdksÈtd ||jd¡ƒ‚nÂ|j|j|dks:td     ||j|j|d¡ƒ‚|j|dj|ksxtd
 |j|d|j|dj|¡ƒ‚|dk    rÈ|j|ks¨td  ||j||jj¡ƒ‚|j|ksÈtd  ||j|¡ƒ‚t    |t
ƒr|jr|  |d ¡}|jdkstd
 ||jd¡ƒ‚|dk    r|}n|}||krF|jdksFtd
 ||jd¡ƒ‚|d7}qˆ|dk    r^|n|}|dkrp|}|sö|dk    rö|}|dkr´|jdksòtd  ||jd¡ƒ‚qòn4|jdk    rè|j|jksòtd  ||j|j¡ƒ‚qò|j}q„dS|SdS)z.Ensure proper linkage throughout the document.Nz3Bad previous_element
NODE: {}
PREV: {}
EXPECTED: {}z3Bad previous_sibling
NODE: {}
PREV: {}
EXPECTED: {}z/Bad next_sibling
NODE: {}
NEXT: {}
EXPECTED: {}réz/Bad next_element
NODE: {}
NEXT: {}
EXPECTED: {}z2Bad previous_sibling
NODE: {}
PREV {}
EXPECTED: {}z1Bad previous_sibling
NODE: {}
PREV {}
EXPECTED {}z-Bad next_sibling
NODE: {}
NEXT {}
EXPECTED {}z=Bad previous_element
NODE: {}
PREV {}
EXPECTED {}
CONTENTS {}z-Bad next_element
NODE: {}
NEXT {}
EXPECTED {}T) Úparentr,r%ÚformatZprevious_siblingZ next_siblingÚlenÚcontentsr+Ú
isinstancer Úlinkage_validator)    rÚelZ_recursive_callZ
descendantÚidxÚchildZ
last_childZlast_idxÚtargetrrrr6’s
 ÿÿ ÿÿ ÿÿ 
  ÿÿ ÿÿÿÿ ÿÿ ÿÿ
ÿÿÿÿ ÿÿ
 
ÿÿ
 
 
ÿÿ ÿÿ
zSoupTest.linkage_validatorcCsdd„|Dƒ|kst‚dS)zÝMake sure that the given tags have the correct text.
 
        This is used in tests that define a bunch of tags, each
        containing a single string, and then select certain strings by
        some mechanism.
        cSsg|]
}|j‘qSr©Ústring©rÚtagrrrr# sz+SoupTest.assert_selects.<locals>.<listcomp>N©r%©rÚtagsZ should_matchrrrÚassert_selectsszSoupTest.assert_selectscCsdd„|Dƒ|kst‚dS)zÜMake sure that the given tags have the correct IDs.
 
        This is used in tests that define a bunch of tags, each
        containing a single string, and then select certain strings by
        some mechanism.
        cSsg|] }|d‘qS©Úidrr=rrrr#sz/SoupTest.assert_selects_ids.<locals>.<listcomp>Nr?r@rrrÚassert_selects_ids szSoupTest.assert_selects_ids)N)F) Ú__name__Ú
__module__Ú __qualname__Úpropertyrrrr*ZassertSoupEqualsr/r6rBrErrrrr\s
 
 
r    rc@sheZdZej ddiedgdddgig¡dd„ƒZej dedgd    ddgig¡d
d „ƒZd d „Z    dS)ÚTreeBuilderSmokeTestÚmulti_valued_attributesNÚclass)ÚbÚ*ZnotclasscCs(d}|j||d}|jddks$t‚dS)NzC<html xmlns="http://www.w3.org/1999/xhtml"><a class="a b c"></html>©rKrLza b c©rÚar%©rrKrrrrrÚtest_attribute_not_multi_valuedsz4TreeBuilderSmokeTest.test_attribute_not_multi_valued)rQcCs.d}|j||d}|jddddgks*t‚dS)Nz<a class="a b c">rOrLrQrMÚcrPrRrrrÚtest_attribute_multi_valued#s ÿz0TreeBuilderSmokeTest.test_attribute_multi_valuedcCsd}d}| |¡}dS)Nz<![if word]>content<![endif]>z<!DOCTYPE html]ff>)r©rrrrrrÚtest_invalid_doctype-sz)TreeBuilderSmokeTest.test_invalid_doctype)
rFrGrHÚpytestÚmarkZ parametrizeÚdictrSrUrWrrrrrJsþ
ÿ
rJc@seZdZdZdd„Zdd„Zdd„Zdd    „Zdƒd d „Zd d„Z    dd„Z
dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Zd7d8„Zd9d:„Zd;d<„Z d=d>„Z!d?d@„Z"dAdB„Z#dCdD„Z$dEdF„Z%dGdH„Z&dIdJ„Z'dKdL„Z(dMdN„Z)dOdP„Z*dQd„ZdRdS„Z+dTdU„Z,dVdW„Z-dXdY„Z.dZd[„Z/d\d]„Z0d^d_„Z1d`da„Z2dbdc„Z3ddde„Z4dfdg„Z5dhdi„Z6djdk„Z7dldm„Z8dndo„Z9dpdq„Z:drds„Z;dtdu„Z<dvdw„Z=dxdy„Z>dzd{„Z?d|d}„Z@d~d„ZAd€d„ZBd‚S)„ÚHTMLTreeBuilderSmokeTestaCA basic test of a treebuilder's competence.
 
    Any HTML treebuilder, present or future, should be able to pass
    these tests. With invalid markup, there's room for interpretation,
    and different parsers can handle it differently. But with the
    markup in these tests, there's not much room for interpretation.
    cCs0dD]&}| d¡}| |¡}|jdkst‚qdS)zmVerify that all HTML4 and HTML5 empty element (aka void element) tags
        are handled correctly.
        )ÚareaÚbaseÚbrÚcolÚembedÚhrÚimgÚinputÚkeygenÚlinkZmenuitemÚmetaÚparamÚsourceÚtrackÚwbrZspacerÚframeÚTN)rÚnew_tagÚis_empty_elementr%)rr!rrmrrrÚtest_empty_element_tags<s
 
z0HTMLTreeBuilderSmokeTest.test_empty_element_tagscCsp| d¡}t|jjtƒst‚t|jjtƒs.t‚| d¡}t|jjtƒsJt‚|jjdksZt‚t|jjtƒslt‚dS)Nz7<style>Some CSS</style><script>Some Javascript</script>z<style><!--Some CSS--></style>z<!--Some CSS-->)rr5Ústyler<r r%Úscriptr
©rrrrrÚtest_special_string_containersHsÿÿz7HTMLTreeBuilderSmokeTest.test_special_string_containerscCsF| d¡}t |d¡}t |¡}|jtks.t‚| ¡| ¡ksBt‚dS©Nz <a><b>foo</a>é©rÚpickleÚdumpsÚloadsÚ    __class__rr%r$©rÚtreeZdumpedZloadedrrrÚ!test_pickle_and_unpickle_identityXs
 
 
z:HTMLTreeBuilderSmokeTest.test_pickle_and_unpickle_identitycCsh| |¡\}}|jd}|jtks&t‚||ks2t‚| d¡dt|ƒ…|ksPt‚|jjddksdt‚dS)z8Assert that a given doctype string is handled correctly.rÚutf8NÚfoo©Ú_document_with_doctyper4rzrr%Úencoder3Úp©rÚdoctype_fragmentZ doctype_strrÚdoctyperrrÚassertDoctypeHandledas 
 z-HTMLTreeBuilderSmokeTest.assertDoctypeHandledÚDOCTYPEcCs,d||f}|d}| |¡}| d¡|fS)z5Generate and parse a document with the given doctype.z<!%s %s>z
<p>foo</p>r~)rr‚)rr…Zdoctype_stringr†rrrrrros 
z/HTMLTreeBuilderSmokeTest._document_with_doctypecCs| d¡| d¡dS)z?Make sure normal, everyday HTML doctypes are handled correctly.Úhtmlz4html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"N©r‡rrrrÚtest_normal_doctypesvs
ÿz-HTMLTreeBuilderSmokeTest.test_normal_doctypescCs(| d¡}|jd}d| ¡ks$t‚dS)Nz
<!DOCTYPE>rrl)rr4Ústripr%)rrr†rrrÚtest_empty_doctype|s
 
z+HTMLTreeBuilderSmokeTest.test_empty_doctypecCstdD]j}| d|¡\}}|jd}|jtks0t‚|dks<t‚| d¡dt|ƒ…dksZt‚|jjddkst‚qdS)N)r†ZDocTyper‰rr~s<!DOCTYPE html>rr€r„rrrÚtest_mixed_case_doctypesÿ
 z0HTMLTreeBuilderSmokeTest.test_mixed_case_doctypecCsd}| |¡dS)Nznhtml PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"rŠ)rr†rrrÚtest_public_doctype_with_url“sz5HTMLTreeBuilderSmokeTest.test_public_doctype_with_urlcCs| d¡dS)Nz$foo SYSTEM "http://www.example.com/"rŠrrrrÚtest_system_doctype—sz,HTMLTreeBuilderSmokeTest.test_system_doctypecCs| d¡dS)Nz#xsl:stylesheet SYSTEM "htmlent.dtd"rŠrrrrÚtest_namespaced_system_doctypešsz7HTMLTreeBuilderSmokeTest.test_namespaced_system_doctypecCs| d¡dS)Nz#xsl:stylesheet PUBLIC "htmlent.dtd"rŠrrrrÚtest_namespaced_public_doctypežsz7HTMLTreeBuilderSmokeTest.test_namespaced_public_doctypec    CsXd}tjdd}| |¡}W5QRX| d¡ dd¡| dd¡ksHt‚|gksTt‚dS)zJA real XHTML document should come out more or less the same as it went in.óÓ<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Hello.</title></head>
<body>Goodbye.</body>
</html>T©Úrecordúutf-8ó
óN)ÚwarningsÚcatch_warningsrr‚Úreplacer%©rrÚwrrrrÚtest_real_xhtml_document¢s
"z1HTMLTreeBuilderSmokeTest.test_real_xhtml_documentc    CsLd}tjdd}| |¡}W5QRXdt| d¡ƒks<t‚g|ksHt‚dS)Ns.<ns1:foo>content</ns1:foo><ns1:foo/><ns2:foo/>Tr”ruzns1:foo)r™ršrr3Úfind_allr%rœrrrÚtest_namespaced_html³s
z-HTMLTreeBuilderSmokeTest.test_namespaced_htmlc    Csdd}tjdd }| |¡}|jjdks,t‚W5QRX|\}t|jtƒsLt‚t    |jƒtj
ks`t‚dS)Ns7<?xml version="1.0" encoding="utf-8"?><tag>string</tag>Tr”r<) r™ršrr>r<r%r5ÚmessagerÚstrZMESSAGE)rrrrÚwarningrrrÚtest_detect_xml_parsed_as_htmlÀs
z7HTMLTreeBuilderSmokeTest.test_detect_xml_parsed_as_htmlcCsBd}| |¡}|| ¡kst‚d}| |¡}|| d¡ks>t‚dS)Nz<?PITarget PIContent?>s<?PITarget PIContent?>r~)rr$r%r‚rVrrrÚtest_processing_instructionÐs 
 
z4HTMLTreeBuilderSmokeTest.test_processing_instructioncCst |j¡dS)z°Make sure you can copy the tree builder.
 
        This is important because the builder is part of a
        BeautifulSoup object, and we want to be able to copy that.
        N)ÚcopyÚdeepcopyrrrrrÚ test_deepcopyÝsz&HTMLTreeBuilderSmokeTest.test_deepcopycCs,| d¡}|jjrt‚t|jƒdks(t‚dS)z©A <p> tag is never designated as an empty-element tag.
 
        Even if the markup shows it as an empty-element tag, it
        shouldn't be presented that way.
        ú<p/>ú<p></p>N)rrƒrnr%r¢rrrrrÚ!test_p_tag_is_never_empty_elementås
 z:HTMLTreeBuilderSmokeTest.test_p_tag_is_never_empty_elementcCs(| dd¡| dd¡| dd¡dS)zŠA tag that's not closed by the end of the document should be closed.
 
        This applies to all tags except empty-element tags.
        ú<p>rªz<b>z<b></b>z<br>ú<br/>N©r*rrrrÚtest_unclosed_tags_get_closedïs  z6HTMLTreeBuilderSmokeTest.test_unclosed_tags_get_closedcCs,| d¡}|jjst‚t|jƒdks(t‚dS)zÂA <br> tag is designated as an empty-element tag.
 
        Some parsers treat <br></br> as one <br/> tag, some parsers as
        two tags, but it should always be an empty-element tag.
        z    <br></br>r­N)rr^rnr%r¢rrrrrÚ#test_br_is_always_empty_element_tagùs
 z<HTMLTreeBuilderSmokeTest.test_br_is_always_empty_element_tagcCs| d¡dS)Nz<em><em></em></em>r®rrrrÚtest_nested_formatting_elementssz8HTMLTreeBuilderSmokeTest.test_nested_formatting_elementscCs(d}| |¡}d| d¡dks$t‚dS)Nz¯<!DOCTYPE html>
<html>
<head>
<title>Ordinary HEAD element test</title>
</head>
<script type="text/javascript">
alert("Help!");
</script>
<body>
Hello, world!
</body>
</html>
ztext/javascriptrqÚtype)rÚfindr%)rr‰rrrrÚtest_double_heads
z)HTMLTreeBuilderSmokeTest.test_double_headcCsjd}| |¡| |¡}|jdd}|jtks2t‚|jdd}||jksLt‚|jdd}||jksft‚dS)Nz<p>foo<!--foobar-->baz</p>Zfoobarr;rÚbaz)r*rr³rzrr%r+r,)rrrÚcommentrrµrrrÚ test_comments
 
   z%HTMLTreeBuilderSmokeTest.test_commentcCstd}d}| |¡| |¡| |¡}|j ¡|ks8t‚| |¡}|j ¡|ksTt‚| d¡}|j ¡dkspt‚dS)zWhitespace must be preserved in <pre> and <textarea> tags,
        even if that would mean not prettifying the markup.
        z<pre>a   z</pre>
z <textarea> woo
woo  </textarea>
z<textarea></textarea>z<textarea></textarea>
N)r*rÚpreZprettifyr%Útextarea)rZ
pre_markupZtextarea_markuprrrrÚ-test_preserved_whitespace_in_pre_and_textarea&s
 
 
 
 
zFHTMLTreeBuilderSmokeTest.test_preserved_whitespace_in_pre_and_textareacCs.d}| |¡d}| |¡d}| |¡dS)z+Inline elements can be nested indefinitely.z<b>Inside a B tag</b>z!<p>A <i>nested <b>tag</b></i></p>z/<p>A <a>doubly <i>nested <b>tag</b></i></a></p>Nr®)rZb_tagZ nested_b_tagZdouble_nested_b_tagrrrÚtest_nested_inline_elements8s 
 
z4HTMLTreeBuilderSmokeTest.test_nested_inline_elementscCs6| d¡}|j}|jjjdks"t‚|jjdks2t‚dS)zBlock elements can be nested.z*<blockquote><p><b>Foo</b></p></blockquote>ZFooN)rÚ
blockquoterƒrMr<r%)rrr¼rrrÚ test_nested_block_level_elementsCs
z9HTMLTreeBuilderSmokeTest.test_nested_block_level_elementscCsd}| |d¡| d¡dS)z$One table can go inside another one.z[<table id="1"><tr><td>Here's another table:<table id="2"><tr><td>foo</td></tr></table></td>zh<table id="1"><tr><td>Here's another table:<table id="2"><tr><td>foo</td></tr></table></td></tr></table>z{<table><thead><tr><td>Foo</td></tr></thead><tbody><tr><td>Bar</td></tr></tbody><tfoot><tr><td>Baz</td></tr></tfoot></table>Nr®)rrrrrÚtest_correctly_nested_tablesJsþÿz5HTMLTreeBuilderSmokeTest.test_correctly_nested_tablescCs@d}| |¡}ddg|jdks$t‚|j|jdddks<t‚dS)Nz<div class=" foo bar     "></a>rÚbarrLÚdivzfoo bar)Úclass_)rrÀr%r³rVrrrÚ*test_multivalued_attribute_with_whitespace^s
zCHTMLTreeBuilderSmokeTest.test_multivalued_attribute_with_whitespacecCs(d}| |¡}dg|jjdks$t‚dS)Nz1<table><div><div class="css"></div></div></table>ÚcssrL)rrÀr%rVrrrÚ(test_deeply_nested_multivalued_attributejs
zAHTMLTreeBuilderSmokeTest.test_deeply_nested_multivalued_attributecCs(d}| |¡}ddg|jdks$t‚dS)Nz<html class="a b"></html>rQrMrL)rr‰r%rVrrrÚ"test_multivalued_attribute_on_htmlrs
z;HTMLTreeBuilderSmokeTest.test_multivalued_attribute_on_htmlcCs| dd¡dS)Nz<a b="<a>"></a>z<a b="&lt;a&gt;"></a>r®rrrrÚ3test_angle_brackets_in_attribute_values_are_escapedzszLHTMLTreeBuilderSmokeTest.test_angle_brackets_in_attribute_values_are_escapedcCs| dd¡dS)Nz$<p>&bull; AT&T is in the s&p 500</p>u)<p>• AT&amp;T is in the s&amp;p 500</p>r®rrrrÚ3test_strings_resembling_character_entity_references}sþzLHTMLTreeBuilderSmokeTest.test_strings_resembling_character_entity_referencescCs| dd¡dS)Nz<p>Bob&apos;s Bar</p>z<p>Bob's Bar</p>r®rrrrÚtest_apos_entity…sþz)HTMLTreeBuilderSmokeTest.test_apos_entitycCs"d}| |¡}d|jjkst‚dS)Nz%<p>&#147;Hello&#148; &#45;&#9731;</p>u“Hello” -☃©rrƒr<r%rVrrrÚ*test_entities_in_foreign_document_encoding‹s
zCHTMLTreeBuilderSmokeTest.test_entities_in_foreign_document_encodingcCs8d}| d|¡| d|¡| d|¡| d|¡dS)Nu<p id="piñata"></p>z<p id="pi&#241;ata"></p>z<p id="pi&#xf1;ata"></p>z<p id="pi&#Xf1;ata"></p>z<p id="pi&ntilde;ata"></p>r®©rÚexpectrrrÚ0test_entities_in_attributes_converted_to_unicode—s
   zIHTMLTreeBuilderSmokeTest.test_entities_in_attributes_converted_to_unicodecCs8d}| d|¡| d|¡| d|¡| d|¡dS)Nu<p>piñata</p>z<p>pi&#241;ata</p>z<p>pi&#xf1;ata</p>z<p>pi&#Xf1;ata</p>z<p>pi&ntilde;ata</p>r®rËrrrÚ*test_entities_in_text_converted_to_unicodežs
   zCHTMLTreeBuilderSmokeTest.test_entities_in_text_converted_to_unicodecCs| dd¡dS)Nz#<p>I said &quot;good day!&quot;</p>z<p>I said "good day!"</p>r®rrrrÚ,test_quot_entity_converted_to_quotation_mark¥sÿzEHTMLTreeBuilderSmokeTest.test_quot_entity_converted_to_quotation_markcCs,d}| d|¡| d|¡| d|¡dS)Nu�z&#10000000000000;z&#x10000000000000;z &#1000000000;r®rËrrrÚtest_out_of_range_entity©s  z1HTMLTreeBuilderSmokeTest.test_out_of_range_entitycCs<| d¡}d|jjjjkst‚d|jjks.t‚| |¡dS)zDMostly to prevent a recurrence of a bug in the html5lib treebuilder.z!<html><h2>
foo</h2><p></p></html>rƒN)rÚh2r<r+r!r%rƒr/rrrrrÚtest_multipart_strings¯s
z/HTMLTreeBuilderSmokeTest.test_multipart_stringscCs| dd¡| dd¡dS)zqVerify consistent handling of empty-element tags,
        no matter how they come in through the markup.
        z<br/><br/><br/>z<br /><br /><br />Nr®rrrrro¶s cCs,d}| |¡}|jjdk    st‚| |¡dS)ú8Prevent recurrence of a bug in the html5lib treebuilder.z?<html><head></head>
  <link></link>
  <body>foo</body>
</html>
N)rr‰Úbodyr%r/©rÚcontentrrrrÚ#test_head_tag_between_head_and_body½s
z<HTMLTreeBuilderSmokeTest.test_head_tag_between_head_and_bodycCsd}| |¡}| |j¡dS)rÓz<!DOCTYPE html>
<html>
 <body>
   <article id="a" >
   <div><a href="1"></div>
   <footer>
     <a href="2"></a>
   </footer>
  </article>
  </body>
</html>
N)rr/ÚarticlerÕrrrÚtest_multiple_copies_of_a_tagÈs
z6HTMLTreeBuilderSmokeTest.test_multiple_copies_of_a_tagcCs^d}| |¡}|| ¡kst‚|j}d|jdks6t‚d|jdksHt‚d|jdksZt‚dS)    z†Parsers don't need to *understand* namespaces, but at the
        very least they should not choke on namespaces or lose
        data.sÙ<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg"><head></head><body><mathml:msqrt>4</mathml:msqrt><b svg:fill="red"></b></body></html>úhttp://www.w3.org/1999/xhtmlÚxmlnsú"http://www.w3.org/1998/Math/MathMLz xmlns:mathmlúhttp://www.w3.org/2000/svgz    xmlns:svgN)rr‚r%r‰)rrrr‰rrrÚtest_basic_namespacesÙs
z.HTMLTreeBuilderSmokeTest.test_basic_namespacescCs(d}| |¡}ddg|jdks$t‚dS)Ns<a class="foo bar">rr¿rLrPrVrrrÚ-test_multivalued_attribute_value_becomes_listæs
zFHTMLTreeBuilderSmokeTest.test_multivalued_attribute_value_becomes_listcCs"d}| |¡}d|jjkst‚dS)NuD<html><head><meta encoding="euc-jp"></head><body>Sacré bleu!</body>õ Sacré bleu!)rrÔr<r%rVrrrÚtest_can_parse_unicode_documentòs
z8HTMLTreeBuilderSmokeTest.test_can_parse_unicode_documentcCs*tdƒ}|jd|d}| ¡dks&t‚dS)z2Parsers should be able to work with SoupStrainers.rMz&A <b>bold</b> <meta/> <i>statement</i>)Z
parse_onlyz <b>bold</b>N)r    rr$r%)rZstrainerrrrrÚtest_soupstrainerús
ÿz*HTMLTreeBuilderSmokeTest.test_soupstrainercCs| dd¡dS)Nz<foo attr='bar'></foo>z<foo attr="bar"></foo>r®rrrrÚ7test_single_quote_attribute_values_become_double_quotessÿzPHTMLTreeBuilderSmokeTest.test_single_quote_attribute_values_become_double_quotescCsd}| |¡dS)Nú'<foo attr='bar "brawls" happen'>a</foo>r®)rÚtextrrrÚ7test_attribute_values_with_nested_quotes_are_left_aloneszPHTMLTreeBuilderSmokeTest.test_attribute_values_with_nested_quotes_are_left_alonecCs.d}| |¡}d|jd<| |j ¡d¡dS)NräzBrawls happen at "Bob's Bar"Úattrz:<foo attr="Brawls happen at &quot;Bob's Bar&quot;">a</foo>)rrr*r$)rrårrrrÚ:test_attribute_values_with_double_nested_quotes_get_quoted    s
 
þzSHTMLTreeBuilderSmokeTest.test_attribute_values_with_double_nested_quotes_get_quotedcCs| dd¡| dd¡dS)Nz+<this is="really messed up & stuff"></this>z/<this is="really messed up &amp; stuff"></this>z.<a href="http://example.org?a=1&b=2;3">foo</a>z2<a href="http://example.org?a=1&amp;b=2;3">foo</a>r®rrrrÚ.test_ampersand_in_attribute_value_gets_escapedsÿþzGHTMLTreeBuilderSmokeTest.test_ampersand_in_attribute_value_gets_escapedcCs| d¡dS)Nz/<a href="http://example.org?a=1&amp;b=2;3"></a>r®rrrrÚ7test_escaped_ampersand_in_attribute_value_is_left_aloneszPHTMLTreeBuilderSmokeTest.test_escaped_ampersand_in_attribute_value_is_left_alonecCsd}d}| ||¡dS)Nú-<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>õ#<p>&lt;&lt;sacré bleu!&gt;&gt;</p>r®)rråÚexpectedrrrÚ1test_entities_in_strings_converted_during_parsingszJHTMLTreeBuilderSmokeTest.test_entities_in_strings_converted_during_parsingcCs"d}| |¡}|jjdkst‚dS)Ns <p>‘Foo’</p>u    â€˜Foo’rÉ)rÚquoterrrrÚ)test_smart_quotes_converted_on_the_way_in#s
zBHTMLTreeBuilderSmokeTest.test_smart_quotes_converted_on_the_way_incCs| d¡}|jjdkst‚dS)Nz<a>&nbsp;&nbsp;</a>u  )rrQr<r%rrrrrÚ0test_non_breaking_spaces_converted_on_the_way_in*s
zIHTMLTreeBuilderSmokeTest.test_non_breaking_spaces_converted_on_the_way_incCs0d}d d¡}| |¡}|j d¡|ks,t‚dS)Nrërìr–)r‚rrƒr%)rrårírrrrÚ&test_entities_converted_on_the_way_out.s
 
z?HTMLTreeBuilderSmokeTest.test_entities_converted_on_the_way_outcCsHd}| d¡}| |¡}| d¡}| dd¡}| d¡}||ksDt‚dS)Nuƒ<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-type"/></head><body><p>Sacré bleu!</p></body></html>z
iso-8859-1r–z
ISO-8859-1)r‚rr›r%)rÚ unicode_htmlZiso_latin_htmlrÚresultrírrrÚtest_real_iso_8859_document4s
 
 
 
z4HTMLTreeBuilderSmokeTest.test_real_iso_8859_documentcCsLd}| d¡}| |¡}| d¡| d¡ks0t‚| d¡| d¡ksHt‚dS)Nsk<html><head></head><body><pre>‚±‚ê‚ÍShift-JIS‚ŃR[ƒfƒBƒ“ƒO‚³‚ꂽ“ú–{Œê‚̃tƒ@ƒCƒ‹‚Å‚·B</pre></body></html>z    shift-jisr–Úeuc_jp)r$rr‚r%)rÚshift_jis_htmlrórrrrÚtest_real_shift_jis_documentPs ÿ
 
z5HTMLTreeBuilderSmokeTest.test_real_shift_jis_documentcCsBd}|j|dd}|jdks t‚| d¡| d¡ d¡ks>t‚dS)Ns›<html><head><title>Hebrew (ISO 8859-8) in Visual Directionality</title></head><body><h1>Hebrew (ISO 8859-8) in Visual Directionality</h1>íåìù</body></html>ú    iso8859-8)Z from_encoding)rùz
iso-8859-8r–)rZoriginal_encodingr%r‚r$)rZhebrew_documentrrrrÚtest_real_hebrew_documentasÿÿz2HTMLTreeBuilderSmokeTest.test_real_hebrew_documentcCs^d}d|}| |¡}| dddi¡}|d}d|ks:t‚t|tƒsHt‚d| d    ¡ksZt‚dS)
NzE<meta content="text/html; charset=x-sjis" http-equiv="Content-type"/>új<html><head>
%s
<meta http-equiv="Content-language" content="ja"/></head><body>Shift-JIS markup goes here.rfz
http-equivz Content-typerÖztext/html; charset=x-sjisztext/html; charset=utf8r~)rr³r%r5rr‚)rÚmeta_tagr÷rÚ parsed_metarÖrrrÚ'test_meta_tag_reflects_current_encodingnsý
 z@HTMLTreeBuilderSmokeTest.test_meta_tag_reflects_current_encodingcCs\d}d|}| |¡}|jddd}|d}d|ks8t‚t|tƒsFt‚d| d¡ksXt‚dS)    Nz'<meta id="encoding" charset="x-sjis" />rûrfÚencodingrCÚcharsetzx-sjisr~)rr³r%r5rr‚)rrür÷rrýrrrrÚ3test_html5_style_meta_tag_reflects_current_encodingŠsý
 zLHTMLTreeBuilderSmokeTest.test_html5_style_meta_tag_reflects_current_encodingcCsTdD]J}| |¡}tD]6}|dkr$q| |¡}d|ks:t‚| d¡|kst‚qqdS)N)sB<meta charset="utf8"></head><meta id="encoding" charset="utf-8" />©ÚidnaÚmbcsÚoemZ    undefinedZ string_escapez string-escapesmeta charset=""Úascii©rrr‚r%©rrrrÿÚencodedrrrÚ2test_python_specific_encodings_not_used_in_charset¢s
 
 zKHTMLTreeBuilderSmokeTest.test_python_specific_encodings_not_used_in_charsetcCs*| d¡}d|jd<d|j ¡ks&t‚dS)Nz <a>text</a>r¿rz<a foo="bar">text</a>)rrQr$r%)rÚdatarrrÚ5test_tag_with_no_attributes_can_have_attributes_added¹s
 
zNHTMLTreeBuilderSmokeTest.test_tag_with_no_attributes_can_have_attributes_addedcCs | d¡}d|j ¡kst‚dS)Nz0<body><div><p>text1</p></span>text2</div></body>z)<body><div><p>text1</p>text2</div></body>)rrÔr$r%rrrrrÚ$test_closing_tag_with_no_opening_tag¾s
z=HTMLTreeBuilderSmokeTest.test_closing_tag_with_no_opening_tagcCs| t¡}| |¡dS©z3Test the worst case (currently) for linking issues.N©rÚ BAD_DOCUMENTr6rrrrrÚtest_worst_caseÆs
z(HTMLTreeBuilderSmokeTest.test_worst_caseN)rˆ)CrFrGrHÚ__doc__rorsr}r‡rr‹rrŽrrr‘r’ržr r¤r¥r¨r«r¯r°r±r´r·rºr»r½r¾rÂrÄrÅrÆrÇrÈrÊrÍrÎrÏrÐrÒr×rÙrÞrßrárârãrærèrérêrîrðrñròrõrørúrþrr
r r rrrrrr[2s‚     
 
 
 
       r[c@s´eZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Z    dd„Z
dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+S),ÚXMLTreeBuilderSmokeTestcCsF| d¡}t |d¡}t |¡}|jtks.t‚| ¡| ¡ksBt‚dSrtrvr{rrrr}Ïs
 
 
z9XMLTreeBuilderSmokeTest.test_pickle_and_unpickle_identitycCs| d¡}| ¡dkst‚dS)Nú<root/>s.<?xml version="1.0" encoding="utf-8"?>
<root/>©rr‚r%rrrrrÚtest_docstring_generatedØs
z0XMLTreeBuilderSmokeTest.test_docstring_generatedcCs$d}| |¡}|| d¡ks t‚dS)Ns,<?xml version="1.0" encoding="utf8"?>
<foo/>r~rrVrrrÚtest_xml_declarationÜs
z,XMLTreeBuilderSmokeTest.test_xml_declarationcCsNd}| |¡}tD]6}|dkr q| |¡}d|ks6t‚| d¡|kst‚qdS)Ns<?xml version="1.0"?>
<foo/>rs<?xml version="1.0"?>rrrrrrÚ:test_python_specific_encodings_not_used_in_xml_declarationás
 
 zRXMLTreeBuilderSmokeTest.test_python_specific_encodings_not_used_in_xml_declarationcCs$d}| |¡}|| d¡ks t‚dS)Ns<<?xml version="1.0" encoding="utf8"?>
<?PITarget PIContent?>r~rrVrrrr¥ôs
z3XMLTreeBuilderSmokeTest.test_processing_instructioncCs$d}| |¡}| d¡|ks t‚dS)zGA real XHTML document should come out *exactly* the same as it went in.r“r–NrrVrrrržùs
z0XMLTreeBuilderSmokeTest.test_real_xhtml_documentcCs"d}| |¡}|| ¡kst‚dS)Ns<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<parent xmlns="http://ns1/">
<child xmlns="http://ns2/" xmlns:ns3="http://ns3/">
<grandchild ns3:attr="value" xmlns="http://ns4/"/>
</child>
</parent>r©rÚdocrrrrÚtest_nested_namespacess
z.XMLTreeBuilderSmokeTest.test_nested_namespacescCs.d}t|dƒ}d|j_| ¡}d|ks*t‚dS)Nz/
  <script type="text/javascript">
  </script>
zlxml-xmlzconsole.log("< < hey > > ");s&lt; &lt; hey &gt; &gt;)rrqr<r‚r%)rrrr    rrrÚ5test_formatter_processes_script_tag_for_xml_documentss
 
zMXMLTreeBuilderSmokeTest.test_formatter_processes_script_tag_for_xml_documentscCs"d}| |¡}d|jjkst‚dS)Nu?<?xml version="1.0" encoding="euc-jp"><root>Sacré bleu!</root>rà©rÚrootr<r%rVrrrrás
z7XMLTreeBuilderSmokeTest.test_can_parse_unicode_documentcCs"d}| |¡}d|jjkst‚dS)NuB<?xml version="1.0" encoding="euc-jp"><root>Sacré bleu!</root>ràrrVrrrÚ1test_can_parse_unicode_document_begining_with_bom s
zIXMLTreeBuilderSmokeTest.test_can_parse_unicode_document_begining_with_bomcCs$d}| |¡}t|jƒ|ks t‚dS)Nzƒ<rss xmlns:dc="foo"><dc:creator>b</dc:creator><dc:date>2012-07-02T20:33:42Z</dc:date><dc:rights>c</dc:rights><image>d</image></rss>)rr¢Zrssr%rVrrrÚtest_popping_namespaced_tag%s
z3XMLTreeBuilderSmokeTest.test_popping_namespaced_tagcCs | d¡}| d¡dkst‚dS)NrÚlatin1s/<?xml version="1.0" encoding="latin1"?>
<root/>rrrrrrÚ(test_docstring_includes_correct_encoding*s
z@XMLTreeBuilderSmokeTest.test_docstring_includes_correct_encodingcCs$d}| |¡}| d¡|ks t‚dS)z<A large XML document should come out the same as it went in.s4<?xml version="1.0" encoding="utf-8"?>
<root>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</root>r–NrrVrrrÚtest_large_xml_document.s
z/XMLTreeBuilderSmokeTest.test_large_xml_documentcCs| dd¡| d¡dS)Nr¬r©z
<p>foo</p>r®rrrrÚ9test_tags_are_empty_element_if_and_only_if_they_are_empty6s zQXMLTreeBuilderSmokeTest.test_tags_are_empty_element_if_and_only_if_they_are_emptycCs8d}| |¡}|j}d|dks$t‚d|dks4t‚dS)Nz£<root xmlns:a="http://example.com/" xmlns:b="http://example.net/"><a:foo>This tag is in the a namespace</a:foo><b:foo>This tag is in the b namespace</b:foo></root>zhttp://example.com/zxmlns:azhttp://example.net/zxmlns:b)rrr%)rrrrrrrÚtest_namespaces_are_preserved:s
 
z5XMLTreeBuilderSmokeTest.test_namespaces_are_preservedcCs$d}| |¡}t|jƒ|ks t‚dS)NzN<p xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>20010504</dc:date></p>)rr¢rƒr%rVrrrÚtest_closing_namespaced_tagAs
z3XMLTreeBuilderSmokeTest.test_closing_namespaced_tagcCs$d}| |¡}t|jƒ|ks t‚dS)Nzs<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><bar xsi:schemaLocation="http://www.example.com"/></foo>©rr¢rr%rVrrrÚtest_namespaced_attributesFs
z2XMLTreeBuilderSmokeTest.test_namespaced_attributescCs$d}| |¡}t|jƒ|ks t‚dS)Nz<foo xml:lang="fr">bar</foo>r'rVrrrÚ(test_namespaced_attributes_xml_namespaceKs
z@XMLTreeBuilderSmokeTest.test_namespaced_attributes_xml_namespacecCsˆd}| |¡}dt| d¡ƒks$t‚dt| d¡ƒks:t‚dt| d¡ƒksPt‚dsjtt|jddd    ƒƒ‚ds„tt| ddg¡ƒƒ‚dS)
Na<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="http://example.com/ns0"
    xmlns:ns1="http://example.com/ns1"
    xmlns:ns2="http://example.com/ns2"
    <ns1:tag>foo</ns1:tag>
    <ns1:tag>bar</ns1:tag>
    <ns2:tag key="value">baz</ns2:tag>
</Document>
ér>ruzns1:tagr0zns2:tagÚvalue)Úkey)rr3rŸr%rrrrÚtest_find_by_prefixed_namePs    
z2XMLTreeBuilderSmokeTest.test_find_by_prefixed_namecCs2d}| |¡}|j}t |¡}|j|jks.t‚dS)Nzf<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:w="http://example.com/ns0"/>)rÚdocumentr¦Úprefixr%)rÚxmlrr>Z    duplicaterrrÚ!test_copy_tag_preserves_namespacefs
 
 
z9XMLTreeBuilderSmokeTest.test_copy_tag_preserves_namespacecCs| t¡}| |¡dSrrrrrrrrqs
z'XMLTreeBuilderSmokeTest.test_worst_caseN)rFrGrHr}rrrr¥ržrrrárr r"r#r$r%r&r(r)r-r1rrrrrrÍs*        rc@s8eZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd S) ÚHTML5TreeBuilderSmokeTestz2Smoke test for a tree builder that supports HTML5.cCsdSrrrrrrrž{sz2HTML5TreeBuilderSmokeTest.test_real_xhtml_documentcCs"d}| |¡}d|jjkst‚dS)Nz<a>rÚ)rrQÚ    namespacer%rVrrrÚtest_html_tags_have_namespace€s
z7HTML5TreeBuilderSmokeTest.test_html_tags_have_namespacecCs6d}| |¡}d}||jjks"t‚||jjks2t‚dS)Nz<svg><circle/></svg>rÝ)rÚsvgr3r%Zcircle©rrrr3rrrÚtest_svg_tags_have_namespace…s
 
z6HTML5TreeBuilderSmokeTest.test_svg_tags_have_namespacecCs6d}| |¡}d}||jjks"t‚||jjks2t‚dS)Nz<math><msqrt>5</msqrt></math>rÜ)rÚmathr3r%Zmsqrtr6rrrÚtest_mathml_tags_have_namespaces
 
z9HTML5TreeBuilderSmokeTest.test_mathml_tags_have_namespacecCsNd}| |¡}t|jdtƒs"t‚|jddks4t‚d|jdjjksJt‚dS)Nz3<?xml version="1.0" encoding="utf-8"?><html></html>rz$?xml version="1.0" encoding="utf-8"?r‰)rr5r4rr%r+r!rVrrrÚ$test_xml_declaration_becomes_comment”s
 
z>HTML5TreeBuilderSmokeTest.test_xml_declaration_becomes_commentN)    rFrGrHrržr4r7r9r:rrrrr2xs r2)*rÚ __license__rwr¦Ú    functoolsr™rXZbs4rZ bs4.elementrrrrrr    r
r r Z bs4.builderr rrrZ    soupsieverZSOUP_SIEVE_PRESENTÚ ImportErrorÚhtml5libZHTML5LIB_PRESENTZ
lxml.etreeÚlxmlZ LXML_PRESENTÚetreeZ LXML_VERSIONrÚobjectrrJr[rr2rrrrÚ<module>sP ,  
 
 
%< ,