def testGetXSDataResultCharacterisation(self): strPathToCCP4iResult = os.path.join(self.getPluginTestsDataHome(), "XSDataResultCCP4i_reference.xml") strXML = self.readAndParseFile(strPathToCCP4iResult) EDFactoryPluginStatic.loadModule("XSDataCCP4iv1_1") from XSDataCCP4iv1_1 import XSDataResultCCP4i xsDataResultCCP4i = XSDataResultCCP4i.parseString(strXML) strListOfOutputFiles = xsDataResultCCP4i.getListOfOutputFiles().getValue() pluginMXCuBE = self.createPlugin() xsDataResultCharacterisation = pluginMXCuBE.getXSDataResultCharacterisation(strListOfOutputFiles) strPathToResultCharacterisationReference = os.path.join(self.getPluginTestsDataHome(), "EDPluginControlCharacterisationv1_1_dataOutput.xml") xsDataResultCharacterisationReference = XSDataResultCharacterisation.parseFile(strPathToResultCharacterisationReference) EDAssert.equal(xsDataResultCharacterisationReference.marshal(), xsDataResultCharacterisation.marshal())
def getXSDataResultCharacterisation(self, _strListOfOutputFiles): listResult = _strListOfOutputFiles.split() # Search for the outputfile xsDataResultCharacterisation = None strPathToXSDataResultCharacteristion = None for strLine in listResult: if (strLine.find("dataOutput.xml") != -1): strPathToXSDataResultCharacteristion = strLine if (strPathToXSDataResultCharacteristion is not None): xsDataResultCharacterisation = XSDataResultCharacterisation.parseFile(strPathToXSDataResultCharacteristion) else: errorMessage = EDMessage.ERROR_DATA_HANDLER_02 % ("EDPluginControlInterfaceToMXCuBEv1_2.getXSDataResultCharacterisation", "Cannot find dataOutput.xml file in %s" % _strListOfOutputFiles) EDVerbose.error(errorMessage) self.addErrorMessage(errorMessage) raise RuntimeError, errorMessage return xsDataResultCharacterisation
def testGetXSDataResultCharacterisation(self): strPathToCCP4iResult = os.path.join(self.getPluginTestsDataHome(), "XSDataResultCCP4i_reference.xml") strXML = self.readAndParseFile(strPathToCCP4iResult) EDFactoryPluginStatic.loadModule("XSDataCCP4iv1_1") from XSDataCCP4iv1_1 import XSDataResultCCP4i xsDataResultCCP4i = XSDataResultCCP4i.parseString(strXML) strListOfOutputFiles = xsDataResultCCP4i.getListOfOutputFiles( ).getValue() pluginMXCuBE = self.createPlugin() xsDataResultCharacterisation = pluginMXCuBE.getXSDataResultCharacterisation( strListOfOutputFiles) strPathToResultCharacterisationReference = os.path.join( self.getPluginTestsDataHome(), "EDPluginControlCharacterisationv1_1_dataOutput.xml") xsDataResultCharacterisationReference = XSDataResultCharacterisation.parseFile( strPathToResultCharacterisationReference) EDAssert.equal(xsDataResultCharacterisationReference.marshal(), xsDataResultCharacterisation.marshal())