

def test_autoz_error(self):
    shutil.copyfile(os.path.join(test_dir, 'qunino_vinyl.qcinp'), os.path.join(scr_dir, 'qunino_vinyl.qcinp'))
    shutil.copyfile(os.path.join(test_dir, 'qunino_vinyl.qcout'), os.path.join(scr_dir, 'qunino_vinyl.qcout'))
    h = QChemErrorHandler(input_file='qunino_vinyl.qcinp', output_file='qunino_vinyl.qcout')
    has_error = h.check()
    self.assertTrue(self)
    d = h.correct()
    self.assertEqual(d, {
        'errors': ['Bad SCF convergence', 'Geometry optimization failed', 'Molecular charge is not found', 'autoz error'],
        'actions': ['disable symmetry'],
    })
    with open(os.path.join(test_dir, 'qunino_vinyl_nosymm.qcinp')) as f:
        ref = [line.strip() for line in f.readlines()]
    with open(os.path.join(scr_dir, 'qunino_vinyl.qcinp')) as f:
        ans = [line.strip() for line in f.readlines()]
    self.assertEqual(ref, ans)
    shutil.copyfile(os.path.join(test_dir, 'qunino_vinyl_nosymm.qcinp'), os.path.join(scr_dir, 'qunino_vinyl_nosymm.qcinp'))
    shutil.copyfile(os.path.join(test_dir, 'qunino_vinyl.qcout'), os.path.join(scr_dir, 'qunino_vinyl.qcout'))
    h = QChemErrorHandler(input_file='qunino_vinyl_nosymm.qcinp', output_file='qunino_vinyl.qcout')
    has_error = h.check()
    self.assertTrue(has_error)
    d = h.correct()
    self.assertEqual(d, {
        'errors': ['Bad SCF convergence', 'Geometry optimization failed', 'Molecular charge is not found', 'autoz error'],
        'actions': None,
    })

dataset/ETHPy150Open materialsproject/custodian/custodian/qchem/tests/test_handlers.py QChemErrorHandlerTest.test_autoz_error/VarMisuse@89/168 `has_error`->`self`