# TURBOMOLE DFT (BLYP) single point energy
from chemsh       import *
from chemsh.utils import testutils

water = Fragment(coords="water.cjson")

# default functional is 'blyp'
# default: convergence='tightscf'
turbomole = TURBOMOLE(frag=water, method='dft', functional="b-lyp", basis="SVP", convergence=8)

sp = SP(theory=turbomole)

sp.run()

ecalc = sp.result.energy

fname = "h2o_energy_blyp" 
with open("./tcl_results.dat", "r") as tclres:
    for l in tclres:
        if fname + ".chm" in l:
            eref = float(l.split(":")[-1])

testutils.validate(ecalc, eref)
