
-Pc           @   s   d  Z  d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z m	 Z	 m
 Z
 m Z m Z d d l m Z e Z d e j f d     YZ d	 e f d
     YZ d e f d     YZ d e f d     YZ d   Z d S(   s   Helper classes for tests.iN(   t   TestCase(   t   BeautifulSoup(   t   CharsetMetaAttributeValuet   Commentt   ContentMetaAttributeValuet   Doctypet   SoupStrainer(   t   HTMLParserTreeBuildert   SoupTestc           B   s5   e  Z e d     Z d   Z d   Z d d  Z RS(   c         C   s   t    S(   N(   t   default_builder(   t   self(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR	      s    c         K   s(   | j  d |  j  } t | d | | S(   s*   Build a Beautiful Soup object from markup.t   builder(   t   popR	   R   (   R
   t   markupt   kwargsR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   soup   s    c         C   s   |  j  j |  S(   s[   Turn an HTML fragment into a document.

        The details depend on the builder.
        (   R	   t   test_fragment_to_document(   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   document_for   s    c         C   sS   |  j  } t | d | } | d  k r0 | } n  |  j | j   |  j |   d  S(   NR   (   R	   R   t   Nonet   assertEqualt   decodeR   (   R
   t   to_parset   compare_parsed_toR   t   obj(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   assertSoupEquals&   s
    		N(   t   __name__t
   __module__t   propertyR	   R   R   R   R   (    (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR      s   		t   HTMLTreeBuilderSmokeTestc           B   s  e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d    Z" d!   Z# d"   Z$ d#   Z% d$   Z& d%   Z' d&   Z( d'   Z) d(   Z* d)   Z+ d*   Z, RS(+   sC  A 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.
    c         C   s   |  j  |  \ } } | j d } |  j | j t  |  j | |  |  j t |  t |   |  |  j | j j d d  d S(   s8   Assert that a given doctype string is handled correctly.i    t   fooN(   t   _document_with_doctypet   contentsR   t	   __class__R   t   strt   lent   p(   R
   t   doctype_fragmentt   doctype_strR   t   doctype(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   assertDoctypeHandled9   s     c         C   s-   d | } | d } |  j  |  } | | f S(   s5   Generate and parse a document with the given doctype.s   <!DOCTYPE %s>s   
<p>foo</p>(   R   (   R
   R$   R&   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR   G   s    

c         C   s   |  j  d  |  j  d  d S(   s?   Make sure normal, everyday HTML doctypes are handled correctly.t   htmls4   html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"N(   R'   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_normal_doctypesN   s    c         C   s   d } |  j  |  d  S(   Nsn   html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"(   R'   (   R
   R&   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_public_doctype_with_urlT   s    c         C   s   |  j  d  d  S(   Ns$   foo SYSTEM "http://www.example.com/"(   R'   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_system_doctypeX   s    c         C   s   |  j  d  d  S(   Ns#   xsl:stylesheet SYSTEM "htmlent.dtd"(   R'   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_namespaced_system_doctype[   s    c         C   s   |  j  d  d  S(   Ns#   xsl:stylesheet PUBLIC "htmlent.dtd"(   R'   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_namespaced_public_doctype_   s    c         C   sJ   d } |  j  |  } |  j | j d  j d d  | j d d   d S(   sJ   A 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>s   utf-8s   
t    N(   R   R   t   encodet   replace(   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_real_xhtml_documentc   s
    c         C   s   t  j |  j  d S(   s   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(   t   copyt   deepcopyR	   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_deepcopyp   s    c         C   s?   |  j  d  } |  j | j j  |  j t | j  d  d S(   s   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.
        s   <p/>s   <p></p>N(   R   t   assertFalseR#   t   is_empty_elementR   R!   (   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt!   test_p_tag_is_never_empty_elementx   s    c         C   s4   |  j  d d  |  j  d d  |  j  d d  d S(   s   A tag that's not closed by the end of the document should be closed.

        This applies to all tags except empty-element tags.
        s   <p>s   <p></p>s   <b>s   <b></b>s   <br>s   <br/>N(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_unclosed_tags_get_closed   s    c         C   s?   |  j  d  } |  j | j j  |  j t | j  d  d S(   s   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.
        s	   <br></br>s   <br/>N(   R   t
   assertTruet   brR6   R   R!   (   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt#   test_br_is_always_empty_element_tag   s    c         C   s   |  j  d  d  S(   Ns   <em><em></em></em>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_nested_formatting_elements   s    c         C   sK   d } |  j  |  |  j |  } | j d d  } |  j | j t  d  S(   Ns   <p>foo<!--foobar-->baz</p>t   textt   foobar(   R   R   t   findR   R    R   (   R
   R   R   t   comment(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_comment   s
    c         C   s   |  j  d  |  j  d  d S(   s:   Whitespace must be preserved in <pre> and <textarea> tags.s   <pre>   </pre>s   <textarea> woo  </textarea>N(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt-   test_preserved_whitespace_in_pre_and_textarea   s    c         C   s=   d } |  j  |  d } |  j  |  d } |  j  |  d S(   s+   Inline elements can be nested indefinitely.s   <b>Inside a B tag</b>s!   <p>A <i>nested <b>tag</b></i></p>s/   <p>A <a>doubly <i>nested <b>tag</b></i></a></p>N(   R   (   R
   t   b_tagt   nested_b_tagt   double_nested_b_tag(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_nested_inline_elements   s    c         C   sK   |  j  d  } | j } |  j | j j j d  |  j | j j d  d S(   s   Block elements can be nested.s*   <blockquote><p><b>Foo</b></p></blockquote>t   FooN(   R   t
   blockquoteR   R#   t   bt   string(   R
   R   RH   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt    test_nested_block_level_elements   s    	c         C   s'   d } |  j  | d  |  j  d  d S(   s$   One table can go inside another one.s[   <table id="1"><tr><td>Here's another table:<table id="2"><tr><td>foo</td></tr></table></td>sh   <table id="1"><tr><td>Here's another table:<table id="2"><tr><td>foo</td></tr></table></td></tr></table>s{   <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   (   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_correctly_nested_tables   s    c         C   s6   d } |  j  |  } |  j d g | j j d  d  S(   Ns1   <table><div><div class="css"></div></div></table>t   csst   class(   R   R   t   div(   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt(   test_deeply_nested_multivalued_attribute   s    c         C   s   |  j  d d  d  S(   Ns   <a b="<a>"></a>s   <a b="&lt;a&gt;"></a>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt3   test_angle_brackets_in_attribute_values_are_escaped   s    c         C   s:   d } |  j  d |  |  j  d |  |  j  d |  d  S(   Nu   <p id="piñata"></p>s   <p id="pi&#241;ata"></p>s   <p id="pi&#xf1;ata"></p>s   <p id="pi&ntilde;ata"></p>(   R   (   R
   t   expect(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt0   test_entities_in_attributes_converted_to_unicode   s    c         C   s:   d } |  j  d |  |  j  d |  |  j  d |  d  S(   Nu   <p>piñata</p>s   <p>pi&#241;ata</p>s   <p>pi&#xf1;ata</p>s   <p>pi&ntilde;ata</p>(   R   (   R
   RR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt*   test_entities_in_text_converted_to_unicode   s    c         C   s   |  j  d d  d  S(   Ns#   <p>I said &quot;good day!&quot;</p>s   <p>I said "good day!"</p>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt,   test_quot_entity_converted_to_quotation_mark   s    	c         C   s:   d } |  j  d |  |  j  d |  |  j  d |  d  S(   Nu   �s   &#10000000000000;s   &#x10000000000000;s   &#1000000000;(   R   (   R
   RR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_out_of_range_entity   s    c         C   s}   d } |  j  |  } |  j | | j    | j } |  j d | j d  |  j d | j d  |  j d | j d  d S(	   s   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>s   http://www.w3.org/1999/xhtmlt   xmlnss"   http://www.w3.org/1998/Math/MathMLs   xmlns:mathmls   http://www.w3.org/2000/svgs	   xmlns:svgN(   R   R   R/   R(   (   R
   R   R   R(   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_basic_namespaces   s    	c         C   s6   d } |  j  |  } |  j d d g | j d  d  S(   Ns   <a class="foo bar">R   t   barRN   (   R   R   t   a(   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt-   test_multivalued_attribute_value_becomes_list   s    c         C   s;   t  d  } |  j d d | } |  j | j   d  d S(   s2   Parsers should be able to work with SoupStrainers.RI   s&   A <b>bold</b> <meta/> <i>statement</i>t
   parse_onlys   <b>bold</b>N(   R   R   R   R   (   R
   t   strainerR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_soupstrainer	  s    	c         C   s   |  j  d d  d  S(   Ns   <foo attr='bar'></foo>s   <foo attr="bar"></foo>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt7   test_single_quote_attribute_values_become_double_quotes  s    	c         C   s   d } |  j  |  d  S(   Ns'   <foo attr='bar "brawls" happen'>a</foo>(   R   (   R
   R=   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt7   test_attribute_values_with_nested_quotes_are_left_alone  s    c         C   s?   d } |  j  |  } d | j d <|  j | j j   d  d  S(   Ns'   <foo attr='bar "brawls" happen'>a</foo>s   Brawls happen at "Bob's Bar"t   attrs:   <foo attr="Brawls happen at &quot;Bob's Bar&quot;">a</foo>(   R   R   R   R   (   R
   R=   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt:   test_attribute_values_with_double_nested_quotes_get_quoted  s    c         C   s$   |  j  d d  |  j  d d  d  S(   Ns+   <this is="really messed up & stuff"></this>s/   <this is="really messed up &amp; stuff"></this>s.   <a href="http://example.org?a=1&b=2;3">foo</a>s2   <a href="http://example.org?a=1&amp;b=2;3">foo</a>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt.   test_ampersand_in_attribute_value_gets_escaped   s
    	c         C   s   |  j  d  d  S(   Ns/   <a href="http://example.org?a=1&amp;b=2;3"></a>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt7   test_escaped_ampersand_in_attribute_value_is_left_alone(  s    c         C   s    d } d } |  j  | |  d  S(   Ns-   <p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>u#   <p>&lt;&lt;sacré bleu!&gt;&gt;</p>(   R   (   R
   R=   t   expected(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt1   test_entities_in_strings_converted_during_parsing+  s    c         C   s/   d } |  j  |  } |  j | j j d  d  S(   Ns   <p>Foo</p>u	   ‘Foo’(   R   R   R#   RJ   (   R
   t   quoteR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt)   test_smart_quotes_converted_on_the_way_in2  s
    	c         C   s)   |  j  d  } |  j | j j d  d  S(   Ns   <a>&nbsp;&nbsp;</a>u    i   u     (   R   R   RZ   RJ   (   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt0   test_non_breaking_spaces_converted_on_the_way_in;  s    c         C   sD   d } d j  d  } |  j |  } |  j | j j  d  |  d  S(   Ns-   <p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>u#   <p>&lt;&lt;sacré bleu!&gt;&gt;</p>s   utf-8(   R/   R   R   R#   (   R
   R=   Re   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt&   test_entities_converted_on_the_way_out?  s    c         C   sh   d } | j  d  } |  j |  } | j  d  } | j d d  } | j  d  } |  j | |  d  S(   Nu   <html><head><meta content="text/html; charset=ISO-Latin-1" http-equiv="Content-type"/></head><body><p>Sacré bleu!</p></body></html>s
   iso-8859-1s   utf-8s   ISO-Latin-1(   R/   R   R0   R   (   R
   t   unicode_htmlt   iso_latin_htmlR   t   resultRe   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_real_iso_latin_documentE  s    c         C   sl   d } | j  d  } |  j |  } |  j | j d  | j d   |  j | j d  | j d   d  S(   Nsk   <html><head></head><body><pre>Shift-JISŃR[fBOꂽ{̃t@CłB</pre></body></html>s	   shift-jiss   utf-8t   euc_jp(   R   R   R   R/   (   R
   t   shift_jis_htmlRk   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_real_shift_jis_document`  s
    "c         C   s]   d } |  j  | d d } |  j | j d  |  j | j d  | j d  j d   d  S(   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>t   from_encodings	   iso8859-8s   utf-8(   R   R   t   original_encodingR/   R   (   R
   t   hebrew_documentR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_real_hebrew_documentq  s    c         C   s   d } d | } |  j  |  } | j d i d d 6 } | d } |  j d |  |  j t | t   |  j d | j d	   d  S(
   NsE   <meta content="text/html; charset=x-sjis" http-equiv="Content-type"/>sj   <html><head>
%s
<meta http-equiv="Content-language" content="ja"/></head><body>Shift-JIS markup goes here.t   metas   Content-types
   http-equivt   contents   text/html; charset=x-sjiss   text/html; charset=utf8t   utf8(   R   R?   R   R9   t
   isinstanceR   R/   (   R
   t   meta_tagRp   R   t   parsed_metaRw   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt'   test_meta_tag_reflects_current_encoding|  s    
c         C   s   d } d | } |  j  |  } | j d d d } | d } |  j d |  |  j t | t   |  j d | j d   d  S(	   Ns'   <meta id="encoding" charset="x-sjis" />sj   <html><head>
%s
<meta http-equiv="Content-language" content="ja"/></head><body>Shift-JIS markup goes here.Rv   t   idt   encodingt   charsets   x-sjisRx   (   R   R?   R   R9   Ry   R   R/   (   R
   Rz   Rp   R   R{   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt3   test_html5_style_meta_tag_reflects_current_encoding  s    
c         C   s9   |  j  d  } d | j d <|  j d | j j    d  S(   Ns   <a>text</a>RY   R   s   <a foo="bar">text</a>(   R   RZ   R   R   (   R
   t   data(    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt5   test_tag_with_no_attributes_can_have_attributes_added  s    (-   R   R   t   __doc__R'   R   R)   R*   R+   R,   R-   R1   R4   R7   R8   R;   R<   RA   RB   RF   RK   RL   RP   RQ   RS   RT   RU   RV   RX   R[   R^   R_   R`   Rb   Rc   Rd   Rf   Rh   Ri   Rj   Rn   Rq   Ru   R|   R   R   (    (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR   /   sV   										
	
	
																															t   XMLTreeBuilderSmokeTestc           B   sY   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   c         C   s)   |  j  d  } |  j | j   d  d  S(   Ns   <root/>s.   <?xml version="1.0" encoding="utf-8"?>
<root/>(   R   R   R/   (   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_docstring_generated  s    c         C   s2   d } |  j  |  } |  j | j d  |  d S(   sG   A 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>s   utf-8N(   R   R   R/   (   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR1     s    c         C   s2   d } |  j  |  } |  j t | j  |  d  S(   Ns   <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>(   R   R   t   unicodet   rss(   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_popping_namespaced_tag  s    c         C   s,   |  j  d  } |  j | j d  d  d  S(   Ns   <root/>t   latin1s/   <?xml version="1.0" encoding="latin1"?>
<root/>(   R   R   R/   (   R
   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt(   test_docstring_includes_correct_encoding  s    c         C   s>   d d d d } |  j  |  } |  j | j d  |  d S(	   s<   A large XML document should come out the same as it went in.s-   <?xml version="1.0" encoding="utf-8"?>
<root>t   0i   i   s   </root>s   utf-8Ni   (   R   R   R/   (   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_large_xml_document  s    c         C   s!   |  j  d d  |  j  d  d  S(   Ns   <p>s   <p/>s
   <p>foo</p>(   R   (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt9   test_tags_are_empty_element_if_and_only_if_they_are_empty  s    c         C   sJ   d } |  j  |  } | j } |  j d | d  |  j d | d  d  S(   Ns   <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>s   http://example.com/s   xmlns:as   http://example.net/s   xmlns:b(   R   t   rootR   (   R
   R   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_namespaces_are_preserved  s
    	c         C   s2   d } |  j  |  } |  j t | j  |  d  S(   NsN   <p xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>20010504</dc:date></p>(   R   R   R   R#   (   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_closing_namespaced_tag  s    c         C   s2   d } |  j  |  } |  j t | j  |  d  S(   Nss   <foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><bar xsi:schemaLocation="http://www.example.com"/></foo>(   R   R   R   R   (   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_namespaced_attributes  s    (   R   R   R   R1   R   R   R   R   R   R   R   (    (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR     s   									t   HTML5TreeBuilderSmokeTestc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s2   Smoke test for a tree builder that supports HTML5.c         C   s   d  S(   N(    (   R
   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR1     s    c         C   s/   d } |  j  |  } |  j d | j j  d  S(   Ns   <a>s   http://www.w3.org/1999/xhtml(   R   R   RZ   t	   namespace(   R
   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_html_tags_have_namespace  s    c         C   sK   d } |  j  |  } d } |  j | | j j  |  j | | j j  d  S(   Ns   <svg><circle/></svg>s   http://www.w3.org/2000/svg(   R   R   t   svgR   t   circle(   R
   R   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_svg_tags_have_namespace  s
    c         C   sK   d } |  j  |  } d } |  j | | j j  |  j | | j j  d  S(   Ns   <math><msqrt>5</msqrt></math>s"   http://www.w3.org/1998/Math/MathML(   R   R   t   mathR   t   msqrt(   R
   R   R   R   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   test_mathml_tags_have_namespace  s
    (   R   R   R   R1   R   R   R   (    (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyR     s
   			c            s   d        f d   } | S(   Nc         _   s   d  S(   N(   R   (   t   testt   argsR   (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   nothing  s    c            s    r
   S|  Sd  S(   N(    (   t	   test_item(   R   t	   condition(    s,   ./lib/python2.7/site-packages/bs4/testing.pyt	   decorator  s    (    (   R   t   reasonR   (    (   R   R   s,   ./lib/python2.7/site-packages/bs4/testing.pyt   skipIf  s    	(   R   R2   t	   functoolst   unittestR    t   bs4R   t   bs4.elementR   R   R   R   R   t   bs4.builderR   R	   R   t   objectR   R   R   R   (    (    (    s,   ./lib/python2.7/site-packages/bs4/testing.pyt   <module>   s   ( =