Beispiel #1
0
def test_validate_opts_invalid_option():
    d1 = dict(c=3)
    d2 = dict(a=1, b=2)
    with pytest.raises(KedroMlflowConfigError,
                       match="Provided option 'c' is not valid"):
        # error if opts contains keys not in default
        _validate_opts(d1, d2)
Beispiel #2
0
def test_validate_opts_no_options():
    d1 = None
    d2 = dict(a=1, b=2)
    # override default when possible with d1 and d2 untouched
    assert _validate_opts(d1, d2) == d2
    assert d1 is None
    assert d2 == dict(a=1, b=2)
Beispiel #3
0
def test_validate_opts_missing_options():
    d1 = dict(a=4)
    d2 = dict(a=1, b=2)
    # override default when possible with d1 and d2  unmodified (i.e. deepcopied)
    assert _validate_opts(d1, d2) == dict(a=4, b=2)
    assert d1 == dict(a=4)
    assert d2 == dict(a=1, b=2)