(self)
| 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. |
nothing calls this directly
no test coverage detected