def postProcess(self, _edObject=None): EDPluginExec.postProcess(self) self.DEBUG("EDPluginExecPyFAIv1_0.postProcess") # Create some output data if self.strOutputFile: output = XSDataImageExt(path=XSDataString(self.strOutputFile)) elif self.shared: output = XSDataImageExt(shared=XSDataString(self.shared)) else: output = XSDataImageExt(array=EDUtilsArray.arrayToXSData(self.npaOut)) xsDataResult = XSDataResultPyFAI(output=output) self.setDataOutput(xsDataResult)
def testExecute(self): """ """ self.run() plugin = self.getPlugin() strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile()) # strObtainedOutput = self.readAndParseFile (self.m_edObtainedOutputDataFile) EDVerbose.DEBUG("Checking obtained result...") xsDataResultReference = XSDataResultPyFAI.parseString(strExpectedOutput) xsDataResultObtained = plugin.getDataOutput() EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same")
def testExecute(self): """ """ self.run() plugin = self.getPlugin() strExpectedOutput = self.readAndParseFile( self.getReferenceDataOutputFile()) # strObtainedOutput = self.readAndParseFile (self.m_edObtainedOutputDataFile) EDVerbose.DEBUG("Checking obtained result...") xsDataResultReference = XSDataResultPyFAI.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 remove any existing output file """ EDTestCasePluginExecute.preProcess(self) self.loadTestImage([ "AgBe_SAXS.%s" % i for i in ("cbf", "dat")]) strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile()) EDVerbose.DEBUG("strExpectedOutput:" + strExpectedOutput) xsDataResultReference = XSDataResultPyFAI.parseString(strExpectedOutput) self.refOutput = xsDataResultReference.output.path.value EDVerbose.DEBUG(" Output file is %s" % self.refOutput) if not os.path.isdir(os.path.dirname(self.refOutput)): os.makedirs(os.path.dirname(self.refOutput)) if os.path.isfile(self.refOutput): EDVerbose.DEBUG(" Output file exists %s, I will remove it" % self.refOutput) os.remove(self.refOutput)
def preProcess(self): """ PreProcess of the execution test: download a set of images from http://www.edna-site.org and remove any existing output file """ EDTestCasePluginExecute.preProcess(self) self.loadTestImage(["AgBe_SAXS.%s" % i for i in ("cbf", "dat")]) strExpectedOutput = self.readAndParseFile( self.getReferenceDataOutputFile()) EDVerbose.DEBUG("strExpectedOutput:" + strExpectedOutput) xsDataResultReference = XSDataResultPyFAI.parseString( strExpectedOutput) self.refOutput = xsDataResultReference.output.path.value EDVerbose.DEBUG(" Output file is %s" % self.refOutput) if not os.path.isdir(os.path.dirname(self.refOutput)): os.makedirs(os.path.dirname(self.refOutput)) if os.path.isfile(self.refOutput): EDVerbose.DEBUG(" Output file exists %s, I will remove it" % self.refOutput) os.remove(self.refOutput)