From: <bao...@us...> - 2006-04-03 16:16:12
|
Revision: 51 Author: baoilleach Date: 2006-04-03 09:16:04 -0700 (Mon, 03 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=51&view=rev Log Message: ----------- Added convenience function to make it easier to access the data files in the data folder. Am considering changing all references to G03 or Gaussian03, to Gaussian, in line with GAMESS and ADF (which don't mention the specific version in the parser name). Modified Paths: -------------- trunk/test/testall.py Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-04-03 15:52:28 UTC (rev 50) +++ trunk/test/testall.py 2006-04-03 16:16:04 UTC (rev 51) @@ -20,22 +20,32 @@ class GaussianTest(GenericTest): def setUp(self): - self.data = G03(os.path.join("..","data","Gaussian","basicGaussian03","dvb_gopt.out")) - self.data.logger.setLevel(0) - self.data.parse() + self.data = getfile(G03,"basicGaussian03","dvb_gopt.out") class GamessTest(GenericTest): def setUp(self): - self.data = GAMESS(os.path.join("..","data","GAMESS","basicPCGAMESS","dvb_gopt_a.out")) - self.data.logger.setLevel(0) - self.data.parse() + self.data = getfile(GAMESS,"basicPCGAMESS","dvb_gopt_a.out") class ADFTest(GenericTest): def setUp(self): - self.data = ADF(os.path.join("..","data","ADF","basicADF2004.01","dvb_gopt.adfout")) - self.data.logger.setLevel(0) - self.data.parse() + self.data = getfile(ADF,"basicADF2004.01","dvb_gopt.adfout") + +def getfile(parser,*location): + """Returns a parsed logfile.""" + if parser.__name__ in ['GAMESS','ADF']: + fullpath = ("..","data",parser.__name__) + location + elif parser.__name__=="G03": + fullpath = ("..","data","Gaussian") + location + logfile = parser(os.path.join(*fullpath)) + logfile.logger.setLevel(0) + logfile.parse() + return logfile + +def visualtests(): + """These are not formal tests -- but they should be eyeballed.""" + pass + if __name__=="__main__": gaussiantests = unittest.makeSuite(GaussianTest) gamesstests = unittest.makeSuite(GamessTest) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |