コード例 #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))