MCPcopy Index your code
hub / github.com/python/cpython / test_subclass_comment_pi

Method test_subclass_comment_pi

Lib/test/test_xml_etree.py:3847–3860  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3845 self._check_sample1_element(e)
3846
3847 def test_subclass_comment_pi(self):
3848 class MyTreeBuilder(ET.TreeBuilder):
3849 def foobar(self, x):
3850 return x * 2
3851
3852 tb = MyTreeBuilder(comment_factory=ET.Comment, pi_factory=ET.PI)
3853 self.assertEqual(tb.foobar(10), 20)
3854
3855 parser = ET.XMLParser(target=tb)
3856 parser.feed(self.sample1)
3857 parser.feed('<!-- a comment--><?and a pi?>')
3858
3859 e = parser.close()
3860 self._check_sample1_element(e)
3861
3862 def test_element_factory(self):
3863 lst = []

Callers

nothing calls this directly

Calls 6

foobarMethod · 0.95
feedMethod · 0.95
closeMethod · 0.95
MyTreeBuilderClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected