# TURBOMOLE HF single point energy

from chemsh       import *
from chemsh.utils import testutils

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


# default: convergence='tightscf'
turbomole = TURBOMOLE(frag=water, method="hf", basis="SVP")

sp = SP(theory=turbomole, gradients=True)

sp.run()

ecalc = sp.result.energy

fname = "h2o_energy_hf"
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)
