def _overridden_potcar(self): result = {} if self.args.overridden_potcar: result.update(potcar_str2dict(self.args.overridden_potcar)) return result
def test_none(): assert potcar_str2dict(None) == {}
def test_incorrect_element_potcar_error(): with pytest.raises(ValueError): potcar_str2dict(["MgHH", "Mg"])
def test_mutliple_potcars_for_same_element_error(): with pytest.raises(ValueError): potcar_str2dict(["Mg_pv", "Mg"])
def test_str(): expected = {"Mg": "Mg_pv"} actual = potcar_str2dict("Mg_pv") assert actual == expected
def test_list(): expected = {"Mg": "Mg_pv", "O": "O_h"} actual = potcar_str2dict(["Mg_pv", "O_h"]) assert actual == expected