Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
ó âž_[c@sädZddlmZddlZddlZddlZddlZddlmZddl m Z m Z ddl m Z mZmZmZmZmZmZmZddlmZmZe jdƒek Ze jd ƒek Zd efd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!defd„ƒYZ"defd„ƒYZ#defd„ƒYZ$de$fd„ƒYZ%de$fd„ƒYZ&d efd!„ƒYZ'd"e'fd#„ƒYZ(d$e'fd%„ƒYZ)d&efd'„ƒYZ*d(efd)„ƒYZ+d*efd+„ƒYZ,d,efd-„ƒYZ-d.efd/„ƒYZ.d0efd1„ƒYZ/d2efd3„ƒYZ0d4efd5„ƒYZ1d6efd7„ƒYZ2dS(8s8Tests for Beautiful Soup's tree traversal methods. The tree traversal methods are the main advantage of using Beautiful Soup over just using a parser. Different parsers will build different Beautiful Soup trees given the same markup, but all Beautiful Soup trees can be traversed with the methods tested here. iÿÿÿÿ(t set_traceN(t BeautifulSoup(tbuilder_registrytHTMLParserTreeBuilder(tPY3KtCDatatCommentt DeclarationtDoctypetNavigableStringt SoupStrainertTag(tSoupTesttskipIftxmltlxmltTreeTestcBseZd„Zd„ZRS(cCs*|jg|D]}|j^q |ƒdS(sÝMake sure that the given tags have the correct text. This is used in tests that define a bunch of tags, each containing a single string, and then select certain strings by some mechanism. N(t assertEqualtstring(tselfttagst should_matchttag((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt assertSelects+scCs+|jg|D]}|d^q |ƒdS(sÜMake sure that the given tags have the correct IDs. This is used in tests that define a bunch of tags, each containing a single string, and then select certain strings by some mechanism. tidN(R(RRRR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pytassertSelectsIDs4s(t__name__t __module__RR(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyR)s tTestFindcBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sˆBasic tests of the find() method. find() just calls find_all() with limit=1, so it's not tested all that thouroughly here. cCs/|jdƒ}|j|jdƒjdƒdS(Ns 1234tbt2(tsoupRtfindR(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt test_find_tagEscCs/|jdƒ}|j|jddƒdƒdS(Nu

Räksmörgås

Ru RäksmörgÃ¥s(RRR (RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_unicode_text_findIscCs<|jdƒ}t|ƒ|jd|jddƒjƒdS(Nu&

here it is

s here it isRu RäksmörgÃ¥s(RtstrRR ttext(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_unicode_attribute_findMs cCs/|jdƒ}|jdt|jƒƒƒdS(s)Test an optimization that finds all tags.sfoobariN(RRtlentfind_all(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_everythingSscCs2|jdƒ}|jdt|jdƒƒƒdS(s;Test an optimization that finds all tags with a given name.sfoobarbazitaN(RRR&R'(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_everything_with_nameXs(RRt__doc__R!R"R%R(R*(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyR>s     t TestFindAllcBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s%Basic tests of the find_all() method.cCsÌ|jdƒ}|j|jddƒdgƒ|j|jddƒdgƒ|j|jdddgƒddgƒ|j|jdtjdƒƒddd gƒ|j|jdtƒddd gƒd S( s'You can search the tree for text nodes.sFoobar»RtbarubarR$tFoouFoos.*u»N(RRR'tretcompiletTrue(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_text_nodes`s"cCs¹|jdƒ}|j|jdddƒdddgƒ|j|jdddƒdgƒ|j|jddd ƒdddd d gƒ|j|jddd ƒdddd d gƒd S(s7You can limit the number of items returned by find_all.s(12345R)tlimitit1Rt3ii t4t5iN(RRR'(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_limitps("(cCsQ|jdƒ}|j|dddƒdgƒ|j|jddƒdgƒdS( Ns!123R)R3iR4RtfooR5(RRR(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt%test_calling_a_tag_is_calling_findall|scCs?|jdƒ}g}|j|ƒ|jg|j|ƒƒdS(Ns(RtappendRR'(RRtl((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pytTtest_find_all_with_self_referential_data_structure_does_not_cause_infinite_recursion�s cCs…|jdƒ}|jdƒ}|jt|dƒƒ|jtƒ}|jt|dƒƒ|jddƒ}|jt|dƒƒdS(s%All find_all calls return a ResultSetsR)tsourceR$R9N(RR't assertTruethasattrR1(RRtresult((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_resultset‹s(RRR+R2R8R:R=RB(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyR,]s    tTestFindAllBasicNamespacescBseZd„ZRS(cCsU|jdƒ}|jd|jdƒjƒ|jd|jdidd6ƒjƒdS(Ns04R6s mathml:msqrtR)tattrstredssvg:fill(RRR Rtname(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_by_namespaced_namešs(RRRG(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyRC˜stTestFindAllByNamecBsqeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z RS( s&Test ways of finding tags by tag name.cCs)tt|ƒjƒ|jdƒ|_dS(Ns�First tag. Second tag. Third Nested tag. tag.(tsuperRtsetUpRttree(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyRJ£scCs&|j|jjdƒddgƒdS(NR)s First tag.s Nested tag.(RRKR'(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_tag_name©scCs‚|j|jjdddƒdgƒ|j|jjddtƒddgƒ|j|jjddtjdƒƒddgƒdS(NR)R$s First tag.s Nested tag.R(RRKR'R1R/R0(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_name_and_text®s"cCs&|j|jjjdƒdgƒdS(NR)s Nested tag.(RRKtcR'(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt!test_find_all_on_non_root_elementºscCs#|j|jdƒddgƒdS(NR)s First tag.s Nested tag.(RRK(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt%test_calling_element_invokes_find_all¾scCs,|j|jjtdƒƒddgƒdS(NR)s First tag.s Nested tag.(RRKR'R (R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_tag_strainerÁscCs/|j|jjddgƒdddgƒdS(NR)Rs First tag.s Second tag.s Nested tag.(RRKR'(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_tag_namesÆscCs7|j|jjitd6td6ƒdddgƒdS(NR)Rs First tag.s Second tag.s Nested tag.(RRKR'R1(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_tag_dictËscCs2|j|jjtjdƒƒdddgƒdS(Ns^[ab]$s First tag.s Second tag.s Nested tag.(RRKR'R/R0(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_tag_reÐscCs;d„}|jdƒ}|j|j|ƒddgƒdS(NcSs|j|jdƒkS(NR(RFtget(R((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pytid_matches_nameØssƒMatch 1. Does not match. Match 2.sMatch 1.sMatch 2.(RRR'(RRVRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt'test_find_all_with_tags_matching_methodÕs   cCsª|jdƒ}|jddƒ}|jdtjdƒƒ}|jdddgƒ\}}|jd|jƒ|jd|jƒ|jd|jƒ|jd|jƒdS(NsH
1
2
3
tdivsa dsa bR5R4(RR R/R0R'RR(RRtr1tr2tr3tr4((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt%test_find_with_multi_valued_attributeâs (RRR+RJRLRMRORPRQRRRSRTRWR](((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyRH s         tTestFindAllByAttributecBs˜eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„ZRS(cCs5|jdƒ}|j|jddƒddgƒdS(NsÅ Matching a. Non-matching Matching b.a. Rtfirsts Matching a.s Matching b.(RRR'(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_attribute_nameñs cCs¦djdƒ}djdƒ}|j|ƒ}|j|jg|jd|ƒƒ|j|jg|jd|jdƒƒƒ|j|jg|jd|dgƒƒdS(Nu×�ולשtutf8uttitlessomething else(tencodeRRR)R'tdecode(RtpeacetdataR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt%test_find_all_by_utf8_attribute_valueüs "+cCs~|jdƒ}|j|jddƒdgƒ|j|jdidd6ƒdgƒ|j|jdidd6ƒd gƒdS( Ns0 Name match. Class match. Non-match. A tag called 'name1'. RFtname1sA tag called 'name1'.RDs Name match.tclass2tclasss Class match.(RRR'(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_attribute_dicts   cCsø|jdƒ}|j|jdddƒdgƒ|j|jdddƒdgƒ|j|jddd ƒdgƒ|j|jddƒdgƒ|j|jd dƒddgƒ|j|jddƒdgƒ|j|jdd ƒdgƒdS( Nsî Class 1. Class 2. Class 1. Class 3 and 4. R)tclass_R4sClass 1.RNR5sClass 3 and 4.R6RD(RRR'(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyttest_find_all_by_classs """"cCs¦|jdƒ}|jddtjdƒƒ}|j|dgƒ|jddtjdƒƒ}|j|dgƒ|jddtjdƒƒ}|j|dgƒdS(Ns#Found ittgarRltosFound itR)so b(RR'R/R0R(RRKtf((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt0test_find_by_class_when_multiple_classes_present-scCsˆ|jdƒ}|j|jdtjdƒƒdgƒd„}|j|jd|ƒgƒd„}|j|jd|ƒdgƒdS(NsFound itR)tbasFound itcSst|ƒdkS(Ni(R&(tvalue((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pytbig_attribute_value@scSst|ƒdkS(Ni(R&(Rs((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pytsmall_attribute_valueEs(RRR'R/R0(RRRtRu((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt:test_find_all_with_non_dictionary_for_attrs_finds_by_class;s(  cCsÆ|jdƒ}|jdƒ\}}|j||g|jddƒƒ|j|g|jddƒƒ|j|g|jdddƒƒ|j|g|jddƒƒ|jg|jddƒƒdS(Ns*R)R9R-Rlsfoo barsbar foo(RR'R(RRR)ta2((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt:test_find_all_with_string_for_attrs_finds_multiple_classesKs""cCsE|jdƒ}tdidd6ƒ}|j|j|ƒdgƒdS(Nsi Match. Non-match.RDR_RsMatch.(RR RR'(RRKtstrainer((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt'test_find_all_by_attribute_soupstrainerWs cCs5|jdƒ}|j|jdddƒdgƒdS(Ns�ID present. No ID present. ID is empty.R)RsNo ID present.(RRR'tNone(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt$test_find_all_with_missing_attribute_s cCs5|jdƒ}|j|jdtƒddgƒdS(Ns�ID present. No ID present. ID is empty.Rs ID present.s ID is empty.(RRR'R1(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt$test_find_all_with_defined_attributegs cCsW|jdƒ}ddg}|j|jddƒ|ƒ|j|jddƒ|ƒdS(Ns[Unquoted attribute. Quoted attribute.sUnquoted attribute.sQuoted attribute.RiR4(RRR'(RRKtexpected((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt$test_find_all_with_numeric_attributeps   cCs>|jdƒ}|j|jddddgƒddgƒdS(Ns‘1 2 3 No ID.RR4R5R6(RRR'(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt(test_find_all_with_list_attribute_valuesys cCs>|jdƒ}|j|jdtjdƒƒddgƒdS(NsÞOne a. Two as. Mixed as and bs. One b. No ID.Rs^a+$sOne a.sTwo as.(RRR'R/R0(RRK((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt5test_find_all_with_regular_expression_attribute_valueƒs cCs||jdƒ}|j}|j|g|jdddƒƒ|jg|jdddƒƒ|jg|jdddƒƒdS(NsfoobarfooR)R$R9R-(RR)RR'(RRR)((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt'test_find_by_name_and_containing_string�s  "cCs;|jdƒ}|j|jdƒ|jdddƒƒdS(Ns"foofooR)R$R9(RRR'(RR((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt=test_find_by_name_and_containing_string_when_string_is_buried˜scCsc|jdƒ}|j}|j|g|jddddƒƒ|jg|jddddƒƒdS(Ns"foofooRiR$R9iR-(RR)RR'(RRR)((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt,test_find_by_attribute_and_containing_stringœs %(RRR`RgRkRmRqRvRxRzR|R}RR€R�R‚RƒR„(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyR^ïs          t TestIndexcBseZdZd„ZRS(sTest Tag.indexcCsk|jdƒ}|j}x6t|jƒD]%\}}|j||j|ƒƒq(W|jt|jdƒdS(Nsh
Identical Not identical Identical Identical with child Also not identical Identical with child
i(RRXt enumeratetcontentsRtindext assertRaisest ValueError(RRKRXtitelement((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyt test_index¨s   (RRR+R�(((s7/usr/lib/python2.7/site-packages/bs4/tests/test_tree.pyR…¦stTestParentOperationscBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( s;Test navigation and searching through an element's parents.cCs8tt|ƒjƒ|jdƒ|_|jj|_dS(Ns1