Пример #1
0
 def testAddText(self):
     xmliks.addText(
         self.parsediks,
         "newtag",
         "Something else in newtag under a")
     xmliks.addText(
         xmliks.getNode(
             self.parsediks,
             "b"),
         "newtag",
         "Something else in newtag under b")
     xmlmdom.addText(
         self.parsedmdom,
         "newtag",
         "Something else in newtag under a")
     xmlmdom.addText(
         xmlmdom.getNode(
             self.parsedmdom,
             "b"),
         "newtag",
         "Something else in newtag under b")
     self.assertEqual(
         xmliks.toString(
             self.parsediks), xmlmdom.toString(
             self.parsedmdom))
Пример #2
0
 def testAddNode(self):
     xmliks.addNode(self.parsediks, "newtag")
     xmliks.addNode(xmliks.getNode(self.parsediks, "b"), "newtag")
     xmlmdom.addNode(self.parsedmdom, "newtag")
     xmlmdom.addNode(xmlmdom.getNode(self.parsedmdom, "b"), "newtag")
     self.assertEqual(
         xmliks.toString(
             self.parsediks), xmlmdom.toString(
             self.parsedmdom))
Пример #3
0
 def testParse(self):
     with open("tests/deneme.xml", "w") as a:
         a.write(self.xmlscript)
         a.flush()
         a.close()
     self.assertEqual(
         xmlmdom.toString(
             xmlmdom.parse("tests/deneme.xml")),
         xmliks.toString(
             xmliks.parse("tests/deneme.xml")))
Пример #4
0
 def testRemoveChildText(self):
     xmliks.removeChildText(xmliks.getNode(self.parsediks, "d"))
     xmlmdom.removeChildText(xmlmdom.getNode(self.parsedmdom, "d"))
     self.assertEqual(
         xmliks.toString(
             self.parsediks),
         '<a><b atrib="something">something in b tag.<c>something in c tag.</c></b><d/></a>')
     self.assertEqual(
         xmlmdom.toString(
             self.parsedmdom),
         '<a><b atrib="something">something in b tag.<c>something in c tag.</c></b><d></d></a>')
Пример #5
0
 def testRemoveChild(self):
     xmliks.removeChild(xmliks.getNode(self.parsediks, "d"), self.parsediks)
     xmlmdom.removeChild(
         xmlmdom.getNode(
             self.parsedmdom,
             "d"),
         self.parsedmdom)
     self.assertEqual(
         xmliks.toString(
             self.parsediks), xmlmdom.toString(
             self.parsedmdom))
Пример #6
0
 def testToString(self):
     self.assertEqual(
         xmliks.toString(
             self.parsediks), xmlmdom.toString(
             self.parsedmdom))
Пример #7
0
 def testNewDocument(self):
     self.assertEqual(xmlmdom.toString(xmlmdom.newDocument("newdocument")),
                      xmliks.toString(xmliks.newDocument("newdocument")))
Пример #8
0
 def testNewNode(self):
     newiks = xmliks.newNode(self.parsediks, "a")
     newdom = xmlmdom.newNode(self.parsedmdom, "a")
     xmliks.addText(newiks, "b", "something under b")
     xmlmdom.addText(newdom, "b", "something under b")
     self.assertEqual(xmliks.toString(newiks), xmlmdom.toString(newdom))