def test_createHtmlPage(self): strDimpleOutput = os.path.join(self.strDataPath, "dimple", "Dimplev1_0_dataOutput.xml") strResultDimple = self.readAndParseFile(strDimpleOutput) xsDataResultDimple = XSDataResultDimple.parseString(strResultDimple) strPdfPath = os.path.join( xsDataResultDimple.resultsDirectory.path.value, "DIMPLE.pdf") edPlugin = self.getPlugin() strPyarchRootDir = tempfile.mkdtemp(prefix="html_", dir=os.path.join( self.strDataPath, "dimple")) strPrefix = "xtal5w1_1" strProposal = "mx415" strSessionDate = "2015-02-23" strBeamline = "id29" strResultsDirectory = strPyarchRootDir listPath = edPlugin.copyResults(strPrefix, strPyarchRootDir, xsDataResultDimple, strPdfPath) listPathHtml = edPlugin.createHtmlPage(strPrefix, xsDataResultDimple, strResultsDirectory, strPyarchRootDir, strProposal, strSessionDate, strBeamline) for pathHtml in listPathHtml: EDAssert.equal(True, os.path.exists(pathHtml), "HTML page generated") shutil.rmtree(strPyarchRootDir)
def test_createHtmlPage(self): strDimpleOutput = os.path.join(self.strDataPath, "dimple", "Dimplev1_0_dataOutput.xml") strResultDimple = self.readAndParseFile(strDimpleOutput) xsDataResultDimple = XSDataResultDimple.parseString(strResultDimple) strPdfPath = os.path.join(xsDataResultDimple.resultsDirectory.path.value, "DIMPLE.pdf") edPlugin = self.getPlugin() strPyarchRootDir = tempfile.mkdtemp(prefix="html_", dir=os.path.join(self.strDataPath, "dimple")) strPrefix = "xtal5w1_1" strProposal = "mx415" strSessionDate = "2015-02-23" strBeamline = "id29" listPath = edPlugin.copyResults(strPrefix, strPyarchRootDir, xsDataResultDimple, strPdfPath) listPathHtml = edPlugin.createHtmlPage(strPrefix, xsDataResultDimple, strPyarchRootDir, strProposal, strSessionDate, strBeamline) print listPathHtml for pathHtml in listPathHtml: EDAssert.equal(True, os.path.exists(pathHtml), "HTML page generated") shutil.rmtree(strPyarchRootDir)
def test_copyResults(self): strDimpleOutput = os.path.join(self.strDataPath, "dimple", "Dimplev1_0_dataOutput.xml") strResultDimple = self.readAndParseFile(strDimpleOutput) xsDataResultDimple = XSDataResultDimple.parseString(strResultDimple) edPlugin = self.getPlugin() strResultDir = tempfile.mkdtemp(prefix="EDTestCasePluginUnitControlRunDimplev1_0_") strPrefix = "xtal5w1_1" strPdfPath = os.path.join(xsDataResultDimple.resultsDirectory.path.value, "DIMPLE.pdf") listPath = edPlugin.copyResults(strPrefix, strResultDir, xsDataResultDimple, strPdfPath) EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_blob1v1_dimple.png")), "blob1v1.png") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_blob1v2_dimple.png")), "blob1v2.png") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_blob1v3_dimple.png")), "blob1v3.png") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_blob2v1_dimple.png")), "blob2v1.png") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_blob2v2_dimple.png")), "blob2v2.png") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_blob2v3_dimple.png")), "blob2v3.png") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_dimple.log")), "dimple.log") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_dimple.mtz")), "dimple.mtz") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_dimple.pdb")), "dimple.pdb") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_findblobs_dimple.log")), "findblobs.log") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_refmac5restr_dimple.log")), "refmac5restr.log") EDAssert.equal(True, os.path.exists(os.path.join(strResultDir, "ep_xtal5w1_1_results_dimple.pdf")), "dimple.pdf") shutil.rmtree(strResultDir)
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputDimple) self.setDataOutput(XSDataResultDimple()) self.strDimpleDir = None
def test_copyResults(self): strDimpleOutput = os.path.join(self.strDataPath, "dimple", "Dimplev1_0_dataOutput.xml") strResultDimple = self.readAndParseFile(strDimpleOutput) xsDataResultDimple = XSDataResultDimple.parseString(strResultDimple) edPlugin = self.getPlugin() strResultDir = tempfile.mkdtemp( prefix="EDTestCasePluginUnitControlRunDimplev1_0_") strPrefix = "xtal5w1_1" strPdfPath = os.path.join( xsDataResultDimple.resultsDirectory.path.value, "DIMPLE.pdf") listPath = edPlugin.copyResults(strPrefix, strResultDir, xsDataResultDimple, strPdfPath) EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_blob1v1_dimple.png")), "blob1v1.png") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_blob1v2_dimple.png")), "blob1v2.png") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_blob1v3_dimple.png")), "blob1v3.png") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_blob2v1_dimple.png")), "blob2v1.png") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_blob2v2_dimple.png")), "blob2v2.png") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_blob2v3_dimple.png")), "blob2v3.png") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_dimple.log")), "dimple.log") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_dimple.mtz")), "dimple.mtz") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_dimple.pdb")), "dimple.pdb") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_findblobs_dimple.log")), "findblobs.log") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_refmac5restr_dimple.log")), "refmac5restr.log") EDAssert.equal( True, os.path.exists( os.path.join(strResultDir, "ep_xtal5w1_1_results_dimple.pdf")), "dimple.pdf") shutil.rmtree(strResultDir)