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

Method test_write_to_filename_as_unicode

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

Source from the content-addressed store, hash-verified

4257 b'''<site>\xf8</site>'''))
4258
4259 def test_write_to_filename_as_unicode(self):
4260 self.addCleanup(os_helper.unlink, TESTFN)
4261 with open(TESTFN, 'w') as f:
4262 encoding = f.encoding
4263 os_helper.unlink(TESTFN)
4264
4265 tree = ET.ElementTree(ET.XML('''<site>\xf8</site>'''))
4266 tree.write(TESTFN, encoding='unicode')
4267 with open(TESTFN, 'rb') as f:
4268 self.assertEqual(f.read(), b"<site>\xc3\xb8</site>")
4269
4270 def test_write_to_text_file(self):
4271 self.addCleanup(os_helper.unlink, TESTFN)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected