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

Method test_lost_tail

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

Source from the content-addressed store, hash-verified

2468 self.assertEqual(e.text, 'changed')
2469
2470 def test_lost_tail(self):
2471 # Issue #25902: Borrowed tail can disappear
2472 class Text:
2473 def __bool__(self):
2474 e[0].tail = 'changed'
2475 return True
2476
2477 e = ET.Element('root')
2478 e.append(ET.Element('tag'))
2479 e[0].tail = Text()
2480 i = e.itertext()
2481 t = next(i)
2482 self.assertIsInstance(t, Text)
2483 self.assertIsInstance(e[0].tail, str)
2484 self.assertEqual(e[0].tail, 'changed')
2485
2486 @unittest.expectedFailure # TODO: RUSTPYTHON
2487 def test_lost_elem(self):

Callers

nothing calls this directly

Calls 6

appendMethod · 0.95
itertextMethod · 0.95
nextFunction · 0.85
assertIsInstanceMethod · 0.80
TextClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected