Exemple #1
0
def test_setup_custodian_settings_no_inputs():
    from aiida_cusp.utils.custodian import CustodianSettings
    from aiida_cusp.utils.defaults import CustodianDefaults
    val = 'updated_value'
    defaults = dict(CustodianDefaults.CUSTODIAN_SETTINGS)
    # instantiate custodian settings and test setup_vaspjob_settings method
    # with defined settings
    custodian_settings = CustodianSettings(val, val, val, settings={})
    output_settings = custodian_settings.setup_custodian_settings({})
    assert output_settings == defaults
Exemple #2
0
def test_setup_custodian_settings_with_inputs():
    from aiida_cusp.utils.custodian import CustodianSettings
    from aiida_cusp.utils.defaults import CustodianDefaults
    val = 'updated_value'
    settings = {key: val for key in CustodianDefaults.MODIFIABLE_SETTINGS}
    # update default parameters with given value
    expected_settings = dict(CustodianDefaults.CUSTODIAN_SETTINGS)
    expected_settings.update(settings)
    # instantiate custodian settings and test setup_custodian_settings method
    # with defined settings
    custodian_settings = CustodianSettings(val, val, val, settings={})
    output_settings = custodian_settings.setup_custodian_settings(settings)
    assert output_settings == expected_settings