
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>

Wc           @   s  d  Z  d d l m Z d d l Z d d l Z d d l Z d d l Z d d l m Z m	 Z	 d d l
 m Z m Z m Z m Z d d l Z d d l m Z m Z m Z d d l m Z m Z d d l Z y  d d l m Z m Z e Z Wn e k
 rZ e Z n Xe j d	 d
 k o#e j d k  Z  d e f d     YZ! d e f d     YZ" d e f d     YZ" d e f d     YZ# d e j$ f d     YZ% d e f d     YZ& d e j$ f d     YZ' d e f d     YZ( d e j$ f d     YZ) d S(   s#   Tests of Beautiful Soup as a whole.i(   t	   set_traceN(   t   BeautifulSoupt   BeautifulStoneSoup(   t   CharsetMetaAttributeValuet   ContentMetaAttributeValuet   SoupStrainert   NamespacedAttribute(   t   EntitySubstitutiont   UnicodeDammitt   EncodingDetector(   t   SoupTestt   skipIf(   t   LXMLTreeBuildert   LXMLTreeBuilderForXMLi    i   i   t   TestConstructorc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s/   d } |  j  |  } |  j d | j j  d  S(   Nu   <h1>éé</h1>u   éé(   t   soupt   assertEqualt   h1t   string(   t   selft   dataR   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_short_unicode_input*   s    c         C   s/   d } |  j  |  } |  j d | j j  d  S(   Nu   <h1>foo bar</h1>u   foo bar(   R   R   R   R   (   R   R   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_embedded_null/   s    c         C   s>   d j  d  } |  j | d d g } |  j d | j  d  S(   Nu   Räksmörgåss   utf-8t   exclude_encodingss   windows-1252(   t   encodeR   R   t   original_encoding(   R   t	   utf8_dataR   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_exclude_encodings4   s    (   t   __name__t
   __module__R   R   R   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR   (   s   		t   TestWarningsc           B   sJ   e  Z e d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   c         C   s'   | j  t j d   } |  j |  d  S(   NiP   (   t
   startswithR   t   NO_PARSER_SPECIFIED_WARNINGt
   assertTrue(   R   t   st   is_theret   v(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   _no_parser_specified<   s    c         C   sN   t  j d t   } |  j d  } Wd  QXt | d j  } |  j |  d  S(   Nt   records   <a><b></b></a>i    (   t   warningst   catch_warningst   TrueR   t   strt   messaget   _assert_no_parser_specified(   R   t   wR   t   msg(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt#   test_warning_if_no_parser_specified@   s    c         C   sQ   t  j d t   } |  j d d  } Wd  QXt | d j  } |  j |  d  S(   NR&   s   <a><b></b></a>t   htmli    (   R'   R(   R)   R   R*   R+   R,   (   R   R-   R   R.   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt*   test_warning_if_parser_specified_too_vagueF   s    c         C   sA   t  j d t   } |  j d d  } Wd  QX|  j g  |  d  S(   NR&   s   <a><b></b></a>s   html.parser(   R'   R(   R)   R   R   (   R   R-   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt,   test_no_warning_if_explicit_parser_specifiedL   s    c      	   C   s   t  j d t  " } |  j d d t d  } Wd  QXt | d j  } |  j d | k  |  j d | k  |  j d | j	    d  S(   NR&   s   <a><b></b></a>t   parseOnlyTheset   bi    t
   parse_onlys   <b></b>(
   R'   R(   R)   R   R   R*   R+   R!   R   R   (   R   R-   R   R.   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt)   test_parseOnlyThese_renamed_to_parse_onlyQ   s    !c         C   s   t  j d t  " } d } |  j | d d } Wd  QXt | d j  } |  j d | k  |  j d | k  |  j d | j  d  S(   NR&   s   ét   fromEncodingt   utf8i    t   from_encoding(	   R'   R(   R)   R   R*   R+   R!   R   R   (   R   R-   R8   R   R.   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt*   test_fromEncoding_renamed_to_from_encodingY   s    c         C   s    |  j  t |  j d d t d  S(   Ns   <a>t   no_such_argument(   t   assertRaisest	   TypeErrorR   R)   (   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt"   test_unrecognized_keyword_argumentb   s    (
   R   R   R)   R%   R/   R1   R2   R6   R:   R>   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR   :   s   						c           B   s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C   s   t  j   } | j } zT t j d t   } |  j |  } Wd  QXt | d j  } |  j	 d | k  Wd  | j
   Xt j d t   } |  j |  } Wd  QX|  j d t |   d  S(   NR&   i    s   looks like a filename(   t   tempfilet   NamedTemporaryFilet   nameR'   R(   R)   R   R*   R+   R!   t   closeR   t   len(   R   t
   filehandlet   filenameR-   R   R.   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_disk_file_warningh   s    	c         C   sK   t  j d t   } |  j d  } Wd  QX|  j t d   | D   d  S(   NR&   s   http://www.crummybytes.com/c         s   s$   |  ] } d  t  | j  k Vq d S(   s   looks like a URLN(   R*   R+   (   t   .0R-   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys	   <genexpr>}   s   (   R'   R(   R)   R   R!   t   any(   R   t   warning_listR   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_url_warning_with_bytes_urlx   s    c         C   sK   t  j d t   } |  j d  } Wd  QX|  j t d   | D   d  S(   NR&   u   http://www.crummyunicode.com/c         s   s$   |  ] } d  t  | j  k Vq d S(   s   looks like a URLN(   R*   R+   (   RG   R-   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys	   <genexpr>   s   (   R'   R(   R)   R   R!   RH   (   R   RI   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt!   test_url_warning_with_unicode_url   s    c         C   sK   t  j d t   } |  j d  } Wd  QX|  j t d   | D   d  S(   NR&   s$   http://www.crummybytes.com/ is greatc         s   s$   |  ] } d  t  | j  k Vq d S(   s   looks like a URLN(   R*   R+   (   RG   R-   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys	   <genexpr>   s   (   R'   R(   R)   R   t   assertFalseRH   (   R   RI   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt%   test_url_warning_with_bytes_and_space   s    c         C   sK   t  j d t   } |  j d  } Wd  QX|  j t d   | D   d  S(   NR&   u%   http://www.crummyuncode.com/ is greatc         s   s$   |  ] } d  t  | j  k Vq d S(   s   looks like a URLN(   R*   R+   (   RG   R-   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys	   <genexpr>   s   (   R'   R(   R)   R   RL   RH   (   R   RI   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt'   test_url_warning_with_unicode_and_space   s    (   R   R   RF   RJ   RK   RM   RN   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR   f   s
   				t   TestSelectiveParsingc           B   s   e  Z d    Z RS(   c         C   sA   d } t  d  } |  j | d | } |  j | j   d  d  S(   Ns&   No<b>Yes</b><a>No<b>Yes <c>Yes</c></b>R4   R5   s   <b>Yes</b><b>Yes <c>Yes</c></b>(   R   R   R   R   (   R   t   markupt   strainerR   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_parse_with_soupstrainer   s    (   R   R   RR   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRO      s   t   TestEntitySubstitutionc           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 RS(   s1   Standalone tests of the EntitySubstitution class.c         C   s   t  |  _ d  S(   N(   R   t   sub(   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   setUp   s    c         C   s&   d } |  j  |  j j |  d  d  S(   Nu   foo∀☃õbaru   foo&forall;☃&otilde;bar(   R   RT   t   substitute_html(   R   R"   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_simple_html_substitution   s    c         C   s5   d } t  |  } |  j |  j j | j  d  d  S(   Ns   foos   &lsquo;&rsquo;foo&ldquo;&rdquo;(   R   R   RT   RV   RP   (   R   t   quotest   dammit(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_smart_quote_substitution   s    c         C   s)   d } |  j  |  j j | t  |  d  S(   Ns   Welcome to "my bar"(   R   RT   t   substitute_xmlt   False(   R   R"   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytI   test_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_false   s    c         C   sB   |  j  |  j j d t  d  |  j  |  j j d t  d  d  S(   Nt   Welcomes	   "Welcome"s	   Bob's Bars   "Bob's Bar"(   R   RT   R[   R)   (   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt6   test_xml_attribute_quoting_normally_uses_double_quotes   s    c         C   s)   d } |  j  |  j j | t  d  d  S(   Ns   Welcome to "my bar"s   'Welcome to "my bar"'(   R   RT   R[   R)   (   R   R"   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytO   test_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quotes   s    c         C   s)   d } |  j  |  j j | t  d  d  S(   Ns   Welcome to "Bob's Bar"s"   "Welcome to &quot;Bob's Bar&quot;"(   R   RT   R[   R)   (   R   R"   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytb   test_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotes   s    c         C   s&   d } |  j  |  j j |  |  d  S(   Ns   Welcome to "Bob's Bar"(   R   RT   R[   (   R   t   quoted(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt<   test_xml_quotes_arent_escaped_when_value_is_not_being_quoted   s    c         C   s    |  j  |  j j d  d  d  S(   Ns   foo<bar>s   foo&lt;bar&gt;(   R   RT   R[   (   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt'   test_xml_quoting_handles_angle_brackets   s    c         C   s    |  j  |  j j d  d  d  S(   Ns   AT&Ts   AT&amp;T(   R   RT   R[   (   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt#   test_xml_quoting_handles_ampersands   s    c         C   s    |  j  |  j j d  d  d  S(   Ns   &Aacute;T&Ts   &amp;Aacute;T&amp;T(   R   RT   R[   (   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytE   test_xml_quoting_including_ampersands_when_they_are_part_of_an_entity   s    c         C   s    |  j  |  j j d  d  d  S(   Ns   &Aacute;T&Ts   &Aacute;T&amp;T(   R   RT   t"   substitute_xml_containing_entities(   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytD   test_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entity   s    c         C   s&   d } |  j  |  j j |  |  d S(   s:   There's no need to do this except inside attribute values.s   Bob's "bar"N(   R   RT   RV   (   R   t   text(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt    test_quotes_not_html_substituted   s    (   R   R   t   __doc__RU   RW   RZ   R]   R_   R`   Ra   Rc   Rd   Re   Rf   Rh   Rj   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRS      s   												t   TestEncodingConversionc           B   sM   e  Z d    Z d   Z d   Z d   Z d   Z e e d  d    Z	 RS(   c         C   sH   t  t |   j   d |  _ |  j j d  |  _ |  j |  j d  d  S(   NuU   <html><head><meta charset="utf-8"/></head><body><foo>Sacré bleu!</foo></body></html>s   utf-8sU   <html><head><meta charset="utf-8"/></head><body><foo>Sacré bleu!</foo></body></html>(   t   superRl   RU   t   unicode_dataR   R   R   (   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRU      s    	c         C   s   t  j j } t j t j  z d   } | t  j _ d } |  j |  } | j   } |  j t	 | t
   |  j | |  j | j     |  j | j j   d  Wd  t j t j  | t  j _ Xd  S(   Nc         S   s   d  S(   N(   t   None(   R*   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   noop   s    s   <foo>a</foo>s   utf-8(   t   bs4RY   t   chardet_dammitt   loggingt   disablet   WARNINGR   t   decodeR!   t
   isinstancet   unicodeR   t   document_forR   t   lowert   NOTSET(   R   t   chardetRp   t   asciit   soup_from_asciit   unicode_output(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_ascii_in_unicode_out   s    	c         C   sX   |  j  |  j  } |  j | j   |  j  |  j | j j d  |  j | j d   d  S(   Nu   Sacré bleu!(   R   Rn   R   Rv   t   fooR   R   Ro   (   R   t   soup_from_unicode(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_unicode_in_unicode_out  s    c         C   sE   |  j  |  j  } |  j | j   |  j  |  j | j j d  d  S(   Nu   Sacré bleu!(   R   R   R   Rv   Rn   R   R   (   R   t   soup_from_utf8(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_utf8_in_unicode_out  s    c         C   s2   |  j  |  j  } |  j | j d  |  j  d  S(   Ns   utf-8(   R   Rn   R   R   R   (   R   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_utf8_out  s    sQ   Bad HTMLParser detected; skipping test of non-ASCII characters in attribute name.c         C   s8   d } |  j  |  j |  j j d  | j d   d  S(   Nu    <div><a ☃="snowman"></a></div>R8   (   R   R   t   divR   (   R   RP   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt1   test_attribute_name_containing_unicode_characters  s    (
   R   R   RU   R   R   R   R   R   t   PYTHON_3_PRE_3_2R   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRl      s   						t   TestUnicodeDammitc           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 RS(   s"   Standalone tests of UnicodeDammit.c         C   s)   d } t  |  } |  j | j |  d  S(   Nu   I'm already Unicode! ☃(   R   R   t   unicode_markup(   R   RP   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_unicode_input"  s    c         C   s)   d } t  |  } |  j | j d  d  S(   Ns   <foo></foo>u   <foo>‘’“”</foo>(   R   R   R   (   R   RP   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_smart_quotes_to_unicode'  s    c         C   s/   d } t  | d d } |  j | j d  d  S(   Ns   <foo></foo>t   smart_quotes_tot   xmls+   <foo>&#x2018;&#x2019;&#x201C;&#x201D;</foo>(   R   R   R   (   R   RP   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt!   test_smart_quotes_to_xml_entities-  s    c         C   s/   d } t  | d d } |  j | j d  d  S(   Ns   <foo></foo>R   R0   s'   <foo>&lsquo;&rsquo;&ldquo;&rdquo;</foo>(   R   R   R   (   R   RP   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt"   test_smart_quotes_to_html_entities3  s    c         C   s/   d } t  | d d } |  j | j d  d  S(   Ns   <foo></foo>R   R}   s   <foo>''""</foo>(   R   R   R   (   R   RP   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_smart_quotes_to_ascii9  s    c         C   sB   d } t  |  } |  j | j j   d  |  j | j d  d  S(   Ns   Sacré bleu! ☃s   utf-8u   Sacré bleu! ☃(   R   R   R   Rz   R   (   R   R8   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_detect_utf8?  s    c         C   sH   d } t  | d g  } |  j | j j   d  |  j | j d  d  S(   Ns   s
   iso-8859-8u   םולש(   R   R   R   Rz   R   (   R   t   hebrewRY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_convert_hebrewF  s    c         C   sK   d } t  |  } |  j | j j   d  |  j | j j d  |  d  S(   Ns   ケータイ Watchs   utf-8(   R   R   R   Rz   R   R   (   R   t   utf_8RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt/   test_dont_see_smart_quotes_where_there_are_noneL  s    c         C   s>   d j  d  } t | d g  } |  j | j j   d  d  S(   Nu   Räksmörgåss   utf-8s
   iso-8859-8(   R   R   R   R   Rz   (   R   R   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt    test_ignore_inappropriate_codecsR  s    c         C   sX   d j  d  } xB d d d g D]1 } t | | g  } |  j | j j   d  q Wd  S(   Nu   Räksmörgåss   utf-8s   .utf8s   ...s
   utF---16.!(   R   R   R   R   Rz   (   R   R   t   bad_encodingRY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_ignore_invalid_codecsW  s    c         C   sl   d j  d  } t | d d g } |  j | j j   d  t | d d d g } |  j | j d   d  S(   Nu   Räksmörgåss   utf-8R   s   windows-1252(   R   R   R   R   Rz   Ro   (   R   R   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR   ]  s    c         C   s1   t  d  } t | j  } d | k s- t  d  S(   Ns'   <?xml version="1.0" encoding="UTF-" ?>u   utf-�(   R	   t   listt	   encodingst   AssertionError(   R   t   detectedR   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytP   test_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterk  s    	c         C   s:   x3 d D]+ } t  | d t } |  j d | j  q Wd  S(   Ns&   <html><meta charset="euc-jp" /></html>s&   <html><meta charset='euc-jp' /></html>s$   <html><meta charset=euc-jp /></html>s#   <html><meta charset=euc-jp/></html>t   is_htmls   euc-jp(   s&   <html><meta charset="euc-jp" /></html>s&   <html><meta charset='euc-jp' /></html>s$   <html><meta charset=euc-jp /></html>s#   <html><meta charset=euc-jp/></html>(   R   R)   R   R   (   R   R   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt    test_detect_html5_style_meta_tagq  s       
c         C   s   d } t  j j } t j t j  zm d   } | t  j _ t |  } |  j t | j	  |  j
 d | j k  t | d  } |  j
 | j	  Wd  t j t j  | t  j _ Xd  S(   NsT   ﻿<?xml version="1.0" encoding="UTF-8"?>
<html><b>بتر</b>
<i>ѐ</i></html>c         S   s   d  S(   N(   Ro   (   R*   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRp     s    u   �s   html.parser(   Rq   RY   Rr   Rs   Rt   Ru   R   R   R)   t   contains_replacement_charactersR!   R   R   R{   (   R   t   docR|   Rp   RY   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt"   test_last_ditch_entity_replacement|  s    	c         C   s<   d } t  |  } |  j d | j  |  j d | j  d  S(   Ns   < a >   < / a > u   <a>áé</a>s   utf-16le(   R   R   R   R   (   R   R   RY   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_byte_order_mark_removed  s    c         C   sn   d j  d  } d j  d  } | | | } |  j t | j d  t j |  } |  j d | j d   d  S(   Nu   ☃i   R8   u   “Hi, I like Windows!”t   windows_1252u+   ☃☃☃“Hi, I like Windows!”☃☃☃u	   ☃☃☃(   R   R<   t   UnicodeDecodeErrorRv   R   t	   detwingleR   (   R   R8   R   R   t   fixed(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_detwingle  s    	c         C   sY   xR d D]J } | j  d  } |  j | j d   t j |  } |  j | |  q Wd  S(   Nu   œu   ₓu   ðR8   s   (   u   œu   ₓu   ð(   R   R!   t   endswithR   R   R   (   R   t   tricky_unicode_chart   inputt   output(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt+   test_detwingle_ignores_multibyte_characters  s      
(   R   R   Rk   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR     s$   														#		t   TestNamedspacedAttributec           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s#   t  d d   } |  j | d  d  S(   Nt   xmlns(   R   Ro   R   (   R   t   a(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   test_name_may_be_none  s    c         C   s#   t  d d  } |  j d |  d  S(   NR   R4   s   a:b(   R   R   (   R   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt6   test_attribute_is_equivalent_to_colon_separated_string  s    c         C   s   t  d d d  } t  d d d  } |  j | |  t  d d d   } |  j | |  t  d d d  } |  j | |  t  d d d  } |  j | |  d  S(   NR   R4   t   ct   z(   R   R   Ro   t   assertNotEqual(   R   R   R4   R   t   dt   e(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt;   test_attributes_are_equivalent_if_prefix_and_name_identical  s    (   R   R   R   R   R   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR     s   		t)   TestAttributeValueWithCharsetSubstitutionc           B   s   e  Z d    Z d   Z RS(   c         C   sL   t  d  } |  j d |  |  j d | j  |  j d | j d   d  S(   Ns   euc-jpR8   (   R   R   t   original_valueR   (   R   t   value(    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt!   test_content_meta_attribute_value  s    c         C   sL   t  d  } |  j d |  |  j d | j  |  j d | j d   d  S(   Ns   text/html; charset=euc-jps   text/html; charset=utf8R8   (   R   R   R   R   (   R   R   (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR     s    (   R   R   R   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR     s   	(   i   i   (*   Rk   t   pdbR    Rs   t   unittestt   sysR?   Rq   R   R   t   bs4.elementR   R   R   R   t
   bs4.dammitR   R   R	   t   bs4.testingR
   R   R'   t   bs4.builderR   R   R)   t   LXML_PRESENTt   ImportErrorR   R\   t   version_infoR   R   R   RO   t   TestCaseRS   Rl   R   R   R   (    (    (    s7   /usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt   <module>   s4   "

",/	E<