Example #1
0
def test_set_nested05():
    my_dict = {}
    mads._set_nested(my_dict, ["zoop"], None)
    assert my_dict["zoop"] is None
Example #2
0
def test_set_nested04(atlas):
    with pytest.raises(TypeError):
        mads._set_nested(atlas, ["zoop"], None)
Example #3
0
def test_set_nested02(atlas):
    mads._set_nested(
        atlas,
        ["compound_identifications", 0, ("compound", ), 0,
         ("inchi_key", )], "FOOBAR")
    assert atlas.compound_identifications[0].compound[0].inchi_key == "FOOBAR"
Example #4
0
def test_set_nested03(atlas):
    mads._set_nested(atlas, ["name"], "My Atlas")
    assert atlas.name == "My Atlas"
Example #5
0
def test_set_nested01():
    with pytest.raises(ValueError):
        mads._set_nested([], [], 0)