Files
old-nlp/venv/lib/python3.7/site-packages/bs4/__pycache__/testing.cpython-37.pyc

315 lines
41 KiB
Plaintext
Raw Normal View History

2019-10-20 13:16:49 +02:00
B
%<25>]Z<><00>@s<>dZdZddlZddlZddlZddlZddlmZddlmZddl m
Z
m Z m Z m Z mZmZddlmZeZdZGd d
<EFBFBD>d
ej<06>ZGd d <0C>d e<15>ZGd d<0E>de<15>ZGdd<10>de<16>Zdd<12>ZdS)zHelper classes for tests.<2E>MIT<49>N)<01>TestCase)<01> BeautifulSoup)<06>CharsetMetaAttributeValue<75>Comment<6E>ContentMetaAttributeValue<75>Doctype<70> SoupStrainer<65>Tag)<01>HTMLParserTreeBuilderu-
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@sDeZdZedd<02><00>Zdd<04>Zdd<06>Zddd <09>Zd
d <0B>Zdd d<0E>Z dS)<11>SoupTestcCstS)N)<01>default_builder)<01>self<6C>r<00>7/tmp/pip-install-_x9nvcel/beautifulsoup4/bs4/testing.pyr @szSoupTest.default_buildercKs"|<02>d|j<01>}t|fd|i|<02><02>S)z*Build a Beautiful Soup object from markup.<2E>builder)<03>popr r)r<00>markup<75>kwargsrrrr<00>soupDsz SoupTest.soupcKs|jf|<02><01>|<01>S)z[Turn an HTML fragment into a document.
The details depend on the builder.
)r Ztest_fragment_to_document)rrrrrr<00> document_forIszSoupTest.document_forNcCs8|j}t||d<01>}|dkr|}|<00>|<04><03>|<00>|<02><01>dS)N)r)r r<00> assertEqual<61>decoder)rZto_parseZcompare_parsed_tor<00>objrrr<00>assertSoupEqualsPs
 zSoupTest.assertSoupEqualscCs<d}x2|jD](}|r0|<00>||j<02>|<00>||j<03>|}q WdS)zyEnsure that next_element and previous_element are properly
set for all descendants of the given element.
N)Z descendantsr<00> next_element<6E>previous_element)r<00>elementZearlier<65>errr<00>assertConnectednessXs  zSoupTest.assertConnectednessFc Csd}|jdkrh|jdks,td<02>||jd<01><03><01>|jdksJtd<03>||jd<01><03><01>|jdkshtd<04>||jd<01><03><01>d}d}d}t|j<07>d}<07>x<>|jD<00>]<5D>}d}|dk<02>r
|jdk <09>r<>|j|ks<>td<07>||j|<05><03><01>|j|ks<>td<02>||j|<01><03><01>|jdk<08>s<>td<08>||jd<01><03><01>n<>|j|j|dk<08>s>td <09>||j|j|d<00><03><01>|j|dj|k<08>s|td
<EFBFBD>|j|d|j|dj|<05><03><01>|dk <09>r<>|j|k<08>s<>td <0B>||j||jj<07><04><01>|j|k<08>s<>td <0C>||j|<05><03><01>t |t
<EFBFBD><02>r |j<07>r |<00> |d <0A>}|jdk<08>s td
<EFBFBD>||jd<01><03><01>|dk <09>r|}n|}||k<02>rJ|jdk<08>sJtd
<EFBFBD>||jd<01><03><01>|d7}q<>W|dk <09>rd|n|}|dk<08>rv|}|<02>s<>|dk <09>r<>|}xl|dk<08>r<>|jdk<08>s<>td <0C>||jd<01><03><01>Pn2|jdk <09>r<>|j|jk<08>s<>td <0C>||j|j<05><03><01>P|j}<08>q<>WdS|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<00>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) <0C>parentr<00>AssertionError<6F>formatZprevious_siblingZ next_sibling<6E>len<65>contentsr<00>
isinstancer
<00>linkage_validator) r<00>elZ_recursive_callZ
descendant<EFBFBD>idx<64>childZ
last_childZlast_idx<64>targetrrrr'cs<>
   
   "
 

 

  zSoupTest.linkage_validator)N)F)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__<5F>propertyr rrrrr'rrrrr >s  
 r c@s<>eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z dd<0F>Z
dd<11>Z dd<13>Z dd<15>Z dd<17>Zdd<19>Zdd<1B>Zdd<1D>Zdd<1F>Zd d!<21>Zd"d#<23>Zd$d%<25>Zd&d'<27>Zd(d)<29>Zd*d+<2B>Zd,d-<2D>Zd.d/<2F>Zd0d1<64>Zd2d3<64>Zd4d5<64>Zd6d7<64>Zd8d9<64>Zd:d;<3B>Z d<d=<3D>Z!d>d?<3F>Z"d@dA<64>Z#dBdC<64>Z$dDdE<64>Z%dFdG<64>Z&dHdI<64>Z'dJd<03>ZdKdL<64>Z(dMdN<64>Z)dOdP<64>Z*dQdR<64>Z+dSdT<64>Z,dUdV<64>Z-dWdX<64>Z.dYdZ<64>Z/d[d\<5C>Z0d]d^<5E>Z1d_d`<60>Z2dadb<64>Z3dcdd<64>Z4dedf<64>Z5dgdh<64>Z6didj<64>Z7dkdl<64>Z8dmdn<64>Z9dodp<64>Z:dqdr<64>Z;dsdt<64>Z<dudv<64>Z=dwS)x<>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.
cCs4x.dD]&}|<00>d<02>}|<02>|<01>}|<00>d|j<03>qWdS)zmVerify that all HTML4 and HTML5 empty element (aka void element) tags
are handled correctly.
)<12>area<65>base<73>br<62>col<6F>embed<65>hr<68>img<6D>input<75>keygen<65>linkZmenuitem<65>meta<74>param<61>source<63>track<63>wbrZspacer<65>frame<6D>TN)r<00>new_tagr<00>is_empty_element)r<00>namerrBrrr<00>test_empty_element_tags<67>s


z0HTMLTreeBuilderSmokeTest.test_empty_element_tagscCsF|<00>d<01>}t<01>|d<02>}t<01>|<02>}|<00>|jt<06>|<00>|<03><07>|<01><07><00>dS)Nz <a><b>foo</a><3E>)r<00>pickle<6C>dumps<70>loadsr<00> __class__rr)r<00>tree<65>dumped<65>loadedrrr<00>!test_pickle_and_unpickle_identity<74>s

 
z:HTMLTreeBuilderSmokeTest.test_pickle_and_unpickle_identitycCsf|<00>|<01>\}}|jd}|<00>|jt<04>|<00>||<01>|<00>t|<03>dt|<02><01>|<02>|<00>|jjdd<03>dS)z8Assert that a given doctype string is handled correctly.rN<>foo)<08>_document_with_doctyper%rrJr<00>strr$<00>p)r<00>doctype_fragmentZ doctype_strr<00>doctyperrr<00>assertDoctypeHandled<65>s 
 z-HTMLTreeBuilderSmokeTest.assertDoctypeHandledcCs"d|}|d}|<00>|<03>}||fS)z5Generate and parse a document with the given doctype.z <!DOCTYPE %s>z
<p>foo</p>)r)rrSrTrrrrrrPs
z/HTMLTreeBuilderSmokeTest._document_with_doctypecCs|<00>d<01>|<00>d<02>dS)z?Make sure normal, everyday HTML doctypes are handled correctly.<2E>htmlz4html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"N)rU)rrrr<00>test_normal_doctypes
s
z-HTMLTreeBuilderSmokeTest.test_normal_doctypescCs(|<00>d<01>}|jd}|<00>d|<02><03><00>dS)Nz
<!DOCTYPE>rrA)rr%r<00>strip)rrrTrrr<00>test_empty_doctypes

z+HTMLTreeBuilderSmokeTest.test_empty_doctypecCsd}|<00>|<01>dS)Nznhtml PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd")rU)rrTrrr<00>test_public_doctype_with_urlsz5HTMLTreeBuilderSmokeTest.test_public_doctype_with_urlcCs|<00>d<01>dS)Nz$foo SYSTEM "http://www.example.com/")rU)rrrr<00>test_system_doctypesz,HTMLTreeBuilderSmokeTest.test_system_doctypecCs|<00>d<01>dS)Nz#xsl:stylesheet SYSTEM "htmlent.dtd")rU)rrrr<00>test_namespaced_system_doctypesz7HTMLTreeBuilderSmokeTest.test_namespaced_system_doctypecCs|<00>d<01>dS)Nz#xsl:stylesheet PUBLIC "htmlent.dtd")rU)rrrr<00>test_namespaced_public_doctype sz7HTMLTreeBuilderSmokeTest.test_namespaced_public_doctypecCs4d}|<00>|<01>}|<00>|<02>d<02><01>dd<04>|<01>dd<04><02>dS)zJA real XHTML document should come out more or less the same as it went in.s<><?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>zutf-8<>
<EFBFBD>N)rr<00>encode<64>replace)rrrrrr<00>test_real_xhtml_document$s

z1HTMLTreeBuilderSmokeTest.test_real_xhtml_documentcCs(d}|<00>|<01>}|<00>dt|<02>d<03><01><01>dS)ztWhen a namespaced XML document is parsed as HTML it should
be treated as HTML with weird tag names.
s.<ns1:foo>content</ns1:foo><ns1:foo/><ns2:foo/>rFzns1:fooN)rrr$<00>find_all)rrrrrr<00>test_namespaced_html1s
z-HTMLTreeBuilderSmokeTest.test_namespaced_htmlcCsBd}|<00>|<01>}|<00>||<02><02><00>d}|<00>|<01>}|<00>||<02>d<03><01>dS)Nz<?PITarget PIContent?>s<?PITarget PIContent?><3E>utf8)rrrr`)rrrrrr<00>test_processing_instruction9s 

z4HTMLTreeBuilderSmokeTest.test_processing_instructioncCst<00>|j<02>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)<03>copy<70>deepcopyr )rrrr<00> test_deepcopyFsz&HTMLTreeBuilderSmokeTest.test_deepcopycCs.|<00>d<01>}|<00>|jj<03>|<00>t|j<02>d<02>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.
z<p/>z<p></p>N)rZ assertFalserRrCrrQ)rrrrr<00>!test_p_tag_is_never_empty_elementNs
z:HTMLTreeBuilderSmokeTest.test_p_tag_is_never_empty_elementcCs(|<00>dd<02>|<00>dd<04>|<00>dd<06>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.
z<p>z<p></p>z<b>z<b></b>z<br>z<br/>N)r)rrrr<00>test_unclosed_tags_get_closedXs  z6HTMLTreeBuilderSmokeTest.test_unclosed_tags_get_closedcCs.|<00>d<01>}|<00>|jj<03>|<00>t|j<02>d<02>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>z<br/>N)r<00>
assertTruer3rCrrQ)rrrrr<00>#test_br_is_always_empty_element_tagbs
z<HTMLTreeBuilderSmokeTest.test_br_is_always_empty_element_tagcCs|<00>d<01>dS)Nz<em><em></em></em>)r)rrrr<00>test_nested_formatting_elementslsz8HTMLTreeBuilderSmokeTest.test_nested_formatting_elementscCs(d}|<00>|<01>}|<00>d|<02>d<03>d<00>dS)Nz<4E><!DOCTYPE html>
<html>
<head>
<title>Ordinary HEAD element test</title>
</head>
<script type="text/javascript">
alert("Help!");
</script>
<body>
Hello, world!
</body>
</html>
ztext/javascript<70>script<70>type)rr<00>find)rrVrrrr<00>test_double_heados 
z)HTMLTreeBuilderSmokeTest.test_double_headcCsjd}|<00>|<01>|<00>|<01>}|jdd<03>}|<00>|jt<05>|jdd<03>}|<00>||j<06>|jdd<03>}|<00>||j<07>dS)Nz<p>foo<!--foobar-->baz</p>Zfoobar)<01>textrO<00>baz)rrrqrrJrrr)rrr<00>commentrOrtrrr<00> test_comment<6E>s

   z%HTMLTreeBuilderSmokeTest.test_commentcCstd}d}|<00>|<01>|<00>|<02>|<00>|<01>}|<00>|j<03><04>|<01>|<00>|<02>}|<00>|j<05><04>|<02>|<00>d<03>}|<00>|j<05><04>d<03>dS)zWhitespace must be preserved in <pre> and <textarea> tags,
even if that would mean not prettifying the markup.
z<pre> </pre>z<textarea> woo
woo </textarea>z<textarea></textarea>N)rrr<00>preZprettify<66>textarea)rZ
pre_markupZtextarea_markuprrrr<00>-test_preserved_whitespace_in_pre_and_textarea<65>s




zFHTMLTreeBuilderSmokeTest.test_preserved_whitespace_in_pre_and_textareacCs.d}|<00>|<01>d}|<00>|<02>d}|<00>|<02>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>N)r)rZb_tagZ nested_b_tagZdouble_nested_b_tagrrr<00>test_nested_inline_elements<74>s 

z4HTMLTreeBuilderSmokeTest.test_nested_inline_elementscCs6|<00>d<01>}|j}|<00>|jjjd<02>|<00>|jjd<02>dS)zBlock elements can be nested.z*<blockquote><p><b>Foo</b></p></blockquote>ZFooN)r<00>
blockquoterrR<00>b<>string)rrr{rrr<00> test_nested_block_level_elements<74>s
z9HTMLTreeBuilderSmokeTest.test_nested_block_level_elementscCsd}|<00>|d<02>|<00>d<03>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>N)r)rrrrr<00>test_correctly_nested_tables<65>s z5HTMLTreeBuilderSmokeTest.test_correctly_nested_tablescCs@d}|<00>|<01>}|<00>ddg|jd<00>|<00>|j|jddd<07><02>dS)Nz<div class=" foo bar "></a>rO<00>bar<61>class<73>divzfoo bar)<01>class_)rrr<>rq)rrrrrr<00>*test_multivalued_attribute_with_whitespace<63>s
zCHTMLTreeBuilderSmokeTest.test_multivalued_attribute_with_whitespacecCs(d}|<00>|<01>}|<00>dg|jjd<00>dS)Nz1<table><div><div class="css"></div></div></table><3E>cssr<73>)rrr<>)rrrrrr<00>(test_deeply_nested_multivalued_attribute<74>s
zAHTMLTreeBuilderSmokeTest.test_deeply_nested_multivalued_attributecCs(d}|<00>|<01>}|<00>ddg|jd<00>dS)Nz<html class="a b"></html><3E>ar|r<>)rrrV)rrrrrr<00>"test_multivalued_attribute_on_html<6D>s
z;HTMLTreeBuilderSmokeTest.test_multivalued_attribute_on_htmlcCs|<00>dd<02>dS)Nz<a b="<a>"></a>z<a b="&lt;a&gt;"></a>)r)rrrr<00>3test_angle_brackets_in_attribute_values_are_escaped<65>szLHTMLTreeBuilderSmokeTest.test_angle_brackets_in_attribute_values_are_escapedcCs|<00>dd<02>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<00>3test_strings_resembling_character_entity_references<65>szLHTMLTreeBuilderSmokeTest.test_strings_resembling_character_entity_referencescCs|<00>dd<02>dS)Nz<p>Bob&apos;s Bar</p>z<p>Bob's Bar</p>)r)rrrr<00>test_apos_entity<74>sz)HTMLTreeBuilderSmokeTest.test_apos_entitycCs"d}|<00>|<01>}|<00>d|jj<03>dS)Nz%<p>&#147;Hello&#148; &#45;&#9731;</p>u“Hello” -☃)rrrRr})rrrrrr<00>*test_entities_in_foreign_document_encoding<6E>s
zCHTMLTreeBuilderSmokeTest.test_entities_in_foreign_document_encodingcCs8d}|<00>d|<01>|<00>d|<01>|<00>d|<01>|<00>d|<01>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<00>expectrrr<00>0test_entities_in_attributes_converted_to_unicodes
   zIHTMLTreeBuilderSmokeTest.test_entities_in_attributes_converted_to_unicodecCs8d}|<00>d|<01>|<00>d|<01>|<00>d|<01>|<00>d|<01>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)rr<>rrr<00>*test_entities_in_text_converted_to_unicodes
   zCHTMLTreeBuilderSmokeTest.test_entities_in_text_converted_to_unicodecCs|<00>dd<02>dS)Nz#<p>I said &quot;good day!&quot;</p>z<p>I said "good day!"</p>)r)rrrr<00>,test_quot_entity_converted_to_quotation_markszEHTMLTreeBuilderSmokeTest.test_quot_entity_converted_to_quotation_markcCs,d}|<00>d|<01>|<00>d|<01>|<00>d|<01>dS)Nu<00>z&#10000000000000;z&#x10000000000000;z &#1000000000;)r)rr<>rrr<00>test_out_of_range_entitys  z1HTMLTreeBuilderSmokeTest.test_out_of_range_entitycCs<|<00>d<01>}|<00>d|jjjj<05>|<00>d|jj<05>|<00>|<01>dS)zDMostly to prevent a recurrence of a bug in the html5lib treebuilder.z!<html><h2>
foo</h2><p></p></html>rRN)rr<00>h2r}rrDrRr)rrrrr<00>test_multipart_stringss
z/HTMLTreeBuilderSmokeTest.test_multipart_stringscCs|<00>dd<01>|<00>dd<01>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 />N)r)rrrrrEs cCs,d}|<00>|<01>}|<00>d|jj<03>|<00>|<02>dS)z8Prevent recurrence of a bug in the html5lib treebuilder.z?<html><head></head>
<link></link>
<body>foo</body>
</html>
N)rZassertNotEqualrV<00>bodyr)r<00>contentrrrr<00>#test_head_tag_between_head_and_body&s
z<HTMLTreeBuilderSmokeTest.test_head_tag_between_head_and_bodycCsd}|<00>|<01>}|<00>|j<02>dS)z8Prevent recurrence of a bug in the html5lib treebuilder.z<><!DOCTYPE html>
<html>
<body>
<article id="a" >
<div><a href="1"></div>
<footer>
<a href="2"></a>
</footer>
</article>
</body>
</html>
N)rr<00>article)rr<>rrrr<00>test_multiple_copies_of_a_tag1s 
z6HTMLTreeBuilderSmokeTest.test_multiple_copies_of_a_tagcCs^d}|<00>|<01>}|<00>||<02><02><00>|j}|<00>d|jd<00>|<00>d|jd<00>|<00>d|jd<00>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>zhttp://www.w3.org/1999/xhtml<6D>xmlnsz"http://www.w3.org/1998/Math/MathMLz xmlns:mathmlzhttp://www.w3.org/2000/svgz xmlns:svgN)rrr`rV)rrrrVrrr<00>test_basic_namespacesBs
z.HTMLTreeBuilderSmokeTest.test_basic_namespacescCs(d}|<00>|<01>}|<00>ddg|jd<00>dS)Ns<a class="foo bar">rOr<>r<>)rrr<>)rrrrrr<00>-test_multivalued_attribute_value_becomes_listQs
zFHTMLTreeBuilderSmokeTest.test_multivalued_attribute_value_becomes_listcCs"d}|<00>|<01>}|<00>d|jj<03>dS)NuD<html><head><meta encoding="euc-jp"></head><body>Sacré bleu!</body>u Sacré bleu!)rrr<>r})rrrrrr<00>test_can_parse_unicode_document]s
z8HTMLTreeBuilderSmokeTest.test_can_parse_unicode_documentcCs*td<01>}|jd|d<03>}|<00>|<02><03>d<04>dS)z2Parsers should be able to work with SoupStrainers.r|z&A <b>bold</b> <meta/> <i>statement</i>)Z
parse_onlyz <b>bold</b>N)r rrr)rZstrainerrrrr<00>test_soupstraineresz*HTMLTreeBuilderSmokeTest.test_soupstrainercCs|<00>dd<02>dS)Nz<foo attr='bar'></foo>z<foo attr="bar"></foo>)r)rrrr<00>7test_single_quote_attribute_values_become_double_quoteslszPHTMLTreeBuilderSmokeTest.test_single_quote_attribute_values_become_double_quotescCsd}|<00>|<01>dS)Nz'<foo attr='bar "brawls" happen'>a</foo>)r)rrsrrr<00>7test_attribute_values_with_nested_quotes_are_left_alonepszPHTMLTreeBuilderSmokeTest.test_attribute_values_with_nested_quotes_are_left_alonecCs.d}|<00>|<01>}d|jd<|<00>|j<01><03>d<04>dS)Nz'<foo attr='bar "brawls" happen'>a</foo>zBrawls happen at "Bob's Bar"<22>attrz:<foo attr="Brawls happen at &quot;Bob's Bar&quot;">a</foo>)rrOrr)rrsrrrr<00>:test_attribute_values_with_double_nested_quotes_get_quotedts 

zSHTMLTreeBuilderSmokeTest.test_attribute_values_with_double_nested_quotes_get_quotedcCs|<00>dd<02>|<00>dd<04>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<00>.test_ampersand_in_attribute_value_gets_escaped|s
zGHTMLTreeBuilderSmokeTest.test_ampersand_in_attribute_value_gets_escapedcCs|<00>d<01>dS)Nz/<a href="http://example.org?a=1&amp;b=2;3"></a>)r)rrrr<00>7test_escaped_ampersand_in_attribute_value_is_left_alone<6E>szPHTMLTreeBuilderSmokeTest.test_escaped_ampersand_in_attribute_value_is_left_alonecCsd}d}|<00>||<02>dS)Nz-<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>u#<p>&lt;&lt;sacré bleu!&gt;&gt;</p>)r)rrs<00>expectedrrr<00>1test_entities_in_strings_converted_during_parsing<6E>szJHTMLTreeBuilderSmokeTest.test_entities_in_strings_converted_during_parsingcCs"d}|<00>|<01>}|<00>|jjd<02>dS)Ns <p><3E>Foo<6F></p>u Foo)rrrRr})r<00>quoterrrr<00>)test_smart_quotes_converted_on_the_way_in<69>s

zBHTMLTreeBuilderSmokeTest.test_smart_quotes_converted_on_the_way_incCs|<00>d<01>}|<00>|jjd<02>dS)Nz<a>&nbsp;&nbsp;</a>u  )rrr<>r})rrrrr<00>0test_non_breaking_spaces_converted_on_the_way_in<69>s
zIHTMLTreeBuilderSmokeTest.test_non_breaking_spaces_converted_on_the_way_incCs0d}d<02>d<03>}|<00>|<01>}|<00>|j<03>d<03>|<02>dS)Nz-<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>u#<p>&lt;&lt;sacré bleu!&gt;&gt;</p>zutf-8)r`rrrR)rrsr<>rrrr<00>&test_entities_converted_on_the_way_out<75>s

z?HTMLTreeBuilderSmokeTest.test_entities_converted_on_the_way_outcCsHd}|<01>d<02>}|<00>|<02>}|<03>d<03>}|<01>dd<03>}|<05>d<03>}|<00>||<05>dS)Nu<4E><html><head><meta content="text/html; charset=ISO-Latin-1" http-equiv="Content-type"/></head><body><p>Sacré bleu!</p></body></html>z
iso-8859-1zutf-8z ISO-Latin-1)r`rrar)r<00> unicode_htmlZiso_latin_htmlr<00>resultr<74>rrr<00>test_real_iso_latin_document<6E>s


 
z5HTMLTreeBuilderSmokeTest.test_real_iso_latin_documentcCsLd}|<01>d<02>}|<00>|<02>}|<00>|<03>d<03>|<02>d<03><01>|<00>|<03>d<04>|<02>d<04><01>dS)Nsk<html><head></head><body><pre><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Shift-JIS<49>ŃR<C583>[<5B>f<EFBFBD>B<EFBFBD><42><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EA82BD><EFBFBD>{<7B><><EFBFBD>̃t<CC83>@<40>C<EFBFBD><43><EFBFBD>ł<EFBFBD><C582>B</pre></body></html>z shift-jiszutf-8<>euc_jp)rrrr`)r<00>shift_jis_htmlr<6C>rrrr<00>test_real_shift_jis_document<6E>s


z5HTMLTreeBuilderSmokeTest.test_real_shift_jis_documentcCsBd}|j|dd<03>}|jdks t<02>|<00>|<02>d<05>|<01>d<02><01>d<05><01>dS)Ns<4E><html><head><title>Hebrew (ISO 8859-8) in Visual Directionality</title></head><body><h1>Hebrew (ISO 8859-8) in Visual Directionality</h1><3E><><EFBFBD><EFBFBD></body></html>z iso8859-8)Z from_encoding)z iso8859-8z
iso-8859-8zutf-8)rZoriginal_encodingr"rr`r)rZhebrew_documentrrrr<00>test_real_hebrew_document<6E>s
z2HTMLTreeBuilderSmokeTest.test_real_hebrew_documentcCs`d}d|}|<00>|<02>}|<03>dddi<01>}|d}|<00>d|<05>|<00>t|t<05><02>|<00>d|<05>d <09><01>dS)
NzE<meta content="text/html; charset=x-sjis" http-equiv="Content-type"/>zj<html><head>
%s
<meta http-equiv="Content-language" content="ja"/></head><body>Shift-JIS markup goes here.r;z
http-equivz Content-typer<65>ztext/html; charset=x-sjisztext/html; charset=utf8re)rrqrrlr&rr`)r<00>meta_tagr<67>r<00> parsed_metar<61>rrr<00>'test_meta_tag_reflects_current_encoding<6E>s
 z@HTMLTreeBuilderSmokeTest.test_meta_tag_reflects_current_encodingcCs^d}d|}|<00>|<02>}|jddd<05>}|d}|<00>d|<05>|<00>t|t<05><02>|<00>d|<05>d<08><01>dS) Nz'<meta id="encoding" charset="x-sjis" />zj<html><head>
%s
<meta http-equiv="Content-language" content="ja"/></head><body>Shift-JIS markup goes here.r;<00>encoding)<01>id<69>charsetzx-sjisre)rrqrrlr&rr`)rr<>r<>rr<>r<>rrr<00>3test_html5_style_meta_tag_reflects_current_encoding<6E>s
 zLHTMLTreeBuilderSmokeTest.test_html5_style_meta_tag_reflects_current_encodingcCs*|<00>d<01>}d|jd<|<00>d|j<01><03><00>dS)Nz <a>text</a>r<>rOz<a foo="bar">text</a>)rr<>rr)r<00>datarrr<00>5test_tag_with_no_attributes_can_have_attributes_addeds

zNHTMLTreeBuilderSmokeTest.test_tag_with_no_attributes_can_have_attributes_addedcCs|<00>t<01>}|<00>|<01>dS)z3Test the worst case (currently) for linking issues.N)r<00> BAD_DOCUMENTr')rrrrr<00>test_worst_cases
z(HTMLTreeBuilderSmokeTest.test_worst_caseN)>r,r-r.<00>__doc__rErNrUrPrWrYrZr[r\r]rbrdrfrirjrkrmrnrrrvryrzr~rr<>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<>rrrrr0<00>sx    


       r0c@s<>eZdZdd<02>Zdd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z dd<14>Z dd<16>Z dd<18>Zdd<1A>Zdd<1C>Zdd<1E>Zdd <20>Zd!d"<22>Zd#d$<24>Zd%d&<26>Zd'S)(<28>XMLTreeBuilderSmokeTestcCsF|<00>d<01>}t<01>|d<02>}t<01>|<02>}|<00>|jt<06>|<00>|<03><07>|<01><07><00>dS)Nz <a><b>foo</a>rF)rrGrHrIrrJrr)rrKrLrMrrrrNs

 
z9XMLTreeBuilderSmokeTest.test_pickle_and_unpickle_identitycCs|<00>d<01>}|<00>|<01><02>d<02>dS)Nz<root/>s.<?xml version="1.0" encoding="utf-8"?>
<root/>)rrr`)rrrrr<00>test_docstring_generated%s
z0XMLTreeBuilderSmokeTest.test_docstring_generatedcCs$d}|<00>|<01>}|<00>||<02>d<02><01>dS)Ns,<?xml version="1.0" encoding="utf8"?>
<foo/>re)rrr`)rrrrrr<00>test_xml_declaration*s
z,XMLTreeBuilderSmokeTest.test_xml_declarationcCs$d}|<00>|<01>}|<00>||<02>d<02><01>dS)Ns<<?xml version="1.0" encoding="utf8"?>
<?PITarget PIContent?>re)rrr`)rrrrrrrf/s
z3XMLTreeBuilderSmokeTest.test_processing_instructioncCs$d}|<00>|<01>}|<00>|<02>d<02>|<01>dS)zGA real XHTML document should come out *exactly* the same as it went in.s<><?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>zutf-8N)rrr`)rrrrrrrb4s
z0XMLTreeBuilderSmokeTest.test_real_xhtml_documentcCs"d}|<00>|<01>}|<00>||<02><02><00>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>)rrr`)r<00>docrrrr<00>test_nested_namespaces@s
z.XMLTreeBuilderSmokeTest.test_nested_namespacescCs0d}t|d<02>}d|j_|<02><03>}|<00>d|k<06>dS)Nz/
<script type="text/javascript">
</script>
zlxml-xmlzconsole.log("< < hey > > ");s&lt; &lt; hey &gt; &gt;)rror}r`rl)rr<>r<00>encodedrrr<00>5test_formatter_processes_script_tag_for_xml_documentsKs

zMXMLTreeBuilderSmokeTest.test_formatter_processes_script_tag_for_xml_documentscCs"d}|<00>|<01>}|<00>d|jj<03>dS)Nu?<?xml version="1.0" encoding="euc-jp"><root>Sacré bleu!</root>u Sacré bleu!)rr<00>rootr})rrrrrrr<>Ws
z7XMLTreeBuilderSmokeTest.test_can_parse_unicode_documentcCs$d}|<00>|<01>}|<00>t|j<03>|<01>dS)Nz<4E><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>)rrrQZrss)rrrrrr<00>test_popping_namespaced_tag\s
z3XMLTreeBuilderSmokeTest.test_popping_namespaced_tagcCs |<00>d<01>}|<00>|<01>d<02>d<03>dS)Nz<root/><3E>latin1s/<?xml version="1.0" encoding="latin1"?>
<root/>)rrr`)rrrrr<00>(test_docstring_includes_correct_encodingbs
z@XMLTreeBuilderSmokeTest.test_docstring_includes_correct_encodingcCs$d}|<00>|<01>}|<00>|<02>d<02>|<01>dS)z<A large XML document should come out the same as it went in.s4<?xml version="1.0" encoding="utf-8"?>
<root>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
z/XMLTreeBuilderSmokeTest.test_large_xml_documentcCs|<00>dd<02>|<00>d<03>dS)Nz<p>z<p/>z
<p>foo</p>)r)rrrr<00>9test_tags_are_empty_element_if_and_only_if_they_are_emptyqs zQXMLTreeBuilderSmokeTest.test_tags_are_empty_element_if_and_only_if_they_are_emptycCs8d}|<00>|<01>}|j}|<00>d|d<00>|<00>d|d<00>dS)Nz<4E><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)rr<>r)rrrr<>rrr<00>test_namespaces_are_preservedus

z5XMLTreeBuilderSmokeTest.test_namespaces_are_preservedcCs$d}|<00>|<01>}|<00>t|j<03>|<01>dS)NzN<p xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>20010504</dc:date></p>)rrrQrR)rrrrrr<00>test_closing_namespaced_tag|s
z3XMLTreeBuilderSmokeTest.test_closing_namespaced_tagcCs$d}|<00>|<01>}|<00>t|j<03>|<01>dS)Nzs<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><bar xsi:schemaLocation="http://www.example.com"/></foo>)rrrQrO)rrrrrr<00>test_namespaced_attributes<65>s
z2XMLTreeBuilderSmokeTest.test_namespaced_attributescCs$d}|<00>|<01>}|<00>t|j<03>|<01>dS)Nz<foo xml:lang="fr">bar</foo>)rrrQrO)rrrrrr<00>(test_namespaced_attributes_xml_namespace<63>s
z@XMLTreeBuilderSmokeTest.test_namespaced_attributes_xml_namespacecCs<>d}|<00>|<01>}|<00>dt|<02>d<03><01><01>|<00>dt|<02>d<05><01><01>|<00>dt|<02>d<07><01><01>|<00>dt|jddd <09><02><01>|<00>dt|<02>ddg<02><01><01>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>
<EFBFBD><00>tagrFzns1:tagr zns2:tag<61>value)<01>key)rrr$rc)rr<>rrrr<00>test_find_by_prefixed_name<6D>s 
z2XMLTreeBuilderSmokeTest.test_find_by_prefixed_namecCs2d}|<00>|<01>}|j}t<02>|<03>}|<00>|j|j<04>dS)Nzf<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:w="http://example.com/ns0"/>)r<00>documentrgr<00>prefix)r<00>xmlrr<>Z duplicaterrr<00>!test_copy_tag_preserves_namespace<63>s


z9XMLTreeBuilderSmokeTest.test_copy_tag_preserves_namespacecCs|<00>t<01>}|<00>|<01>dS)z3Test the worst case (currently) for linking issues.N)rr<>r')rrrrrr<><00>s
z'XMLTreeBuilderSmokeTest.test_worst_caseN)r,r-r.rNr<>r<>rfrbr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrrr<>s&      r<>c@s8eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd S) <0A>HTML5TreeBuilderSmokeTestz2Smoke test for a tree builder that supports HTML5.cCsdS)Nr)rrrrrb<00>sz2HTML5TreeBuilderSmokeTest.test_real_xhtml_documentcCs"d}|<00>|<01>}|<00>d|jj<03>dS)Nz<a>zhttp://www.w3.org/1999/xhtml)rrr<><00> namespace)rrrrrr<00>test_html_tags_have_namespace<63>s
z7HTML5TreeBuilderSmokeTest.test_html_tags_have_namespacecCs6d}|<00>|<01>}d}|<00>||jj<03>|<00>||jj<03>dS)Nz<svg><circle/></svg>zhttp://www.w3.org/2000/svg)rr<00>svgr<67>Zcircle)rrrr<>rrr<00>test_svg_tags_have_namespace<63>s

z6HTML5TreeBuilderSmokeTest.test_svg_tags_have_namespacecCs6d}|<00>|<01>}d}|<00>||jj<03>|<00>||jj<03>dS)Nz<math><msqrt>5</msqrt></math>z"http://www.w3.org/1998/Math/MathML)rr<00>mathr<68>Zmsqrt)rrrr<>rrr<00>test_mathml_tags_have_namespace<63>s

z9HTML5TreeBuilderSmokeTest.test_mathml_tags_have_namespacecCsPd}|<00>|<01>}|<00>t|jdt<04><02>|<00>|jdd<03>|<00>d|jdjj<07>dS)Nz3<?xml version="1.0" encoding="utf-8"?><html></html>rz$?xml version="1.0" encoding="utf-8"?rV)rrlr&r%rrrrD)rrrrrr<00>$test_xml_declaration_becomes_comment<6E>s

z>HTML5TreeBuilderSmokeTest.test_xml_declaration_becomes_commentN) r,r-r.r<>rbr<>r<>r<>r<>rrrrr<><00>s r<>csdd<02><00><01><00>fdd<04>}|S)Nc_sdS)Nr)<03>test<73>argsrrrr<00>nothing<6E>szskipIf.<locals>.nothingcs<00>r<08>S|SdS)Nr)Z test_item)<02> conditionr<6E>rr<00> decorator<6F>szskipIf.<locals>.decoratorr)r<><00>reasonr<6E>r)r<>r<>r<00>skipIf<49>sr<>)r<><00> __license__rGrg<00> functoolsZunittestrZbs4rZ bs4.elementrrrrr r
Z bs4.builderr r r<>r <00>objectr0r<>r<>r<>rrrr<00><module>s,   $H#