def test_list(self): a = [dict(x=1)] b = [dict(y=2)] c = utils.merge_params(a, b) assert c == [{"x": 1, "y": 2}]
def test_hierarchy(self): a = dict(a=dict(x=1)) b = dict(a=dict(y=2)) c = utils.merge_params(a, b) assert c == {"a": {"x": 1, "y": 2}}
def test_basic(self): a = dict(x=1) b = dict(y=2) c = utils.merge_params(a, b) assert c == {"x": 1, "y": 2}
def test_different_lengths(self): a = [dict(x=1)] b = [] with pytest.raises(ValueError): c = utils.merge_params(a, b)
def test_repeated_leafs(self): a = dict(a=dict(x=1)) b = dict(a=dict(x=2)) with pytest.raises(ValueError): c = utils.merge_params(a, b)