Пример #1
0
    def CheckDate(self, context):
        self.__assistant.CheckCrashes(context)
        self.__assistant.CheckSteps(context, ["Import", "Export", "Validate"], [])
        if not self.__assistant.GetResults(): return False

        # Get the <created> time for the input file
        root = minidom.parse(context.GetInputFilename()).documentElement
        inputCreatedDate = ParseDate(GetXmlContent(FindXmlChild(root, "asset", "created")))
        if inputCreatedDate == None:
            context.Log("FAILED: Couldn't read <created> value from test input file.")
            return False
        
        # Get the output file
        outputFilenames = context.GetStepOutputFilenames("Export")
        if len(outputFilenames) == 0:
            context.Log("FAILED: There are no export steps.")
            return False

        # Get the <created> time for the output file
        root = minidom.parse(outputFilenames[0]).documentElement
        outputCreatedDate = ParseDate(GetXmlContent(FindXmlChild(root, "asset", "created")))
        if outputCreatedDate == None:
            context.Log("FAILED: Couldn't read <created> value from the exported file.")
            return False

        if (outputCreatedDate - inputCreatedDate) < timedelta(0):
            context.Log("FAILED: <created> has an incorrect time stamp. It should be later than the <created> value in the original file.")
            context.Log("The original <created> time is " + str(inputCreatedDate))
            context.Log("The exported <created> time is " + str(outputCreatedDate))
            return False
        
        context.Log("PASSED: <created> element is correct.")
        return True
Пример #2
0
    def CheckDate(self, context):
        # Get the <created> time for the input file
        root = minidom.parse(context.GetInputFilename()).documentElement
        inputCreatedDate = ParseDate(GetXmlContent(FindXmlChild(root, "library_animations", "animation", "asset", "created")))
        if inputCreatedDate == None:
            context.Log("FAILED: Couldn't read <created> value from test input file.")
            return None
        
        # Get the output file
        outputFilenames = context.GetStepOutputFilenames("Export")
        if len(outputFilenames) == 0:
            context.Log("FAILED: There are no export steps.")
            return None

        # Get the <created> time for the output file
        root = minidom.parse(outputFilenames[0]).documentElement
        outputCreatedDate = ParseDate(GetXmlContent(FindXmlChild(root, "library_animations", "animation", "asset", "created")))
        if outputCreatedDate == None:
            context.Log("FAILED: Couldn't read <created> value from the exported file.")
            return None

        if (outputCreatedDate - inputCreatedDate) != timedelta(0):
            context.Log("FAILED: <created> is not preserved.")
            context.Log("The original <created> time is " + str(inputCreatedDate))
            context.Log("The exported <created> time is " + str(outputCreatedDate))
            return False
            
        context.Log("PASSED: <created> element is preserved.")
        return True
Пример #3
0
    def CheckDate(self, context):
        # Get the <modified> time for the input file
        root = minidom.parse(context.GetInputFilename()).documentElement
        inputDate = ParseDate(GetXmlContent(FindXmlChild(root, "library_visual_scenes", "visual_scene", "node", "asset", "modified")))
        if inputDate == None:
            context.Log("FAILED: Couldn't read <modified> value from test input file.")
            return None
        
        # Get the output file
        outputFilenames = context.GetStepOutputFilenames("Export")
        if len(outputFilenames) == 0:
            context.Log("FAILED: There are no export steps.")
            return None

        # Get the <modified> time for the output file
        root = minidom.parse(outputFilenames[0]).documentElement
        outputDate = ParseDate(GetXmlContent(FindXmlChild(root, "library_visual_scenes", "visual_scene", "node", "asset", "modified")))
        if outputDate == None:
            context.Log("FAILED: Couldn't read <modified> value from the exported file.")
            return None

        # Modified data must be greater than or equal to original date to pass
        if (outputDate - inputDate) < timedelta(0):
            context.Log("FAILED: <modified> is not preserved.")
            context.Log("The original <modified> time is " + str(inputDate))
            context.Log("The exported <modified> time is " + str(outputDate))
            return False
            
        context.Log("PASSED: <modified> element is preserved or updated correctly.")
        return True