Пример #1
0
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     EDVerbose.DEBUG("EDPluginExecVideov10.postProcess")
     # Create some output data
     xsDataResult = XSDataResultExecVideo()
     xsDataFile = XSDataFile()
     xsDataFile.setPath(XSDataString(self.videoFile))
     xsDataResult.setVideoPath(xsDataFile)
     xsDataResult.setVideoPath(xsDataFile)
     xsDataResult.setVideoCodec(XSDataString(self.codec))
     self.setDataOutput(xsDataResult)
    def testExecute(self):
        """
        """
        self.run()

        # Checks that there are no error messages

        plugin = self.getPlugin()

        edStringExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile())
        edStringObtainedOutput = self.readAndParseFile (self.m_edObtainedOutputDataFile)
        EDVerbose.DEBUG("Checking obtained result...")
        xsDataResultReference = XSDataResultExecVideo.parseString(edStringExpectedOutput)
        xsDataResultObtained = XSDataResultExecVideo.parseString(edStringObtainedOutput)

        EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same")

################################################################################
# Identification of the video by its size
################################################################################

        edStringExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile())
        xsDataResultReference = XSDataResultExecVideo.parseString(edStringExpectedOutput)
        outputFileName = xsDataResultReference.getVideoPath().getPath().getValue()
        outputVideoSize = os.stat(outputFileName)[6]


        referenceFileName = os.path.join(self.getPluginTestsDataHome(), os.path.basename(outputFileName))
        referenceVideoSize = os.stat(referenceFileName)[6]

        EDAssert.equal(outputVideoSize, referenceVideoSize, "Identification of the video file by its size")
################################################################################
# Identification of the video by mplayer
################################################################################
        outputVideoLog = subprocess.Popen("mplayer  -identify -vo null -ao null -frames 0 2>/dev/null " + outputFileName, stdout=subprocess.PIPE, shell=True).stdout.readlines()
        outputVideoSummary = ""

        for oneLine in outputVideoLog:
            if oneLine.strip() != "":
                if not oneLine.split()[0].split("=")[0] in self.EXCLUDED:
                    outputVideoSummary += oneLine

        referenceVideoLog = subprocess.Popen("mplayer  -identify -vo null -ao null -frames 0 2>/dev/null " + referenceFileName, stdout=subprocess.PIPE, shell=True).stdout.readlines()
        referenceVideoSummary = ""
        for oneLine in referenceVideoLog:
            if oneLine.strip() != "":
                if not oneLine.split()[0].split("=")[0] in self.EXCLUDED:
                    referenceVideoSummary += oneLine

        EDAssert.strAlmostEqual(outputVideoSummary, referenceVideoSummary, "Identification of the video by mplayer", _lstExcluded="edna")
 def preProcess(self):
     """
     PreProcess of the execution test: download a set of JPEG files from http://www.edna-site.org
     and remove any existing output file, i.e. /tmp/example-msmpeg4v2.avi 
     """
     EDTestCasePluginExecute.preProcess(self)
     self.loadTestImage([ "sample1_%04i.jpg" % i for i in range(50, 101)])
     edStringExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile())
     xsDataResultReference = XSDataResultExecVideo.parseString(edStringExpectedOutput)
     outputFileName = xsDataResultReference.getVideoPath().getPath().getValue()
     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)
Пример #4
0
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     EDVerbose.DEBUG("EDPluginExecVideov10.postProcess")
     # Create some output data
     xsDataResult = XSDataResultExecVideo()
     xsDataFile = XSDataFile()
     xsDataFile.setPath(XSDataString(self.videoFile))
     xsDataResult.setVideoPath(xsDataFile)
     xsDataResult.setVideoPath(xsDataFile)
     xsDataResult.setVideoCodec(XSDataString(self.codec))
     self.setDataOutput(xsDataResult)
 def preProcess(self):
     """
     PreProcess of the execution test: download a set of JPEG files from http://www.edna-site.org
     and remove any existing output file, i.e. /tmp/example-msmpeg4v2.avi 
     """
     EDTestCasePluginExecute.preProcess(self)
     self.loadTestImage(["sample1_%04i.jpg" % i for i in range(50, 101)])
     edStringExpectedOutput = self.readAndParseFile(
         self.getReferenceDataOutputFile())
     xsDataResultReference = XSDataResultExecVideo.parseString(
         edStringExpectedOutput)
     outputFileName = xsDataResultReference.getVideoPath().getPath(
     ).getValue()
     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)
    def testExecute(self):
        """
        """
        self.run()

        # Checks that there are no error messages

        plugin = self.getPlugin()

        edStringExpectedOutput = self.readAndParseFile(
            self.getReferenceDataOutputFile())
        edStringObtainedOutput = self.readAndParseFile(
            self.m_edObtainedOutputDataFile)
        EDVerbose.DEBUG("Checking obtained result...")
        xsDataResultReference = XSDataResultExecVideo.parseString(
            edStringExpectedOutput)
        xsDataResultObtained = XSDataResultExecVideo.parseString(
            edStringObtainedOutput)

        EDAssert.strAlmostEqual(xsDataResultReference.marshal(),
                                xsDataResultObtained.marshal(),
                                "XSDataResult output are the same")

        ################################################################################
        # Identification of the video by its size
        ################################################################################

        edStringExpectedOutput = self.readAndParseFile(
            self.getReferenceDataOutputFile())
        xsDataResultReference = XSDataResultExecVideo.parseString(
            edStringExpectedOutput)
        outputFileName = xsDataResultReference.getVideoPath().getPath(
        ).getValue()
        outputVideoSize = os.stat(outputFileName)[6]

        referenceFileName = os.path.join(self.getPluginTestsDataHome(),
                                         os.path.basename(outputFileName))
        referenceVideoSize = os.stat(referenceFileName)[6]

        EDAssert.equal(outputVideoSize, referenceVideoSize,
                       "Identification of the video file by its size")
        ################################################################################
        # Identification of the video by mplayer
        ################################################################################
        outputVideoLog = subprocess.Popen(
            "mplayer  -identify -vo null -ao null -frames 0 2>/dev/null " +
            outputFileName,
            stdout=subprocess.PIPE,
            shell=True).stdout.readlines()
        outputVideoSummary = ""

        for oneLine in outputVideoLog:
            if oneLine.strip() != "":
                if not oneLine.split()[0].split("=")[0] in self.EXCLUDED:
                    outputVideoSummary += oneLine

        referenceVideoLog = subprocess.Popen(
            "mplayer  -identify -vo null -ao null -frames 0 2>/dev/null " +
            referenceFileName,
            stdout=subprocess.PIPE,
            shell=True).stdout.readlines()
        referenceVideoSummary = ""
        for oneLine in referenceVideoLog:
            if oneLine.strip() != "":
                if not oneLine.split()[0].split("=")[0] in self.EXCLUDED:
                    referenceVideoSummary += oneLine

        EDAssert.strAlmostEqual(outputVideoSummary,
                                referenceVideoSummary,
                                "Identification of the video by mplayer",
                                _lstExcluded="edna")