Esempio n. 1
0
def test_superfluous_param():
    ## superfluous param
    substituted = substitute_check_superfluous_mappings('$param', dict(param=1))
    assert substituted == '1'
    
    with pytest.raises(ValueError) as excinfo:
        substitute_check_superfluous_mappings('$param', dict(param=1, param2=2))
    assert excinfo.value.message == "Unused parameters: ['param2']"
Esempio n. 2
0
def test_superfluous_param():
    ## superfluous param
    substituted = substitute_check_superfluous_mappings(
        '$param', dict(param=1))
    assert substituted == '1'

    with pytest.raises(ValueError) as excinfo:
        substitute_check_superfluous_mappings('$param', dict(param=1,
                                                             param2=2))
    assert excinfo.value.message == "Unused parameters: ['param2']"
Esempio n. 3
0
def test_ignore_superfluous_param():
    # superfluous ignored
    substituted = substitute_check_superfluous_mappings(
        '$param', dict(param=1, param2=2), ignore_unused=['param2'])
    assert substituted == '1'
Esempio n. 4
0
def test_ignore_superfluous_param():
    # superfluous ignored
    substituted = substitute_check_superfluous_mappings('$param',
        dict(param=1, param2=2), ignore_unused=['param2'])
    assert substituted == '1'