Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 c„TÎã@s¼dZddlZddlZddlmZddlmZmZm Z yddlm Z dZ Wne k r`dZ YnXyddlm Z mZdZWne k r’dZYnXGd d „d ejƒZGd d „d ejƒZdS) zTests of the builder registry.éN)Ú BeautifulSoup)Úbuilder_registryÚHTMLParserTreeBuilderÚTreeBuilderRegistry)ÚHTML5TreeBuilderTF)ÚLXMLTreeBuilderForXMLÚLXMLTreeBuilderc@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) ÚBuiltInRegistryTestz@Test the built-in registry with the default builders registered.cCs`tr|jtjddƒtƒtr0|jtjddƒtƒ|jtjddƒtƒtr\|jtjddƒtƒdS)NÚfastÚhtmlZ permissiveÚxmlÚstrictÚhtml5lib) Ú LXML_PRESENTÚ assertEqualÚregistryÚlookuprrrÚHTML5LIB_PRESENTr)Úself©rú+/usr/lib/python3.6/test_builder_registry.pyÚtest_combination sz$BuiltInRegistryTest.test_combinationcCsjtr*|jtjdƒtƒ|jtjdƒtƒn<|jtjdƒdƒtrT|jtjdƒtƒn|jtjdƒtƒdS)Nr r ) rrrrrrrrr)rrrrÚtest_lookup_by_markup_type.sz.BuiltInRegistryTest.test_lookup_by_markup_typecCsXtr,|jtjddƒtƒ|jtjddƒtƒtrB|jtjdƒtƒ|jtjdƒtƒdS)NZlxmlr r rz html.parser) rrrrrrrrr)rrrrÚtest_named_library9s  z&BuiltInRegistryTest.test_named_libraryc CsJtjdd��"}tddd�tdddgd�WdQRX|jttddd�dS)NT)ÚrecordÚr )Úfeaturesr zno-such-feature)ÚwarningsÚcatch_warningsrZ assertRaisesÚ ValueError)rÚwrrrÚ*test_beautifulsoup_constructor_does_lookupFs  z>BuiltInRegistryTest.test_beautifulsoup_constructor_does_lookupN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrr!rrrrr s   r c@sXeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dS)Ú RegistryTestz.Test the TreeBuilderRegistry class in general.cCs tƒ|_dS)N)rr)rrrrÚsetUpYszRegistryTest.setUpcGs,tddj|ƒtfd|iƒ}|jj|ƒ|S)NZBuilder_Ú_r)ÚtypeÚjoinÚobjectrÚregister)rZ feature_listÚclsrrrÚbuilder_for_features\s z!RegistryTest.builder_for_featurescCs2|jƒ}|j|jjdƒdƒ|j|jjƒ|ƒdS)NÚfoo)r.rrr)rÚbuilderrrrÚtest_register_with_no_featurescsz+RegistryTest.test_register_with_no_featurescCs8|jddƒ}|j|jjdƒ|ƒ|j|jjdƒ|ƒdS)Nr/Úbar)r.rrr)rr0rrrÚ0test_register_with_features_makes_lookup_succeedns z=RegistryTest.test_register_with_features_makes_lookup_succeedcCs$|jddƒ}|j|jjdƒdƒdS)Nr/r2Úbaz)r.rrr)rr0rrrÚ4test_lookup_fails_when_no_builder_implements_featuress zARegistryTest.test_lookup_fails_when_no_builder_implements_featurecCs*|jdƒ}|jdƒ}|j|jjƒ|ƒdS)Nr/r2)r.rrr)rÚbuilder1Úbuilder2rrrÚCtest_lookup_gets_most_recent_registration_when_no_feature_specifiedws  zPRegistryTest.test_lookup_gets_most_recent_registration_when_no_feature_specifiedcCs|j|jjƒdƒdS)N)rrr)rrrrÚ2test_lookup_fails_when_no_tree_builders_registered|sz?RegistryTest.test_lookup_fails_when_no_tree_builders_registeredcCsv|jdƒ}|jdƒ}|jdddƒ}|jdddƒ}|jdƒ}|jdƒ}|j|jjddƒ|ƒ|j|jjdddƒ|ƒdS)Nr/r2r4Zquux)r.rrr)rZhas_oneZ has_the_otherZhas_both_earlyZ has_both_lateZ lacks_onerrrÚs     9