Пример #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