ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ Wc@sdZddlmZddlZddlZddlZddlZddlmZm Z ddl m Z m Z m Z mZddlZddlmZmZmZddlmZmZddlZy ddlmZmZeZWnek rZeZnXejd d ko#ejdkZ d efd YZ!defdYZ"defdYZ"defdYZ#dej$fdYZ%defdYZ&dej$fdYZ'defdYZ(dej$fdYZ)dS(s#Tests of Beautiful Soup as a whole.i(t set_traceN(t BeautifulSouptBeautifulStoneSoup(tCharsetMetaAttributeValuetContentMetaAttributeValuet SoupStrainertNamespacedAttribute(tEntitySubstitutiont UnicodeDammittEncodingDetector(tSoupTesttskipIf(tLXMLTreeBuildertLXMLTreeBuilderForXMLiiitTestConstructorcBs#eZdZdZdZRS(cCs/d}|j|}|jd|jjdS(Nu

éé

uéé(tsoupt assertEqualth1tstring(tselftdataR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_short_unicode_input*scCs/d}|j|}|jd|jjdS(Nu

foobar

ufoobar(RRRR(RRR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_embedded_null/scCs>djd}|j|ddg}|jd|jdS(Nu Räksmörgåssutf-8texclude_encodingss windows-1252(tencodeRRtoriginal_encoding(Rt utf8_dataR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_exclude_encodings4s(t__name__t __module__RRR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR(s  t TestWarningscBsJeZedZdZdZdZdZdZdZ RS(cCs'|jtjd }|j|dS(NiP(t startswithRtNO_PARSER_SPECIFIED_WARNINGt assertTrue(Rtstis_theretv((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt_no_parser_specified<scCsNtjdt}|jd}WdQXt|dj}|j|dS(Ntrecordsi(twarningstcatch_warningstTrueRtstrtmessaget_assert_no_parser_specified(RtwRtmsg((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt#test_warning_if_no_parser_specified@scCsQtjdt}|jdd}WdQXt|dj}|j|dS(NR&sthtmli(R'R(R)RR*R+R,(RR-RR.((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt*test_warning_if_parser_specified_too_vagueFscCsAtjdt}|jdd}WdQX|jg|dS(NR&ss html.parser(R'R(R)RR(RR-R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt,test_no_warning_if_explicit_parser_specifiedLsc Cstjdt"}|jddtd}WdQXt|dj}|jd|k|jd|k|jd|j dS(NR&stparseOnlyThesetbit parse_onlys( R'R(R)RRR*R+R!RR(RR-RR.((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt)test_parseOnlyThese_renamed_to_parse_onlyQs !cCstjdt"}d}|j|dd}WdQXt|dj}|jd|k|jd|k|jd|jdS(NR&sét fromEncodingtutf8it from_encoding( R'R(R)RR*R+R!RR(RR-R8RR.((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt*test_fromEncoding_renamed_to_from_encodingYscCs |jt|jddtdS(Nstno_such_argument(t assertRaisest TypeErrorRR)(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt"test_unrecognized_keyword_argumentbs( RRR)R%R/R1R2R6R:R>(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR:s      cBs5eZdZdZdZdZdZRS(cCstj}|j}zTtjdt}|j|}WdQXt|dj}|j d|kWd|j Xtjdt}|j|}WdQX|j dt |dS(NR&islooks like a filename( ttempfiletNamedTemporaryFiletnameR'R(R)RR*R+R!tcloseRtlen(Rt filehandletfilenameR-RR.((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_disk_file_warninghs   cCsKtjdt}|jd}WdQX|jtd|DdS(NR&shttp://www.crummybytes.com/css$|]}dt|jkVqdS(slooks like a URLN(R*R+(t.0R-((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys }s(R'R(R)RR!tany(Rt warning_listR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_url_warning_with_bytes_urlxscCsKtjdt}|jd}WdQX|jtd|DdS(NR&uhttp://www.crummyunicode.com/css$|]}dt|jkVqdS(slooks like a URLN(R*R+(RGR-((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys s(R'R(R)RR!RH(RRIR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt!test_url_warning_with_unicode_urlscCsKtjdt}|jd}WdQX|jtd|DdS(NR&s$http://www.crummybytes.com/ is greatcss$|]}dt|jkVqdS(slooks like a URLN(R*R+(RGR-((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys s(R'R(R)Rt assertFalseRH(RRIR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt%test_url_warning_with_bytes_and_spacescCsKtjdt}|jd}WdQX|jtd|DdS(NR&u%http://www.crummyuncode.com/ is greatcss$|]}dt|jkVqdS(slooks like a URLN(R*R+(RGR-((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pys s(R'R(R)RRLRH(RRIR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt'test_url_warning_with_unicode_and_spaces(RRRFRJRKRMRN(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRfs     tTestSelectiveParsingcBseZdZRS(cCsAd}td}|j|d|}|j|jddS(Ns&NoYesNoYes YesR4R5sYesYes Yes(RRRR(RtmarkuptstrainerR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_parse_with_soupstrainers (RRRR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyROstTestEntitySubstitutioncBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(s1Standalone tests of the EntitySubstitution class.cCs t|_dS(N(Rtsub(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytsetUpscCs&d}|j|jj|ddS(Nufoo∀☃õbarufoo∀☃õbar(RRTtsubstitute_html(RR"((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_simple_html_substitutionscCs5d}t|}|j|jj|jddS(Nsfoos‘’foo“”(RRRTRVRP(Rtquotestdammit((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_smart_quote_substitutions cCs)d}|j|jj|t|dS(NsWelcome to "my bar"(RRTtsubstitute_xmltFalse(RR"((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytItest_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_falsescCsB|j|jjdtd|j|jjdtddS(NtWelcomes "Welcome"s Bob's Bars "Bob's Bar"(RRTR[R)(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt6test_xml_attribute_quoting_normally_uses_double_quotesscCs)d}|j|jj|tddS(NsWelcome to "my bar"s'Welcome to "my bar"'(RRTR[R)(RR"((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytOtest_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quotesscCs)d}|j|jj|tddS(NsWelcome to "Bob's Bar"s""Welcome to "Bob's Bar""(RRTR[R)(RR"((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytbtest_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotesscCs&d}|j|jj||dS(NsWelcome to "Bob's Bar"(RRTR[(Rtquoted((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt<test_xml_quotes_arent_escaped_when_value_is_not_being_quotedscCs |j|jjdddS(Nsfoosfoo<bar>(RRTR[(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt'test_xml_quoting_handles_angle_bracketsscCs |j|jjdddS(NsAT&TsAT&T(RRTR[(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt#test_xml_quoting_handles_ampersandsscCs |j|jjdddS(Ns ÁT&Ts&Aacute;T&T(RRTR[(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytEtest_xml_quoting_including_ampersands_when_they_are_part_of_an_entityscCs |j|jjdddS(Ns ÁT&TsÁT&T(RRTt"substitute_xml_containing_entities(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytDtest_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entityscCs&d}|j|jj||dS(s:There's no need to do this except inside attribute values.s Bob's "bar"N(RRTRV(Rttext((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt test_quotes_not_html_substituteds(RRt__doc__RURWRZR]R_R`RaRcRdReRfRhRj(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRSs            tTestEncodingConversioncBsMeZdZdZdZdZdZeeddZ RS(cCsHtt|jd|_|jjd|_|j|jddS(NuUSacré bleu!sutf-8sUSacré bleu!(tsuperRlRUt unicode_dataRRR(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRUs  cCstjj}tjtjzd}|tj_d}|j|}|j}|jt |t |j ||j |j|j |j jdWdtjtj|tj_XdS(NcSsdS(N(tNone(R*((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytnoopss asutf-8(tbs4RYtchardet_dammittloggingtdisabletWARNINGRtdecodeR!t isinstancetunicodeRt document_forRtlowertNOTSET(RtchardetRptasciitsoup_from_asciitunicode_output((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_ascii_in_unicode_outs    cCsX|j|j}|j|j|j|j|jjd|j|jddS(Nu Sacré bleu!(RRnRRvtfooRRRo(Rtsoup_from_unicode((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_unicode_in_unicode_outscCsE|j|j}|j|j|j|j|jjddS(Nu Sacré bleu!(RRRRvRnRR(Rtsoup_from_utf8((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_utf8_in_unicode_out scCs2|j|j}|j|jd|jdS(Nsutf-8(RRnRRR(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt test_utf8_outssQBad HTMLParser detected; skipping test of non-ASCII characters in attribute name.cCs8d}|j|j|jjd|jddS(Nu
R8(RRtdivR(RRP((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt1test_attribute_name_containing_unicode_characterss( RRRURRRRR tPYTHON_3_PRE_3_2R(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRls    tTestUnicodeDammitcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZRS(s"Standalone tests of UnicodeDammit.cCs)d}t|}|j|j|dS(NuI'm already Unicode! ☃(RRtunicode_markup(RRPRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_unicode_input"s cCs)d}t|}|j|jddS(Nsu‘’“”(RRR(RRPRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_smart_quotes_to_unicode's cCs/d}t|dd}|j|jddS(Nstsmart_quotes_totxmls+‘’“”(RRR(RRPRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt!test_smart_quotes_to_xml_entities-scCs/d}t|dd}|j|jddS(NsRR0s'‘’“”(RRR(RRPRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt"test_smart_quotes_to_html_entities3scCs/d}t|dd}|j|jddS(NsRR}s''""(RRR(RRPRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_smart_quotes_to_ascii9scCsBd}t|}|j|jjd|j|jddS(NsSacré bleu! ☃sutf-8uSacré bleu! ☃(RRRRzR(RR8RY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_detect_utf8?s cCsHd}t|dg}|j|jjd|j|jddS(Nss iso-8859-8uםולש(RRRRzR(RthebrewRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_convert_hebrewFscCsKd}t|}|j|jjd|j|jjd|dS(Nsケータイ Watchsutf-8(RRRRzRR(Rtutf_8RY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt/test_dont_see_smart_quotes_where_there_are_noneLs cCs>djd}t|dg}|j|jjddS(Nu Räksmörgåssutf-8s iso-8859-8(RRRRRz(RRRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt test_ignore_inappropriate_codecsRscCsXdjd}xBdddgD]1}t||g}|j|jjdqWdS(Nu Räksmörgåssutf-8s.utf8s...s utF---16.!(RRRRRz(RRt bad_encodingRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_ignore_invalid_codecsWscCsldjd}t|ddg}|j|jjdt|dddg}|j|jddS(Nu Räksmörgåssutf-8Rs windows-1252(RRRRRzRo(RRRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyR]s cCstd}t|j}dS(Ns'(R tlistt encodings(RtdetectedR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pytPtest_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterks cCs:x3dD]+}t|dt}|jd|jqWdS(Ns&s&s$s#tis_htmlseuc-jp(s&s&s$s#(RR)RR(RRRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt test_detect_html5_style_meta_tagqs cCsd}tjj}tjtjzmd}|tj_t|}|jt|j |j d|j kt |d}|j |j Wdtjtj |tj_XdS(NsT بتر ѐcSsdS(N(Ro(R*((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRpsu�s html.parser(RqRYRrRsRtRuRRR)tcontains_replacement_charactersR!RRR{(RtdocR|RpRYR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt"test_last_ditch_entity_replacement|s    cCs<d}t|}|jd|j|jd|jdS(Ns<a></a>u áésutf-16le(RRRR(RRRY((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_byte_order_mark_removeds cCsndjd}djd}|||}|jt|jdtj|}|jd|jddS(Nu☃iR8u“Hi, I like Windows!”t windows_1252u+☃☃☃“Hi, I like Windows!”☃☃☃u ☃☃☃(RR<tUnicodeDecodeErrorRvRt detwingleR(RR8RRtfixed((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_detwingles cCsYxRdD]J}|jd}|j|jdtj|}|j||qWdS(Nuœuₓu𐐓R8s(uœuₓu𐐓(RR!tendswithRRR(Rttricky_unicode_chartinputtoutput((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt+test_detwingle_ignores_multibyte_characterss (RRRkRRRRRRRRRRRRRRRRR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRs$             #  tTestNamedspacedAttributecBs#eZdZdZdZRS(cCs#tdd}|j|ddS(Ntxmlns(RRoR(Rta((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyttest_name_may_be_nonescCs#tdd}|jd|dS(NRR4sa:b(RR(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt6test_attribute_is_equivalent_to_colon_separated_stringscCstddd}tddd}|j||tddd}|j||tddd}|j||tddd}|j||dS(NRR4tctz(RRRotassertNotEqual(RRR4Rtdte((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt;test_attributes_are_equivalent_if_prefix_and_name_identicals(RRRRR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRs  t)TestAttributeValueWithCharsetSubstitutioncBseZdZdZRS(cCsLtd}|jd||jd|j|jd|jddS(Nseuc-jpR8(RRtoriginal_valueR(Rtvalue((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyt!test_content_meta_attribute_values cCsLtd}|jd||jd|j|jd|jddS(Nstext/html; charset=euc-jpstext/html; charset=utf8R8(RRRR(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRs (RRR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyRs (ii(*RktpdbRRstunittesttsysR?RqRRt bs4.elementRRRRt bs4.dammitRRR t bs4.testingR R R't bs4.builderR R R)t LXML_PRESENTt ImportErrorRR\t version_infoRRRROtTestCaseRSRlRRR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_soup.pyts4    "    ",/ E<