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

Method test_write_to_filename

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

Source from the content-addressed store, hash-verified

4274 "<tag key=\"åöö&lt;&gt;\" />" % enc).encode(enc))
4275
4276 def test_write_to_filename(self):
4277 self.addCleanup(os_helper.unlink, TESTFN)
4278 tree = ET.ElementTree(ET.XML('''<site>\xf8</site>'''))
4279 tree.write(TESTFN)
4280 with open(TESTFN, 'rb') as f:
4281 self.assertEqual(f.read(), b'''<site>&#248;</site>''')
4282
4283 def test_write_to_filename_with_encoding(self):
4284 self.addCleanup(os_helper.unlink, TESTFN)

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
addCleanupMethod · 0.80
openFunction · 0.50
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected