本文整理汇总了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
示例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())
示例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())
示例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())
示例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())
示例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())
示例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 )
示例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"
示例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)
示例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")
示例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)
示例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")
示例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"))
示例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())
示例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