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

Method test_write_to_binary_file

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

Source from the content-addressed store, hash-verified

4289 self.assertEqual(f.read(), b'''<site>\xf8</site>''')
4290
4291 def test_write_to_binary_file(self):
4292 self.addCleanup(os_helper.unlink, TESTFN)
4293 tree = ET.ElementTree(ET.XML('''<site>\xf8</site>'''))
4294 with open(TESTFN, 'wb') as f:
4295 tree.write(f)
4296 self.assertFalse(f.closed)
4297 with open(TESTFN, 'rb') as f:
4298 self.assertEqual(f.read(), b'''<site>&#248;</site>''')
4299
4300 def test_write_to_binary_file_with_encoding(self):
4301 self.addCleanup(os_helper.unlink, TESTFN)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected