Issue minidom.unlink with a context manager
This commit is contained in:
Kristján Valur Jónsson 2010-06-09 08:13:42 +00:00
parent 3dcb5acdb0
commit 17173cfe7b
3 changed files with 22 additions and 0 deletions

View file

@ -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()