Example #1
0
    def test_writeFile(self):
        self.assertRaises(AttributeError,self.ovfFile2.writeFile,'our.fda')#not a valid xml
        self.assertRaises(TypeError,self.ovfFile2.writeFile)#no filename initialized

        fullname = self.path+"/"+"tester.ovf"
        fileObj = open(fullname, "w")
        self.ovfFile.writeFile(fileObj)
        fileObj.close()
        myDoc = parse(fullname)

        self.assertTrue(testUtils.compare_dom(myDoc,self.ovfFile.document,True),
            "Documents are not the same")

        os.remove(fullname)