Example #1
0
    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 = XSDataInputMatrixInvertv2.parseString(
            self.readAndParseFile(self.getDataInputFile()))
        self.inputFile = xsDataInput.getInputMatrix().getPath().getValue()

        self.xsDataResultReference = XSDataResultMatrixInvertv2.parseString(
            self.readAndParseFile(self.getReferenceDataOutputFile()))
        self.outputFile = self.xsDataResultReference.getOutputMatrix().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 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 = XSDataInputMatrixInvertv2.parseString(self.readAndParseFile(self.getDataInputFile()))
        self.inputFile = xsDataInput.getInputMatrix().getPath().getValue()

        self.xsDataResultReference = XSDataResultMatrixInvertv2.parseString(
            self.readAndParseFile(self.getReferenceDataOutputFile())
        )
        self.outputFile = self.xsDataResultReference.getOutputMatrix().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)