示例#1
0
 def _overridden_potcar(self):
     result = {}
     if self.args.overridden_potcar:
         result.update(potcar_str2dict(self.args.overridden_potcar))
     return result
示例#2
0
def test_none():
    assert potcar_str2dict(None) == {}
示例#3
0
def test_incorrect_element_potcar_error():
    with pytest.raises(ValueError):
        potcar_str2dict(["MgHH", "Mg"])
示例#4
0
def test_mutliple_potcars_for_same_element_error():
    with pytest.raises(ValueError):
        potcar_str2dict(["Mg_pv", "Mg"])
示例#5
0
def test_str():
    expected = {"Mg": "Mg_pv"}
    actual = potcar_str2dict("Mg_pv")
    assert actual == expected
示例#6
0
def test_list():
    expected = {"Mg": "Mg_pv", "O": "O_h"}
    actual = potcar_str2dict(["Mg_pv", "O_h"])
    assert actual == expected