Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 cT@sdZddlZddlZddlmZddlmZmZm Z yddlm Z dZ Wne k r`dZ YnXyddlm Z mZdZWne k rdZYnXGd d d ejZGd d d ejZdS) zTests of the builder registry.N) BeautifulSoup)builder_registryHTMLParserTreeBuilderTreeBuilderRegistry)HTML5TreeBuilderTF)LXMLTreeBuilderForXMLLXMLTreeBuilderc@s0eZdZdZddZddZddZdd Zd S) BuiltInRegistryTestz@Test the built-in registry with the default builders registered.cCs`tr|jtjddttr0|jtjddt|jtjddttr\|jtjddtdS)NfasthtmlZ permissivexmlstricthtml5lib) LXML_PRESENT assertEqualregistrylookuprrrHTML5LIB_PRESENTr)selfr+/usr/lib/python3.6/test_builder_registry.pytest_combination sz$BuiltInRegistryTest.test_combinationcCsjtr*|jtjdt|jtjdtn<|jtjddtrT|jtjdtn|jtjdtdS)Nr r ) rrrrrrrrr)rrrrtest_lookup_by_markup_type.sz.BuiltInRegistryTest.test_lookup_by_markup_typecCsXtr,|jtjddt|jtjddttrB|jtjdt|jtjdtdS)NZlxmlr r rz html.parser) rrrrrrrrr)rrrrtest_named_library9s  z&BuiltInRegistryTest.test_named_libraryc CsJtjdd"}tdddtdddgdWdQRX|jttddddS)NT)recordr )featuresr zno-such-feature)warningscatch_warningsrZ assertRaises ValueError)rwrrr*test_beautifulsoup_constructor_does_lookupFs  z>BuiltInRegistryTest.test_beautifulsoup_constructor_does_lookupN)__name__ __module__ __qualname____doc__rrrr!rrrrr s   r c@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS) RegistryTestz.Test the TreeBuilderRegistry class in general.cCs t|_dS)N)rr)rrrrsetUpYszRegistryTest.setUpcGs,tddj|tfd|i}|jj||S)NZBuilder__r)typejoinobjectrregister)rZ feature_listclsrrrbuilder_for_features\s z!RegistryTest.builder_for_featurescCs2|j}|j|jjdd|j|jj|dS)Nfoo)r.rrr)rbuilderrrrtest_register_with_no_featurescsz+RegistryTest.test_register_with_no_featurescCs8|jdd}|j|jjd||j|jjd|dS)Nr/bar)r.rrr)rr0rrr0test_register_with_features_makes_lookup_succeedns z=RegistryTest.test_register_with_features_makes_lookup_succeedcCs$|jdd}|j|jjdddS)Nr/r2baz)r.rrr)rr0rrr4test_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)rbuilder1builder2rrrCtest_lookup_gets_most_recent_registration_when_no_feature_specifiedws  zPRegistryTest.test_lookup_gets_most_recent_registration_when_no_feature_specifiedcCs|j|jjddS)N)rrr)rrrr2test_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_onerrrs     9