

def test_scf_reset(self):
    shutil.copyfile(os.path.join(test_dir, 'hf_rca_tried_1.inp'), os.path.join(scr_dir, 'hf_scf_reset.inp'))
    shutil.copyfile(os.path.join(test_dir, 'hf_scf_reset.out'), os.path.join(scr_dir, 'hf_scf_reset.out'))
    h = QChemErrorHandler(input_file='hf_scf_reset.inp', output_file='hf_scf_reset.out')
    has_error = h.check()
    self.assertTrue(has_error)
    d = h.correct()
    self.assertEqual(d, {
        'errors': ['Bad SCF convergence', 'Geometry optimization failed'],
        'actions': ['reset'],
    })
    with open(os.path.join(test_dir, 'hf_scf_reset.inp')) as f:
        ref = [line.strip() for line in f.readlines()]
    with open(os.path.join(scr_dir, 'hf_scf_reset.inp')) 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_scf_reset/original