コード例 #1
0
def test_set_nested05():
    my_dict = {}
    mads._set_nested(my_dict, ["zoop"], None)
    assert my_dict["zoop"] is None
コード例 #2
0
def test_set_nested04(atlas):
    with pytest.raises(TypeError):
        mads._set_nested(atlas, ["zoop"], None)
コード例 #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"
コード例 #4
0
def test_set_nested03(atlas):
    mads._set_nested(atlas, ["name"], "My Atlas")
    assert atlas.name == "My Atlas"
コード例 #5
0
def test_set_nested01():
    with pytest.raises(ValueError):
        mads._set_nested([], [], 0)