def preProcess(self): """ PreProcess of the execution test: download a set of images from http://www.edna-site.org and delete any output file """ EDTestCasePluginExecute.preProcess(self) xsDataInput = XSDataInputWriteMatrix.parseString( self.readAndParseFile(self.getDataInputFile())) self.inputFile = xsDataInput.getOutputMatrixFile().getPath().getValue() self.xsDataResultReference = XSDataResultWriteMatrix.parseString( self.readAndParseFile(self.getReferenceDataOutputFile())) self.outputFile = self.xsDataResultReference.getOutputMatrixFile( ).getPath().getValue() self.loadTestImage([ os.path.basename(self.inputFile), os.path.basename(self.outputFile) ]) if not os.path.isdir(os.path.dirname(self.outputFile)): os.makedirs(os.path.dirname(self.outputFile)) if os.path.isfile(self.outputFile): EDVerbose.DEBUG(" Output file exists %s, I will remove it" % self.outputFile) os.remove(self.outputFile)
def testExecute(self): """ """ self.run() plugin = self.getPlugin() ################################################################################ # Compare XSDataResults ################################################################################ strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile()) EDVerbose.DEBUG("Checking obtained result...") xsDataResultReference = XSDataResultWriteMatrix.parseString(strExpectedOutput) xsDataResultObtained = plugin.getDataOutput() EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same")
def testExecute(self): """ """ self.run() plugin = self.getPlugin() ################################################################################ # Compare XSDataResults ################################################################################ strExpectedOutput = self.readAndParseFile( self.getReferenceDataOutputFile()) EDVerbose.DEBUG("Checking obtained result...") xsDataResultReference = XSDataResultWriteMatrix.parseString( strExpectedOutput) xsDataResultObtained = plugin.getDataOutput() EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same")
def preProcess(self): """ PreProcess of the execution test: download a set of images from http://www.edna-site.org and delete any output file """ EDTestCasePluginExecute.preProcess(self) xsDataInput = XSDataInputWriteMatrix.parseString(self.readAndParseFile(self.getDataInputFile())) self.inputFile = xsDataInput.getOutputMatrixFile().getPath().getValue() self.xsDataResultReference = XSDataResultWriteMatrix.parseString(self.readAndParseFile(self.getReferenceDataOutputFile())) self.outputFile = self.xsDataResultReference.getOutputMatrixFile().getPath().getValue() self.loadTestImage([os.path.basename(self.inputFile), os.path.basename(self.outputFile) ]) if not os.path.isdir(os.path.dirname(self.outputFile)): os.makedirs(os.path.dirname(self.outputFile)) if os.path.isfile(self.outputFile): EDVerbose.DEBUG(" Output file exists %s, I will remove it" % self.outputFile) os.remove(self.outputFile)