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

Method test_file_init

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

Source from the content-addressed store, hash-verified

405 '<tag>hello</tag>')
406
407 def test_file_init(self):
408 stringfile = io.BytesIO(SAMPLE_XML.encode("utf-8"))
409 tree = ET.ElementTree(file=stringfile)
410 self.assertEqual(tree.find("tag").tag, 'tag')
411 self.assertEqual(tree.find("section/tag").tag, 'tag')
412
413 tree = ET.ElementTree(file=SIMPLE_XMLFILE)
414 self.assertEqual(tree.find("element").tag, 'element')
415 self.assertEqual(tree.find("element/../empty-element").tag,
416 'empty-element')
417
418 def test_path_cache(self):
419 # Check that the path cache behaves sanely.

Callers

nothing calls this directly

Calls 3

findMethod · 0.95
encodeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected