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

Method test_expat_binary_file_nonascii

Lib/test/test_sax.py:908–920  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

906
907 @requires_nonascii_filenames
908 def test_expat_binary_file_nonascii(self):
909 fname = os_helper.TESTFN_UNICODE
910 shutil.copyfile(TEST_XMLFILE, fname)
911 self.addCleanup(os_helper.unlink, fname)
912
913 parser = create_parser()
914 result = BytesIO()
915 xmlgen = XMLGenerator(result)
916
917 parser.setContentHandler(xmlgen)
918 parser.parse(open(fname, 'rb'))
919
920 self.assertEqual(result.getvalue(), xml_test_out)
921
922 def test_expat_binary_file_bytes_name(self):
923 fname = os.fsencode(TEST_XMLFILE)

Callers

nothing calls this directly

Calls 10

getvalueMethod · 0.95
create_parserFunction · 0.90
BytesIOClass · 0.90
XMLGeneratorClass · 0.90
copyfileMethod · 0.80
addCleanupMethod · 0.80
openFunction · 0.50
setContentHandlerMethod · 0.45
parseMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected