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']"
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']"
def test_ignore_superfluous_param(): # superfluous ignored substituted = substitute_check_superfluous_mappings( '$param', dict(param=1, param2=2), ignore_unused=['param2']) assert substituted == '1'
def test_ignore_superfluous_param(): # superfluous ignored substituted = substitute_check_superfluous_mappings('$param', dict(param=1, param2=2), ignore_unused=['param2']) assert substituted == '1'