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

Method test_expat224_utf8_bug_file

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

Source from the content-addressed store, hash-verified

2559 self.check_expat224_utf8_bug(text)
2560
2561 def test_expat224_utf8_bug_file(self):
2562 with open(UTF8_BUG_XMLFILE, 'rb') as fp:
2563 raw = fp.read()
2564 root = ET.fromstring(raw)
2565 xmlattr = root.get('b')
2566
2567 # "Parse" manually the XML file to extract the value of the 'b'
2568 # attribute of the <a b='xxx' /> XML element
2569 text = raw.decode('utf-8').strip()
2570 text = text.replace('\r\n', ' ')
2571 text = text[6:-4]
2572 self.assertEqual(root.get('b'), text)
2573
2574 def test_39495_treebuilder_start(self):
2575 self.assertRaises(TypeError, ET.TreeBuilder().start, "tag")

Callers

nothing calls this directly

Calls 8

openFunction · 0.50
readMethod · 0.45
fromstringMethod · 0.45
getMethod · 0.45
stripMethod · 0.45
decodeMethod · 0.45
replaceMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected