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

Method test_parse_text

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

Source from the content-addressed store, hash-verified

134 self.assertEqual(result.getvalue(), xml_str(self.data, 'utf-8'))
135
136 def test_parse_text(self):
137 encodings = ('us-ascii', 'iso-8859-1', 'utf-8',
138 'utf-16', 'utf-16le', 'utf-16be')
139 for encoding in encodings:
140 self.check_parse(StringIO(xml_str(self.data, encoding)))
141 make_xml_file(self.data, encoding)
142 with open(TESTFN, 'r', encoding=encoding) as f:
143 self.check_parse(f)
144 self.check_parse(StringIO(self.data))
145 make_xml_file(self.data, encoding, None)
146 with open(TESTFN, 'r', encoding=encoding) as f:
147 self.check_parse(f)
148
149 def test_parse_bytes(self):
150 # UTF-8 is default encoding, US-ASCII is compatible with UTF-8,

Callers

nothing calls this directly

Calls 5

check_parseMethod · 0.95
StringIOClass · 0.90
xml_strFunction · 0.85
make_xml_fileFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected