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 = XSDataResultSaxsAnglev1_0.parseString( strExpectedOutput) xsDataResultObtained = plugin.getDataOutput() EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same") outputData = openimage(xsDataResultObtained.getRegroupedDataFile(). getPath().getValue()).data referenceData = openimage( os.path.join(self.getTestsDataImagesHome(), "Moke-2th10-tilt0-rot0.azim")).data EDAssert.arraySimilar(outputData, referenceData, _fAbsMaxDelta=0.4, _fScaledMaxDelta=0.5, _strComment="Images 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([ "Moke-2th10-tilt0-rot0.%s" % i for i in ("edf", "azim")]) strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile()) EDVerbose.DEBUG("strExpectedOutput:" + strExpectedOutput) xsDataResultReference = XSDataResultSaxsAnglev1_0.parseString(strExpectedOutput) self.refOutput = xsDataResultReference.getRegroupedDataFile().getPath().getValue() 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 testExecute(self): """ """ self.run() plugin = self.getPlugin() strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile()) # strObtainedOutput = self.readAndParseFile (self.m_edObtainedOutputDataFile) EDVerbose.DEBUG("Checking obtained result...") xsDataResultReference = XSDataResultSaxsAnglev1_0.parseString(strExpectedOutput) xsDataResultObtained = plugin.getDataOutput() EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same") outputData = openimage(xsDataResultObtained.getRegroupedDataFile().getPath().getValue()).data referenceData = openimage(os.path.join(self.getTestsDataImagesHome(), "Moke-2th10-tilt0-rot0.azim")).data EDAssert.arraySimilar(outputData, referenceData , _fAbsMaxDelta=0.4, _fScaledMaxDelta=0.5, _strComment="Images 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( ["Moke-2th10-tilt0-rot0.%s" % i for i in ("edf", "azim")]) strExpectedOutput = self.readAndParseFile( self.getReferenceDataOutputFile()) EDVerbose.DEBUG("strExpectedOutput:" + strExpectedOutput) xsDataResultReference = XSDataResultSaxsAnglev1_0.parseString( strExpectedOutput) self.refOutput = xsDataResultReference.getRegroupedDataFile().getPath( ).getValue() 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)