def test_setup_vaspjob_settings_no_input(is_neb): from aiida_cusp.utils.custodian import CustodianSettings from aiida_cusp.utils.defaults import CustodianDefaults, PluginDefaults vasp_cmd = None stdout = PluginDefaults.STDOUT_FNAME stderr = PluginDefaults.STDERR_FNAME if is_neb: defaults = dict(CustodianDefaults.VASP_NEB_JOB_SETTINGS) else: defaults = dict(CustodianDefaults.VASP_JOB_SETTINGS) # instantiate custodian settings with default values for vasp_cmd, stdout # and stderr custodian_settings = CustodianSettings(vasp_cmd, stdout, stderr, settings={}, is_neb=is_neb) output_settings = custodian_settings.setup_vaspjob_settings({}) assert output_settings == defaults
def test_setup_vaspjob_settings_with_inputs(is_neb): from aiida_cusp.utils.custodian import CustodianSettings from aiida_cusp.utils.defaults import CustodianDefaults val = 'updated_value' if is_neb: defaults = dict(CustodianDefaults.VASP_NEB_JOB_SETTINGS) else: defaults = dict(CustodianDefaults.VASP_JOB_SETTINGS) updated = {key: val for key in defaults.keys()} settings = dict(updated) # pop non-optional parameters from settings settings.pop('vasp_cmd') settings.pop('output_file') settings.pop('stderr_file') # instantiate custodian settings and test setup_vaspjob_settings method # with defined settings custodian_settings = CustodianSettings(val, val, val, settings={}, is_neb=is_neb) output_settings = custodian_settings.setup_vaspjob_settings(settings) assert output_settings == updated