Exemplo n.º 1
0
 def testRasterConfiguration(self):
     strPathToTestConfigFile = os.path.join(self.strUnitTestDataHome,
                                            "XSConfiguration_raster.xml")
     edConfiguration = EDConfiguration(strPathToTestConfigFile)
     dictItem = edConfiguration.get(self.getPluginName())
     xsDataMOSFLMInput = XSDataMOSFLMInput()
     xsDataMOSFLMBeam = XSDataMOSFLMBeamPosition()
     xsDataMOSFLMBeam.setX(XSDataLength(1.0))
     xsDataMOSFLMBeam.setY(XSDataLength(2.0))
     xsDataMOSFLMInput.setBeam(xsDataMOSFLMBeam)
     xsDataMOSFLMDetector = XSDataMOSFLMDetector()
     xsDataMOSFLMDetector.setType(XSDataString("ADSC"))
     xsDataMOSFLMInput.setDetector(xsDataMOSFLMDetector)
     xsDataMOSFLMInput.setDirectory(XSDataString("/tmp"))
     xsDataMOSFLMInput.setTemplate(XSDataString("testdata_1_###.img"))
     xsDataMOSFLMInput.setWavelength(XSDataWavelength(1.1111))
     xsDataMOSFLMInput.setDistance(XSDataLength(222.22))
     edPluginMOSFLMv10 = self.createPlugin()
     edPluginMOSFLMv10.setScriptExecutable("cat")
     edPluginMOSFLMv10.setConfig(dictItem, _bLocal=True)
     edPluginMOSFLMv10.configure()
     edPluginMOSFLMv10.setXSDataInputClass(XSDataMOSFLMInput)
     edPluginMOSFLMv10.setDataInput(xsDataMOSFLMInput)
     edPluginMOSFLMv10.generateMOSFLMCommands()
     edListCommands = edPluginMOSFLMv10.getListCommandExecution()
     edListCommandsReference = [
         'WAVELENGTH 1.1111', 'DISTANCE 222.22', 'BEAM 1.0 2.0',
         'DETECTOR ADSC', 'DIRECTORY /tmp', 'TEMPLATE testdata_1_###.img',
         'RASTER 15 15 3 3 3'
     ]
     EDAssert.equal(edListCommandsReference, edListCommands,
                    "MOSFLM commands with ratser configured")
 def testRasterConfiguration(self):
     strPathToTestConfigFile = os.path.join(self.strUnitTestDataHome, "XSConfiguration_raster.xml")
     edConfiguration = EDConfiguration(strPathToTestConfigFile)
     edConfiguration.load()
     xsPluginItem = edConfiguration.getPluginItem("EDPluginMOSFLMv10")
     xsDataMOSFLMInput = XSDataMOSFLMInput()
     xsDataMOSFLMBeam = XSDataMOSFLMBeamPosition()
     xsDataMOSFLMBeam.setX(XSDataLength(1.0))
     xsDataMOSFLMBeam.setY(XSDataLength(2.0))
     xsDataMOSFLMInput.setBeam(xsDataMOSFLMBeam)
     xsDataMOSFLMDetector = XSDataMOSFLMDetector()
     xsDataMOSFLMDetector.setType(XSDataString("ADSC"))
     xsDataMOSFLMInput.setDetector(xsDataMOSFLMDetector)
     xsDataMOSFLMInput.setDirectory(XSDataString("/tmp"))
     xsDataMOSFLMInput.setTemplate(XSDataString("testdata_1_###.img"))
     xsDataMOSFLMInput.setWavelength(XSDataWavelength(1.1111))
     xsDataMOSFLMInput.setDistance(XSDataLength(222.22))
     edPluginMOSFLMv10 = self.createPlugin()
     edPluginMOSFLMv10.setScriptExecutable("cat")
     edPluginMOSFLMv10.setConfiguration(xsPluginItem)
     edPluginMOSFLMv10.configure()
     edPluginMOSFLMv10.setXSDataInputClass(XSDataMOSFLMInput)
     edPluginMOSFLMv10.setDataInput(xsDataMOSFLMInput)
     edPluginMOSFLMv10.generateMOSFLMCommands()
     edListCommands = edPluginMOSFLMv10.getListCommandExecution()
     edListCommandsReference = ['WAVELENGTH 1.1111', 'DISTANCE 222.22', 'BEAM 1.0 2.0', 'DETECTOR ADSC', 'DIRECTORY /tmp', 'TEMPLATE testdata_1_###.img', 'RASTER 15 15 3 3 3']
     EDAssert.equal(edListCommandsReference, edListCommands, "MOSFLM commands with ratser configured")
Exemplo n.º 3
0
 def testGenerateMOSFLMCommands(self):
     xsDataMOSFLMInput = XSDataMOSFLMInput()
     xsDataMOSFLMBeam = XSDataMOSFLMBeamPosition()
     xsDataMOSFLMBeam.setX(XSDataLength(1.0))
     xsDataMOSFLMBeam.setY(XSDataLength(2.0))
     xsDataMOSFLMInput.setBeam(xsDataMOSFLMBeam)
     xsDataMOSFLMDetector = XSDataMOSFLMDetector()
     xsDataMOSFLMDetector.setType(XSDataString("ADSC"))
     xsDataMOSFLMInput.setDetector(xsDataMOSFLMDetector)
     xsDataMOSFLMInput.setDirectory(XSDataString("/tmp"))
     xsDataMOSFLMInput.setTemplate(XSDataString("testdata_1_###.img"))
     xsDataMOSFLMInput.setWavelength(XSDataWavelength(1.1111))
     xsDataMOSFLMInput.setDistance(XSDataLength(222.22))
     edPluginMOSFLMv10 = self.createPlugin()
     edPluginMOSFLMv10.setScriptExecutable("cat")
     edPluginMOSFLMv10.configure()
     edPluginMOSFLMv10.setXSDataInputClass(XSDataMOSFLMInput)
     edPluginMOSFLMv10.setDataInput(xsDataMOSFLMInput)
     edPluginMOSFLMv10.generateMOSFLMCommands()
     edListCommands = edPluginMOSFLMv10.getListCommandExecution()
     edListCommandsReference = [
         'WAVELENGTH 1.1111', 'DISTANCE 222.22', 'BEAM 1.0 2.0',
         'DETECTOR ADSC', 'DIRECTORY /tmp', 'TEMPLATE testdata_1_###.img'
     ]
     EDAssert.equal(edListCommandsReference, edListCommands,
                    "MOSFLM commands")
     self.cleanUp(edPluginMOSFLMv10)
 def testGenerateMOSFLMCommands(self):
     xsDataMOSFLMInput = XSDataMOSFLMInput()
     xsDataMOSFLMBeam = XSDataMOSFLMBeamPosition()
     xsDataMOSFLMBeam.setX(XSDataLength(1.0))
     xsDataMOSFLMBeam.setY(XSDataLength(2.0))
     xsDataMOSFLMInput.setBeam(xsDataMOSFLMBeam)
     xsDataMOSFLMDetector = XSDataMOSFLMDetector()
     xsDataMOSFLMDetector.setType(XSDataString("ADSC"))
     xsDataMOSFLMInput.setDetector(xsDataMOSFLMDetector)
     xsDataMOSFLMInput.setDirectory(XSDataString("/tmp"))
     xsDataMOSFLMInput.setTemplate(XSDataString("testdata_1_###.img"))
     xsDataMOSFLMInput.setWavelength(XSDataWavelength(1.1111))
     xsDataMOSFLMInput.setDistance(XSDataLength(222.22))
     edPluginMOSFLMv10 = self.createPlugin()
     edPluginMOSFLMv10.setScriptExecutable("cat")
     edPluginMOSFLMv10.configure()
     edPluginMOSFLMv10.setXSDataInputClass(XSDataMOSFLMInput)
     edPluginMOSFLMv10.setDataInput(xsDataMOSFLMInput)
     edPluginMOSFLMv10.generateMOSFLMCommands()
     edListCommands = edPluginMOSFLMv10.getListCommandExecution()
     edListCommandsReference = ['WAVELENGTH 1.1111', 'DISTANCE 222.22', 'BEAM 1.0 2.0', 'DETECTOR ADSC', 'DIRECTORY /tmp', 'TEMPLATE testdata_1_###.img']
     EDAssert.equal(edListCommandsReference, edListCommands, "MOSFLM commands")
     self.cleanUp(edPluginMOSFLMv10)