def test_getAndClear(self):
     doc1 = self.dom.parseString('<a><b id="foo"><c></c></b></a>')
     node=domhelpers.getAndClear(doc1, "foo")
     actual=node.toxml()
     expected = self.dom.Element('b')
     expected.setAttribute('id', 'foo')
     self.assertEqual(actual, expected.toxml())
Example #2
0
 def test_getAndClear(self):
     doc1 = self.dom.parseString('<a><b id="foo"><c></c></b></a>')
     node=domhelpers.getAndClear(doc1, "foo")
     actual=node.toxml()
     expected = self.dom.Element('b')
     expected.setAttribute('id', 'foo')
     self.assertEqual(actual, expected.toxml())
Example #3
0
 def test_getAndClear(self):
     doc1 = self.dom.parseString('<a><b id="foo"><c></c></b></a>')
     doc = self.dom.Document()
     node = domhelpers.getAndClear(doc1, "foo")
     actual = node.toxml()
     expected = doc.createElement("b")
     expected.setAttribute("id", "foo")
     self.assertEqual(actual, expected.toxml())
 def test_getAndClear(self):
     doc1=microdom.parseString('<a><b id="foo"><c></c></b></a>')
     node=domhelpers.getAndClear(doc1, "foo")
     actual=node.toxml()
     expected='<b id="foo"></b>'
     assert actual==expected, 'expected %s, got %s' % (expected, actual)
Example #5
0
 def test_getAndClear(self):
     doc1 = microdom.parseString('<a><b id="foo"><c></c></b></a>')
     node = domhelpers.getAndClear(doc1, "foo")
     actual = node.toxml()
     expected = '<b id="foo"></b>'
     assert actual == expected, 'expected %s, got %s' % (expected, actual)