def test_createCodex(self): #This test will be longish. Have to create a full codex. # Will fail for non-UW versions. directoryPath = os.path.realpath('../../../') basicDict = createDocs.createListDictionary(self.values[0], self.values[1], self.values[2],self.values[3],directoryPath,self.values[5],self.values[6],self.values[7],self.values[8]) #redirecting output of function so it doesn't display to stout saveout = sys.stdout fsock = open('test_createCodex.log', 'w') sys.stdout = fsock #create Codex createDocument.checkOutputPath(self.values[5]) createDocs.findVersion(basicDict) createDocs.createCodex(basicDict) sys.stdout = saveout fsock.close() #should go back to stout now ... #check for existence of html files that should have been created. self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'index.html'))) self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'StGermain.html'))) self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'StgDomain.html'))) self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'StgFEM.html'))) self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'PICellerator.html'))) self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'Underworld.html'))) self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'gLucifer.html'))) print "Tested createCodex"
#Define input directory (relative to ~/stgUnderworldE/ ) if values[4] != "" : directoryPath = os.path.realpath(values[4]) else: directoryPath = os.path.realpath('../../') print directoryPath # Create the output directory. This is relative to the ./mainProj/config page.(relative to ~/stgUnderworldE/ ) if values[5] != "": docPath = os.path.realpath(values[5]) else: docPath = os.path.join(directoryPath, 'doc/') print docPath # createDictionary mainDictionary = createListDictionary(values[1],values[2], values[3], "", directoryPath, docPath, values[6]) # Set up help print statement if ((mainDictionary['arg1'] == "help") or (mainDictionary['arg1'] == '-h') or (mainDictionary['arg1'] =='--help') or (mainDictionary['arg1'] == 'h')): printHelpStatement(mainDictionary) else: #check the directory now exists. createDocument.checkOutputPath(docPath) createCodex(mainDictionary)