def compressRaw(self): xsdin = XSDataInputExecCommandLine() xsdin.setFireAndForget(XSDataBoolean(1)) xsdin.setInputFileName(self.getDataInput().getInputRaw()) xsdin.setCommandLineOptions(XSDataString("-9")) xsdf = XSDataFile() xsdf.setPath(XSDataString("/bin/bzip2")) xsdin.setCommandLineProgram(xsdf) self.__edPluginExecBzip2.setDataInput(xsdin) self.__edPluginExecBzip2.connectSUCCESS(self.doSuccessExecBzip2) self.__edPluginExecBzip2.connectFAILURE(self.doFailureExecBzip2) self.__edPluginExecBzip2.executeSynchronous()
def preProcess(self): """ PreProcess of the execution test: download an EDF file from http://www.edna-site.org and remove any existing output file, i.e. /tmp/diff6105.edf """ EDTestCasePluginExecute.preProcess(self) self.loadTestImage([ "test_region1_dark_1_0040.edf"]) xsDataInputReference = XSDataInputExecCommandLine.parseString(self.readAndParseFile (self.getDataInputFile())) strInputFile = xsDataInputReference.getInputFileName().getPath().getValue() if not(os.path.isdir(os.path.dirname(strInputFile))): os.makedirs(os.path.dirname(strInputFile), int("777", 8)) EDVerbose.DEBUG("temporary filename is :" + strInputFile) shutil.copy(os.path.join(EDUtilsTest.getTestsDataImagesHome(), "test_region1_dark_1_0040.edf"), strInputFile) strInputXML = self.readAndParseFile (self.getDataInputFile()) xsDataInputReference = XSDataInputExecCommandLine.parseString(strInputXML) outputFileName = xsDataInputReference.getInputFileName().getPath().getValue() + ".gz" EDVerbose.DEBUG(" Output file is %s" % outputFileName) if os.path.isfile(outputFileName): EDVerbose.DEBUG(" Output file exists %s, I will remove it" % outputFileName) os.remove(outputFileName)