mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue minidom.unlink with a context manager
This commit is contained in:
parent
3dcb5acdb0
commit
17173cfe7b
3 changed files with 22 additions and 0 deletions
|
|
@ -228,7 +228,14 @@ class MinidomTest(unittest.TestCase):
|
|||
|
||||
def testUnlink(self):
|
||||
dom = parse(tstfile)
|
||||
self.assertTrue(dom.childNodes)
|
||||
dom.unlink()
|
||||
self.assertFalse(dom.childNodes)
|
||||
|
||||
def testContext(self):
|
||||
with parse(tstfile) as dom:
|
||||
self.assertTrue(dom.childNodes)
|
||||
self.assertFalse(dom.childNodes)
|
||||
|
||||
def testElement(self):
|
||||
dom = Document()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue