

@unittest.skipIf((parse_version(pymatgen.__version__) <= parse_version('3.2.3')), 'New QChem 4.2 PCM format in pymatgen is a feature after version 3.2.3')
def test_pcm_solvent_deprecated(self):
    shutil.copyfile(os.path.join(test_dir, 'pcm_solvent_deprecated.qcinp'), os.path.join(scr_dir, 'pcm_solvent_deprecated.qcinp'))
    shutil.copyfile(os.path.join(test_dir, 'pcm_solvent_deprecated.qcout'), os.path.join(scr_dir, 'pcm_solvent_deprecated.qcout'))
    h = QChemErrorHandler(input_file='pcm_solvent_deprecated.qcinp', output_file='pcm_solvent_deprecated.qcout')
    has_error = h.check()
    self.assertTrue(has_error)
    d = h.correct()
    self.assertEqual(d, {
        'errors': ['Bad SCF convergence', 'Molecular charge is not found', 'No input text', 'pcm_solvent deprecated'],
        'actions': ['use keyword solvent instead'],
    })
    with open(os.path.join(test_dir, 'pcm_solvent_deprecated_use_qc42_format.qcinp')) as f:
        ref = [line.strip() for line in f.readlines()]
    with open(os.path.join(scr_dir, 'pcm_solvent_deprecated.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_pcm_solvent_deprecated/original