MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_subclass_comment_pi

Method test_subclass_comment_pi

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

Source from the content-addressed store, hash-verified

3805 self._check_sample1_element(e)
3806
3807 def test_subclass_comment_pi(self):
3808 class MyTreeBuilder(ET.TreeBuilder):
3809 def foobar(self, x):
3810 return x * 2
3811
3812 tb = MyTreeBuilder(comment_factory=ET.Comment, pi_factory=ET.PI)
3813 self.assertEqual(tb.foobar(10), 20)
3814
3815 parser = ET.XMLParser(target=tb)
3816 parser.feed(self.sample1)
3817 parser.feed('<!-- a comment--><?and a pi?>')
3818
3819 e = parser.close()
3820 self._check_sample1_element(e)
3821
3822 def test_element_factory(self):
3823 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