

def test_ts_opt(self):
    shutil.copyfile(os.path.join(test_dir, 'ts_cf3_leave.qcinp'), os.path.join(scr_dir, 'ts_cf3_leave.qcinp'))
    shutil.copyfile(os.path.join(test_dir, 'ts_cf3_leave.qcout'), os.path.join(scr_dir, 'ts_cf3_leave.qcout'))
    h = QChemErrorHandler(input_file='ts_cf3_leave.qcinp', output_file='ts_cf3_leave.qcout')
    has_error = h.check()
    self.assertTrue(has_error)
    d = h.correct()
    self.assertEqual(d, {
        'errors': ['Exit Code 134', 'Geometry optimization failed'],
        'actions': ['increase_iter'],
    })
    with open(os.path.join(test_dir, 'ts_cf3_leave_reset_first_step_mol.qcinp')) as f:
        ref = [line.strip() for line in f.readlines()]
    with open(os.path.join(scr_dir, 'ts_cf3_leave.qcinp')) as f:
        ans = [line.strip() for line in f.readlines()]
    self.assertEqual(ref, ans)

dataset/ETHPy150Open materialsproject/custodian/custodian/qchem/tests/test_handlers.py QChemErrorHandlerTest.test_ts_opt/original