

def test_json_serializable(self):
    q1 = QChemErrorHandler()
    str1 = json.dumps(q4, cls=MontyEncoder)
    q2 = json.loads(str1, cls=MontyDecoder)
    self.assertEqual(q1.as_dict(), q2.as_dict())
    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'))
    q3 = QChemErrorHandler(input_file='qunino_vinyl.qcinp', output_file='qunino_vinyl.qcout')
    q3.check()
    q3.correct()
    for od in q3.outdata:
        od.pop('input')
    str3 = json.dumps(q3, cls=MontyEncoder)
    q4 = json.loads(str3, cls=MontyDecoder)
    self.assertEqual(q3.as_dict(), q4.as_dict())

dataset/ETHPy150Open materialsproject/custodian/custodian/qchem/tests/test_handlers.py QChemErrorHandlerTest.test_json_serializable/VarMisuse@22/30 `q1`->`q4`