Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 *6]dOã@s~dZddlmZddlZddlZddlZddlZddlmZm Z ddl m Z m Z m Z mZddlZddlmZmZmZddlmZmZddlZyddlmZmZd ZWn&ek rÊZz d ZWYddZ[XnXejdd koâejdkZGd d„deƒZGdd„deƒZ Gdd„deƒZ Gdd„deƒZ!Gdd„dej"ƒZ#Gdd„deƒZ$Gdd„dej"ƒZ%Gdd„deƒZ&Gdd„dej"ƒZ'dS)z#Tests of Beautiful Soup as a whole.é)Ú set_traceN)Ú BeautifulSoupÚBeautifulStoneSoup)ÚCharsetMetaAttributeValueÚContentMetaAttributeValueÚ SoupStrainerÚNamespacedAttribute)ÚEntitySubstitutionÚ UnicodeDammitÚEncodingDetector)ÚSoupTestÚskipIf)ÚLXMLTreeBuilderÚLXMLTreeBuilderForXMLTFééc@s$eZdZdd„Zdd„Zdd„ZdS)ÚTestConstructorcCs"d}|j|ƒ}|jd|jjƒdS)Nu

éé

uéé)ÚsoupÚ assertEqualÚh1Ústring)ÚselfÚdatar©rú/usr/lib/python3.6/test_soup.pyÚtest_short_unicode_input*s z(TestConstructor.test_short_unicode_inputcCs"d}|j|ƒ}|jd|jjƒdS)Nz

foobar

zfoobar)rrrr)rrrrrrÚtest_embedded_null/s z"TestConstructor.test_embedded_nullcCs,djdƒ}|j|dgd�}|jd|jƒdS)Nu RäksmörgÃ¥szutf-8)Úexclude_encodingsz windows-1252)ÚencoderrÚoriginal_encoding)rÚ utf8_datarrrrÚtest_exclude_encodings4s z&TestConstructor.test_exclude_encodingsN)Ú__name__Ú __module__Ú __qualname__rrr!rrrrr(src@sFeZdZddd„Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dS)Ú TestWarningsTcCs"|jtjdd…ƒ}|j|ƒdS)NéP)Ú startswithrZNO_PARSER_SPECIFIED_WARNINGÚ assertTrue)rÚsZis_thereÚvrrrÚ_no_parser_specified<sz!TestWarnings._no_parser_specifiedc Cs>tjdd��}|jdƒ}WdQRXt|djƒ}|j|ƒdS)NT)Úrecordzr)ÚwarningsÚcatch_warningsrÚstrÚmessageÚ_assert_no_parser_specified)rÚwrÚmsgrrrÚ#test_warning_if_no_parser_specified@sz0TestWarnings.test_warning_if_no_parser_specifiedc Cs@tjdd��}|jddƒ}WdQRXt|djƒ}|j|ƒdS)NT)r,zÚhtmlr)r-r.rr/r0r1)rr2rr3rrrÚ*test_warning_if_parser_specified_too_vagueFsz7TestWarnings.test_warning_if_parser_specified_too_vaguec Cs4tjdd��}|jddƒ}WdQRX|jg|ƒdS)NT)r,zz html.parser)r-r.rr)rr2rrrrÚ,test_no_warning_if_explicit_parser_specifiedLsz9TestWarnings.test_no_warning_if_explicit_parser_specifiedc Cshtjdd��}|jdtdƒd�}WdQRXt|djƒ}|jd|kƒ|jd|kƒ|jd |jƒƒdS) NT)r,zÚb)ÚparseOnlyTheserr9Ú parse_onlys) r-r.rrr/r0r(rr)rr2rr3rrrÚ)test_parseOnlyThese_renamed_to_parse_onlyQs z6TestWarnings.test_parseOnlyThese_renamed_to_parse_onlyc Csftjdd��}d}|j|dd�}WdQRXt|djƒ}|jd|kƒ|jd|kƒ|jd|jƒdS) NT)r,séÚutf8)Ú fromEncodingrr=Z from_encoding)r-r.rr/r0r(rr)rr2r<rr3rrrÚ*test_fromEncoding_renamed_to_from_encodingYsz7TestWarnings.test_fromEncoding_renamed_to_from_encodingcCs|jt|jddd�dS)NzT)Zno_such_argument)Ú assertRaisesÚ TypeErrorr)rrrrÚ"test_unrecognized_keyword_argumentbsz/TestWarnings.test_unrecognized_keyword_argumentN)T) r"r#r$r+r4r6r7r;r>rArrrrr%:s  r%c@s4eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd S) r%cCs’tjƒ}|j}zBtjdd��}|j|ƒ}WdQRXt|djƒ}|jd|kƒWd|j ƒXtjdd��}|j|ƒ}WdQRX|j dt |ƒƒdS)NT)r,rzlooks like a filename) ÚtempfileZNamedTemporaryFileÚnamer-r.rr/r0r(ÚcloserÚlen)rZ filehandleÚfilenamer2rr3rrrÚtest_disk_file_warninghs z#TestWarnings.test_disk_file_warningc Cs>tjdd��}|jdƒ}WdQRX|jtdd„|DƒƒƒdS)NT)r,shttp://www.crummybytes.com/css|]}dt|jƒkVqdS)zlooks like a URLN)r/r0)Ú.0r2rrrú }sz?TestWarnings.test_url_warning_with_bytes_url..)r-r.rr(Úany)rÚ warning_listrrrrÚtest_url_warning_with_bytes_urlxs z,TestWarnings.test_url_warning_with_bytes_urlc Cs>tjdd��}|jdƒ}WdQRX|jtdd„|DƒƒƒdS)NT)r,zhttp://www.crummyunicode.com/css|]}dt|jƒkVqdS)zlooks like a URLN)r/r0)rHr2rrrrI…szATestWarnings.test_url_warning_with_unicode_url..)r-r.rr(rJ)rrKrrrrÚ!test_url_warning_with_unicode_url€s z.TestWarnings.test_url_warning_with_unicode_urlc Cs>tjdd��}|jdƒ}WdQRX|jtdd„|DƒƒƒdS)NT)r,s$http://www.crummybytes.com/ is greatcss|]}dt|jƒkVqdS)zlooks like a URLN)r/r0)rHr2rrrrI‹szETestWarnings.test_url_warning_with_bytes_and_space..)r-r.rÚ assertFalserJ)rrKrrrrÚ%test_url_warning_with_bytes_and_spaceˆs z2TestWarnings.test_url_warning_with_bytes_and_spacec Cs>tjdd��}|jdƒ}WdQRX|jtdd„|DƒƒƒdS)NT)r,z%http://www.crummyuncode.com/ is greatcss|]}dt|jƒkVqdS)zlooks like a URLN)r/r0)rHr2rrrrI‘szGTestWarnings.test_url_warning_with_unicode_and_space..)r-r.rrNrJ)rrKrrrrÚ'test_url_warning_with_unicode_and_spaceŽs z4TestWarnings.test_url_warning_with_unicode_and_spaceN)r"r#r$rGrLrMrOrPrrrrr%fs c@seZdZdd„ZdS)ÚTestSelectiveParsingcCs.d}tdƒ}|j||d�}|j|jƒdƒdS)Nz&NoYesNoYes Yesr8)r:sYesYes Yes)rrrr)rÚmarkupZstrainerrrrrÚtest_parse_with_soupstrainer—sz1TestSelectiveParsing.test_parse_with_soupstrainerN)r"r#r$rSrrrrrQ•srQc@sxeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)ÚTestEntitySubstitutionz1Standalone tests of the EntitySubstitution class.cCs t|_dS)N)r Úsub)rrrrÚsetUp szTestEntitySubstitution.setUpcCsd}|j|jj|ƒdƒdS)Nufoo\u2200☃\u00f5barufoo∀☃õbar)rrUÚsubstitute_html)rr)rrrÚtest_simple_html_substitution£sz4TestEntitySubstitution.test_simple_html_substitutioncCs&d}t|ƒ}|j|jj|jƒdƒdS)Ns‘’foo“”z‘’foo“”)r rrUrWrR)rZquotesÚdammitrrrÚtest_smart_quote_substitutionªsz4TestEntitySubstitution.test_smart_quote_substitutioncCsd}|j|jj|dƒ|ƒdS)NzWelcome to "my bar"F)rrUÚsubstitute_xml)rr)rrrÚItest_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_false²sz`TestEntitySubstitution.test_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_falsecCs0|j|jjddƒdƒ|j|jjddƒdƒdS)NZWelcomeTz "Welcome"z Bob's Barz "Bob's Bar")rrUr[)rrrrÚ6test_xml_attribute_quoting_normally_uses_double_quotes¶szMTestEntitySubstitution.test_xml_attribute_quoting_normally_uses_double_quotescCsd}|j|jj|dƒdƒdS)NzWelcome to "my bar"Tz'Welcome to "my bar"')rrUr[)rr)rrrÚOtest_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quotes¼szfTestEntitySubstitution.test_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quotescCsd}|j|jj|dƒdƒdS)NzWelcome to "Bob's Bar"Tz""Welcome to "Bob's Bar"")rrUr[)rr)rrrÚbtest_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotesÁs zyTestEntitySubstitution.test_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotescCsd}|j|jj|ƒ|ƒdS)NzWelcome to "Bob's Bar")rrUr[)rZquotedrrrÚzfoo<bar>)rrUr[)rrrrÚ'test_xml_quoting_handles_angle_bracketsËs z>TestEntitySubstitution.test_xml_quoting_handles_angle_bracketscCs|j|jjdƒdƒdS)NzAT&TzAT&T)rrUr[)rrrrÚ#test_xml_quoting_handles_ampersandsÐsz:TestEntitySubstitution.test_xml_quoting_handles_ampersandscCs|j|jjdƒdƒdS)Nz ÁT&Tz&Aacute;T&T)rrUr[)rrrrÚEtest_xml_quoting_including_ampersands_when_they_are_part_of_an_entityÓs z\TestEntitySubstitution.test_xml_quoting_including_ampersands_when_they_are_part_of_an_entitycCs|j|jjdƒdƒdS)Nz ÁT&TzÁT&T)rrUZ"substitute_xml_containing_entities)rrrrÚDtest_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entityØs z[TestEntitySubstitution.test_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entitycCsd}|j|jj|ƒ|ƒdS)z:There's no need to do this except inside attribute values.z Bob's "bar"N)rrUrW)rÚtextrrrÚ test_quotes_not_html_substitutedÝsz7TestEntitySubstitution.test_quotes_not_html_substitutedN)r"r#r$Ú__doc__rVrXrZr\r]r^r_r`rarbrcrdrfrrrrrTžsrTcsNeZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zee d ƒd d „ƒZ ‡Z S)ÚTestEncodingConversioncs4tt|ƒjƒd|_|jjdƒ|_|j|jdƒdS)NuUSacré bleu!zutf-8sUSacré bleu!)ÚsuperrhrVÚ unicode_datarr r)r)Ú __class__rrrVçs zTestEncodingConversion.setUpc Cs’tjj}tjtjƒzbdd„}|tj_d}|j|ƒ}|jƒ}|jt |t ƒƒ|j ||j |jƒƒƒ|j |j jƒdƒWdtjtjƒ|tj_XdS)NcSsdS)Nr)r/rrrÚnoopösz>TestEncodingConversion.test_ascii_in_unicode_out..noops azutf-8)Úbs4rYÚchardet_dammitÚloggingÚdisableÚWARNINGrÚdecoder(Ú isinstancer/rZ document_forrÚlowerÚNOTSET)rÚchardetrlÚasciiZsoup_from_asciiZunicode_outputrrrÚtest_ascii_in_unicode_outðs   z0TestEncodingConversion.test_ascii_in_unicode_outcCs@|j|jƒ}|j|jƒ|jƒ|j|jjdƒ|j|jdƒdS)Nu Sacré bleu!)rrjrrrÚfoorr)rÚsoup_from_unicoderrrÚtest_unicode_in_unicode_outs z2TestEncodingConversion.test_unicode_in_unicode_outcCs2|j|jƒ}|j|jƒ|jƒ|j|jjdƒdS)Nu Sacré bleu!)rr rrrrjryr)rZsoup_from_utf8rrrÚtest_utf8_in_unicode_out s z/TestEncodingConversion.test_utf8_in_unicode_outcCs$|j|jƒ}|j|jdƒ|jƒdS)Nzutf-8)rrjrrr )rrzrrrÚ test_utf8_outs z$TestEncodingConversion.test_utf8_outzQBad HTMLParser detected; skipping test of non-ASCII characters in attribute name.cCs(d}|j|j|ƒjjdƒ|jdƒƒdS)Nu
r<)rrZdivr)rrRrrrÚ1test_attribute_name_containing_unicode_charactersszHTestEncodingConversion.test_attribute_name_containing_unicode_characters) r"r#r$rVrxr{r|r}r ÚPYTHON_3_PRE_3_2r~Ú __classcell__rr)rkrrhãs rhc@s˜eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$S)%ÚTestUnicodeDammitz"Standalone tests of UnicodeDammit.cCsd}t|ƒ}|j|j|ƒdS)NuI'm already Unicode! ☃)r rÚunicode_markup)rrRrYrrrÚtest_unicode_input"sz$TestUnicodeDammit.test_unicode_inputcCsd}t|ƒ}|j|jdƒdS)Ns‘’“”z#\u2018\u2019\u201c\u201d)r rr‚)rrRrYrrrÚtest_smart_quotes_to_unicode'sz.TestUnicodeDammit.test_smart_quotes_to_unicodecCs"d}t|dd�}|j|jdƒdS)Ns‘’“”Zxml)Úsmart_quotes_toz+‘’“”)r rr‚)rrRrYrrrÚ!test_smart_quotes_to_xml_entities-s z3TestUnicodeDammit.test_smart_quotes_to_xml_entitiescCs"d}t|dd�}|j|jdƒdS)Ns‘’“”r5)r…z'‘’“”)r rr‚)rrRrYrrrÚ"test_smart_quotes_to_html_entities3s z4TestUnicodeDammit.test_smart_quotes_to_html_entitiescCs"d}t|dd�}|j|jdƒdS)Ns‘’“”rw)r…z''"")r rr‚)rrRrYrrrÚtest_smart_quotes_to_ascii9s z,TestUnicodeDammit.test_smart_quotes_to_asciicCs0d}t|ƒ}|j|jjƒdƒ|j|jdƒdS)NsSacré bleu! ☃zutf-8uSacré bleu! ☃)r rrrtr‚)rr<rYrrrÚtest_detect_utf8?sz"TestUnicodeDammit.test_detect_utf8cCs4d}t|dgƒ}|j|jjƒdƒ|j|jdƒdS)Nsíåìùz iso-8859-8z\u05dd\u05d5\u05dc\u05e9)r rrrtr‚)rÚhebrewrYrrrÚtest_convert_hebrewFs z%TestUnicodeDammit.test_convert_hebrewcCs6d}t|ƒ}|j|jjƒdƒ|j|jjdƒ|ƒdS)Nsケータイ Watchzutf-8)r rrrtr‚r)rÚutf_8rYrrrÚ/test_dont_see_smart_quotes_where_there_are_noneLszATestUnicodeDammit.test_dont_see_smart_quotes_where_there_are_nonecCs,djdƒ}t|dgƒ}|j|jjƒdƒdS)Nu RäksmörgÃ¥szutf-8z iso-8859-8)rr rrrt)rr rYrrrÚ test_ignore_inappropriate_codecsRs  z2TestUnicodeDammit.test_ignore_inappropriate_codecscCs:djdƒ}x*dD]"}t||gƒ}|j|jjƒdƒqWdS)Nu RäksmörgÃ¥szutf-8ú.utf8ú...ú utF---16.!)r�r�r‘)rr rrrt)rr Z bad_encodingrYrrrÚtest_ignore_invalid_codecsWs   z,TestUnicodeDammit.test_ignore_invalid_codecscCsLdjdƒ}t|dgd�}|j|jjƒdƒt|ddgd�}|j|jdƒdS)Nu RäksmörgÃ¥szutf-8)rz windows-1252)rr rrrt)rr rYrrrr!]s  z(TestUnicodeDammit.test_exclude_encodingscCs"tdƒ}t|jƒ}d|kst‚dS)Ns'uutf-�)r ÚlistÚ encodingsÚAssertionError)rZdetectedr”rrrÚPtest_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterks zbTestUnicodeDammit.test_encoding_detector_replaces_junk_in_encoding_name_with_replacement_charactercCs,x&dD]}t|dd�}|jd|jƒqWdS) Nó&ó&ó$ó#T)Zis_htmlzeuc-jp)r—r˜r™rš)r rr)rrrYrrrÚ test_detect_html5_style_meta_tagqs z2TestUnicodeDammit.test_detect_html5_style_meta_tagc Cs„d}tjj}tjtjƒzPdd„}|tj_t|ƒ}|jd|jƒ|j d|j kƒt |dƒ}|j |jƒWdtjtj ƒ|tj_XdS)NsT بتر ÈÒÑ�ÊÑíäcSsdS)Nr)r/rrrrl’szBTestUnicodeDammit.test_last_ditch_entity_replacement..noopTz\ufffdz html.parser) rmrYrnrorprqr rZcontains_replacement_charactersr(r‚rru)rÚdocrvrlrYrrrrÚ"test_last_ditch_entity_replacement|s   z4TestUnicodeDammit.test_last_ditch_entity_replacementcCs,d}t|ƒ}|jd|jƒ|jd|jƒdS)Nsÿþ<a>áé</a>u áézutf-16le)r rr‚r)rrrYrrrÚtest_byte_order_mark_removedŸsz.TestUnicodeDammit.test_byte_order_mark_removedcCsPdjdƒ}djdƒ}|||}|jt|jdƒtj|ƒ}|jd|jdƒƒdS)Nu☃rr<u“Hi, I like Windows!â€�Ú windows_1252u+☃☃☃“Hi, I like Windows!â€�☃☃☃u ☃☃☃)rr?ÚUnicodeDecodeErrorrrr Ú detwingler)rr<rŸrœZfixedrrrÚtest_detwingle¦s   z TestUnicodeDammit.test_detwinglecCsBxs6 ,/ E</