当前位置: 首页>>代码示例>>Python>>正文


Python EDUtilsTest.EDUtilsTest类代码示例

本文整理汇总了Python中EDUtilsTest.EDUtilsTest的典型用法代码示例。如果您正苦于以下问题:Python EDUtilsTest类的具体用法?Python EDUtilsTest怎么用?Python EDUtilsTest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EDUtilsTest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, _strPluginName, _strPluginDir=None, _strTestName=None):
     """
     Initialize the test case by determining the paths to the plugin home and plugin test directories.
     """
     EDTestCase.__init__(self, _strTestName)
     self._edPlugin = None
     self._strPluginName = _strPluginName
     self._strPluginHome = EDUtilsTest.getFactoryPluginTest().getModuleLocation(_strPluginName)
     self._strPluginTestsDataHome = EDUtilsTest.getPluginTestDataDirectory(self.getClassName())
     self._listRequiredConfigurationPluginNames = []
     self._strConfigurationFile = None
开发者ID:edna-site,项目名称:edna,代码行数:11,代码来源:EDTestCasePlugin.py

示例2: testGenerateXSDataIndexingResult

 def testGenerateXSDataIndexingResult(self):
     strFilename = "XSDataMOSFLMOutputIndexing_reference.xml"
     strPath = os.path.join(self.m_strDataPath, strFilename)
     strXMLMOSFLMOutputIndexing = EDUtilsTest.readAndParseFile(strPath)
     from XSDataMOSFLMv10 import XSDataMOSFLMOutputIndexing
     xsDataMOSFLMOutputIndexing = XSDataMOSFLMOutputIndexing.parseString(strXMLMOSFLMOutputIndexing)
     from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
     xsDataIndexingResult = EDHandlerXSDataMOSFLMv10.generateXSDataIndexingResult(xsDataMOSFLMOutputIndexing)
     strReferenceFilename = "XSDataIndexingResult_reference.xml"
     strReferencePath = os.path.join(self.m_strDataPath, strReferenceFilename)
     strXMLIndexingOutputReference = EDUtilsTest.readAndParseFile(strReferencePath)
     from XSDataMXv1 import  XSDataIndexingResult
     xsdataIndexingResultReference = XSDataIndexingResult.parseString(strXMLIndexingOutputReference)
     EDAssert.equal(xsdataIndexingResultReference.marshal(), xsDataIndexingResult.marshal())
开发者ID:olofsvensson,项目名称:edna-plugins-mx,代码行数:14,代码来源:EDTestCaseEDHandlerMOSFLMv10.py

示例3: testGenerateXSDataInputXDSIndexing

    def testGenerateXSDataInputXDSIndexing(self):
        filename = "XSDataIndexingInput_reference.xml"
        path = os.path.join(self.dataPath, filename)
        xmlIndexingInput = EDUtilsTest.readAndParseFile(path)
        from XSDataMXv1 import XSDataIndexingInput
        xsDataIndexingInput = XSDataIndexingInput.parseString(xmlIndexingInput)

        from EDHandlerXSDataXDSv1_0 import EDHandlerXSDataXDSv1_0
        xsDataInputXDSIndexing = EDHandlerXSDataXDSv1_0.generateXSDataInputXDSIndexing(xsDataIndexingInput)

        referenceFilename = "XSDataInputXDSIndexing_reference.xml"
        referencePath = os.path.join(self.dataPath, referenceFilename)
        xmlInputXDSIndexingReference = EDUtilsTest.readAndParseFile(referencePath)
        EDAssert.equal(xmlInputXDSIndexingReference, xsDataInputXDSIndexing.marshal())
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:14,代码来源:EDTestCaseEDHandlerXDSv1_0.py

示例4: testGenerateXSDataResultPowderIntegration

 def testGenerateXSDataResultPowderIntegration(self):
     strReferenceInputFile = os.path.join(self.m_strDataPath, "XSDataResultFIT2DCake_reference.xml")
     strXMLInput = EDUtilsTest.readAndParseFile(strReferenceInputFile)
     EDApplication.loadModule("XSDataFIT2Dv1_0")
     from XSDataFIT2Dv1_0 import XSDataResultFIT2DCake
     xsDataResultFIT2DCake = XSDataResultFIT2DCake.parseString(strXMLInput)
     from EDHandlerXSDataFIT2Dv1_0 import EDHandlerXSDataFIT2Dv1_0
     edHandlerXSDataFIT2Dv1_0 = EDHandlerXSDataFIT2Dv1_0()
     xsDataResultPowderDiffraction = edHandlerXSDataFIT2Dv1_0.getXSDataResultPowderIntegration(xsDataResultFIT2DCake)
     strReferencePath = os.path.join(self.m_strDataPath, "XSDataResultPowderIntegration_reference.xml")
     strXMLResultReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDApplication.loadModule("XSDataDiffractionCTv1")
     from XSDataDiffractionCTv1 import XSDataResultPowderIntegration
     xsDataResultPowderIntegrationReference = XSDataResultPowderIntegration.parseString(strXMLResultReference)
     EDAssert.equal(xsDataResultPowderIntegrationReference.marshal(), xsDataResultPowderDiffraction.marshal())
开发者ID:antolinos,项目名称:edna,代码行数:15,代码来源:EDTestCaseEDHandlerFIT2Dv1_0.py

示例5: testGenerateXSDataMOSFLMInputIntegration

 def testGenerateXSDataMOSFLMInputIntegration(self):
     strFilename = "XSDataIntegrationInput_reference.xml"
     strPath = os.path.join(self.m_strDataPath, strFilename)
     strXMLIntegrationInput = EDUtilsTest.readAndParseFile(strPath)
     from XSDataMXv1 import XSDataIntegrationInput
     xsDataIntegrationInput = XSDataIntegrationInput.parseString(strXMLIntegrationInput)
     from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
     xsDataMOSFLMInputIntegration = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIntegration(xsDataIntegrationInput)
     strReferenceFilename = "XSDataMOSFLMInputIntegration_reference.xml"
     strReferencePath = os.path.join(self.m_strDataPath, strReferenceFilename)
     strXMLIntegrationInputReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDFactoryPluginStatic.loadModule("XSDataMOSFLMv10")
     from XSDataMOSFLMv10 import XSDataMOSFLMInputIntegration
     xsDataMOSFLMInputIntegrationReference = XSDataMOSFLMInputIntegration.parseString(strXMLIntegrationInputReference)
     EDAssert.equal(xsDataMOSFLMInputIntegrationReference.marshal(), xsDataMOSFLMInputIntegration.marshal())
开发者ID:olofsvensson,项目名称:edna-plugins-mx,代码行数:15,代码来源:EDTestCaseEDHandlerMOSFLMv10.py

示例6: testGenerateXSDataIndexingResult

 def testGenerateXSDataIndexingResult(self):
     """
     This method tests the generation of an XSDataIndexingResult object given an XSDataResultLabelit object.
     """
     strPath = os.path.join(self.strDataPath, self.strReferenceOutputFile)
     strXMLResultLabelit = EDUtilsTest.readAndParseFile(strPath)
     EDFactoryPluginStatic.loadModule("XSDataLabelitv10")
     from XSDataLabelitv10 import XSDataResultLabelit
     xsDataResultLabelit = XSDataResultLabelit.parseString(strXMLResultLabelit)
     from EDHandlerXSDataLabelitv10 import EDHandlerXSDataLabelitv10
     xsDataIndexingResult = EDHandlerXSDataLabelitv10.generateXSDataIndexingResult(xsDataResultLabelit)
     strReferencePath = os.path.join(self.strDataPath, "XSDataIndexingResult_reference.xml")
     strIndexingResultReferenceXML = EDUtilsTest.readAndParseFile(strReferencePath)
     from XSDataMXv1 import XSDataIndexingResult
     xsDataIndexingResultReference = XSDataIndexingResult.parseString(strIndexingResultReferenceXML)
     EDAssert.equal(xsDataIndexingResultReference.marshal(), xsDataIndexingResult.marshal())
开发者ID:antolinos,项目名称:edna,代码行数:16,代码来源:EDTestCaseEDHandlerLabelitv10.py

示例7: testSetDataInput

 def testSetDataInput( self ):
     """
     This method test the setDataInput method of the SRBRegister plugin by providing an XML string
     and then retriving an XSDataInputLabelit object.  It checks both inputs
     """
     #Create the plugin instance
     edPluginExecSRBRegister = self.createPlugin()
     # create an object which contains the test information
     edStringInputExecSRBRegisterv10XML  = EDUtilsTest.readAndParseFile( self.m_edStringReferenceDataInputFile )
     # gives the data to the plugin
     edPluginExecSRBRegister.setDataInput( edStringInputExecSRBRegisterv10XML )
     # get the data from the plugin
     xsDataInputPluginExecSRBRegister = edPluginExecSRBRegister.getDataInput()
     # get the string of the path
     edStringPath = EDString( xsDataInputPluginExecSRBRegister.getSrbDropFileName().getPath().getValue() )
     # create the test path 
     edStringPathReference = EDString( "../data/out/test2.drop" )
     # Actually test the data.
     EDAssert.equal( edStringPathReference, edStringPath )
     
     # test the reading of the other data
     edStringPath = EDString( xsDataInputPluginExecSRBRegister.getXmlIngestFileName().getPath().getValue() )
     # create the test path 
     edStringPathReference = EDString( "../data/create-ds.xml" )
     # Actually test the data.
     EDAssert.equal( edStringPathReference, edStringPath )
开发者ID:antolinos,项目名称:edna,代码行数:26,代码来源:EDTestCasePluginExecUnitSRBRegisterv10.py

示例8: __init__

 def __init__(self, _pyStrTestName=None):
     EDTestCase.__init__(self, _pyStrTestName)
     strKernelDataHome = EDUtilsTest.getPluginTestDataDirectory(self.getClassName())
     strDataDir = "EDHandlerRaddosev10"
     self.strDataPath = EDUtilsPath.mergePath(strKernelDataHome, strDataDir)
     self.strReferenceInputFile2 = EDUtilsPath.mergePath(self.strDataPath, "XSDataRaddosev10Input_reference_02.xml")
     self.strObtainedInputFile2 = "XSDataInputRaddosev10FromObject_02.xml"
开发者ID:antolinos,项目名称:edna,代码行数:7,代码来源:EDTestCaseEDHandlerRaddosev10.py

示例9: testFileNameExtraction

    def testFileNameExtraction( self ):
        """
        This method should test to make sure that the plugin is extracting the correct file 
        list from the xml ingest file
        """
        
        try :
            os.rename("../data/create-ds.xml.icat","../data/create-ds.xml")
        except :
            print "nothing to delete"     
            
        # Create the plugin instance
        edPluginExecSRBRegister = self.createPlugin()
        # Read in the data from the XML 
        edStringInputExecSRBRegisterv10XML  = EDUtilsTest.readAndParseFile( self.m_edStringReferenceDataInputFile )

        # gives the data to the plugin
        edPluginExecSRBRegister.setDataInput( edStringInputExecSRBRegisterv10XML )
        
        edPluginExecSRBRegister.openXMLTree()
        
        edFilelist = edPluginExecSRBRegister.processFileList()
        
        # assert that the filelist is correct
        edTestlist = ["EDPluginExecSRBRegisterv10_output.xml\n"]
        
        EDAssert.equal(edFilelist,edTestlist)
开发者ID:antolinos,项目名称:edna,代码行数:27,代码来源:EDTestCasePluginExecUnitSRBRegisterv10.py

示例10: testSpatialDistortion

    def testSpatialDistortion(self):
        strRefX = "spline-3-18x.edf"
        strRefY = "spline-3-18y.edf"
        self.loadTestImage([strRefX, strRefY])
        edPluginSPD = self.createPlugin()
        strXMLInput = EDUtilsTest.readAndParseFile(self.strReferenceInputFileName)
        xsDataInputSPDCake = XSDataInputSPDCake.parseString(strXMLInput)
        edPluginSPD.setDataInput(xsDataInputSPDCake)
        edPluginSPD.configure()
        edPluginSPD.getInputParameter()
        ########################################################################
        # Enforce some values
        ########################################################################
        edPluginSPD.dictGeometry["SpatialDistortionFile"] = os.path.join(self.getPluginTestsDataHome(), "frelon_spline_file_to_correct_SPD.spline")
        edPluginSPD.dictGeometry["TiltRotation"] = 18
        edPluginSPD.dictGeometry["AngleOfTilt"] = 3
        spline = Spline()
        spline.read(edPluginSPD.dictGeometry["SpatialDistortionFile"])
        edPluginSPD.dictGeometry["PixelSizeX"], edPluginSPD.dictGeometry["PixelSizeY"] = spline.getPixelSize()
        edPluginSPD.createDisplacementMatrix(spline)
        edPluginSPD.cleanDispMat(edPluginSPD.getWorkingDirectory())

        refX = fabio.openimage.openimage(os.path.join(self.getTestsDataImagesHome(), strRefX)).data
        obtX = fabio.openimage.openimage(os.path.join(edPluginSPD.getWorkingDirectory(), "frelon_spline_file_to_correct_SPD-tilted-x.edf")).data
        refY = fabio.openimage.openimage(os.path.join(self.getTestsDataImagesHome(), strRefY)).data
        obtY = fabio.openimage.openimage(os.path.join(edPluginSPD.getWorkingDirectory(), "frelon_spline_file_to_correct_SPD-tilted-y.edf")).data

#        print edPluginSPD.dictGeometry
        EDAssert.arraySimilar(obtX, refX , _fAbsMaxDelta=0.1, _strComment="X displacement Matrix is the same")
        EDAssert.arraySimilar(obtY, refY , _fAbsMaxDelta=0.1, _strComment="Y displacement Matrix is the same")
开发者ID:olofsvensson,项目名称:edna-plugins-exec,代码行数:30,代码来源:EDTestCasePluginUnitSPDCorrectv10.py

示例11: __init__

 def __init__(self, _pyStrTestName=None):
     """
     """
     EDTestCase.__init__(self, _pyStrTestName)
     pyStrMXv1DataHome = EDUtilsTest.getPluginTestDataDirectory(self.getClassName())
     pyStrDataDir = "EDHandlerXDSv1_0"
     self.m_pyStrDataPath = os.path.join(pyStrMXv1DataHome, pyStrDataDir)
开发者ID:gbourgh,项目名称:edna,代码行数:7,代码来源:EDTestCaseEDHandlerXDSv1_0.py

示例12: __init__

 def __init__(self, _strTestName=None):
     EDTestCase.__init__(self, _strTestName)
     strMXv1DataHome = EDUtilsTest.getPluginTestDataDirectory(self.getClassName())
     strDataDir = "EDHandlerBestv1_2"
     self.strDataPath = os.path.join(strMXv1DataHome, strDataDir)
     self.strReferenceInputFile = os.path.join(self.strDataPath, "XSDataInputStrategy_reference.xml")
     self.strReferenceOutputFile = os.path.join(self.strDataPath, "XSDataResultBestv1_2_reference.xml")
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:7,代码来源:EDTestCaseEDHandlerBestv1_2.py

示例13: testDropFileCreation

    def testDropFileCreation( self ):
        """
        This test will check to make sure the dropfile is created correctly and saved properly
        """
        
        try :
            os.remove("../data/out/test2.drop")
        except :
            print "nothing to delete"
        
        try :
            os.rename("../data/create-ds.xml.icat","../data/create-ds.xml")
        except :
            print "nothing to delete"          
        
        # Create the plugin instance
        edPluginExecSRBRegister = self.createPlugin()
        # Read in the data from the XML, for the big xml 
        edStringInputExecSRBRegisterv10XML  = EDUtilsTest.readAndParseFile( self.m_edStringReferenceDataInputFile )

        # gives the data to the plugin
        edPluginExecSRBRegister.setDataInput( edStringInputExecSRBRegisterv10XML )
        
        # call the method
        edPluginExecSRBRegister.createDropFile();
        
        # finalise the process
        edPluginExecSRBRegister.moveGeneratedFiles()
        
        # check that the file has been created
        EDAssert.equal(True, os.path.isfile("../data/out/test2.drop"))
        EDAssert.equal(True, os.path.isfile("../data/create-ds.xml.icat"))
开发者ID:antolinos,项目名称:edna,代码行数:32,代码来源:EDTestCasePluginExecUnitSRBRegisterv10.py

示例14: testGenerateXSDataInputLabelit

 def testGenerateXSDataInputLabelit(self, _strFileNameXSDataIndexingInput_reference,
                                           _strFileNameXSDataLabelitInput_reference):
     """
     This method is testing the generation of the XSDataInputLabelit object given a XSDataIndexingInput object.
     """
     strPath = os.path.join(self.strDataPath, _strFileNameXSDataIndexingInput_reference)
     strXMLIndexingInput = EDUtilsTest.readAndParseFile(strPath)
     from XSDataMXv1 import XSDataIndexingInput
     xsDataIndexingInput = XSDataIndexingInput.parseString(strXMLIndexingInput)
     from EDHandlerXSDataLabelitv10 import EDHandlerXSDataLabelitv10
     xsDataInputLabelit = EDHandlerXSDataLabelitv10.generateXSDataInputLabelit(xsDataIndexingInput)
     strReferencePath = os.path.join(self.strDataPath, _strFileNameXSDataLabelitInput_reference)
     strXMLInputLabelitReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDFactoryPluginStatic.loadModule("XSDataLabelitv10")
     from XSDataLabelitv10 import XSDataInputLabelit
     xsDataInputLabelitReference = XSDataInputLabelit.parseString(strXMLInputLabelitReference)
     EDAssert.equal(xsDataInputLabelitReference.marshal(), xsDataInputLabelit.marshal())
开发者ID:antolinos,项目名称:edna,代码行数:17,代码来源:EDTestCaseEDHandlerLabelitv10.py

示例15: getTestsDataImagesHome

 def getTestsDataImagesHome(self):
     """
     Returns the Test data home directory
     @return: TestsDataImagesHome
     @rtype: string
     """
     if (self.__strTestsDataImagesHome is None):
         self.__strTestsDataImagesHome = EDUtilsTest.getTestsDataImagesHome()
     return self.__strTestsDataImagesHome
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:9,代码来源:EDTestCase.py


注:本文中的EDUtilsTest.EDUtilsTest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。