def testTokenizerFinalGeometryEnergy(self): # fold>> data = FileSnippets.finalGeometryEnergy()+"\n" writeToTestFile(data) tokens = Dalton.tokenizeOutFile(testFilePath()) self.assertEqual(len(tokens), 1) self.assertEqual(tokens[0].__class__, Tokens.FinalGeometryEnergyToken)
def testFinalGeometryEnergyToken(self): # fold>> data = FileSnippets.finalGeometryEnergy() writeToTestFile(data) reader = FileReader.FileReader(testFilePath()) start_pos = reader.currentPos() token = Tokens.FinalGeometryEnergyToken.match(reader) self.assertEqual(token.__class__, Tokens.FinalGeometryEnergyToken) self.assertEqual(reader.currentPos(), start_pos + 1) energy = token.energy() self.assertEqual(type(energy), type("")) self.assertEqual(energy, "-113.984888")