def test_refresh_usermap_warning():

    def assert_warn(msg, key, value, targetvalue):
        assert key == 'a'
        assert value == '1'
        assert targetvalue == '2'
    target = {'a': 'b'}
    refresh_usermap(
        source={'a': '1'},
        target=target,
        union=False)
    assert target == {'a': 'b'}
def test_refresh_usermap(source, target, union, expected):
    target = target.copy()
    refresh_usermap(
        source=source, target=target, union=union, _warn=die)
    assert target == expected