def METHOD_NAME():
    """
    Test to sets alternative for <name> to <path>, if <path> is defined
    as an alternative for <name>.
    """
    name = "pager"
    path = "/usr/bin/less"
    ret = {"name": name, "path": path, "result": True, "changes": {}, "comment": ""}
    mock = MagicMock(side_effect=[path, path, ""])
    mock_bool = MagicMock(return_value=True)
    mock_show = MagicMock(side_effect=[path, False, False, False, False])
    with patch.dict(
        alternatives.__salt__,
        {
            "alternatives.display": mock,
            "alternatives.show_current": mock_show,
            "alternatives.set": mock_bool,
        },
    ):
        comt = "Alternative for {} already set to {}".format(name, path)
        ret.update({"comment": comt})
        assert alternatives.set_(name, path) == ret
        comt = "Alternative for {} will be set to path /usr/bin/less".format(name)
        ret.update({"comment": comt, "result": None})
        with patch.dict(alternatives.__opts__, {"test": True}):
            assert alternatives.set_(name, path) == ret
        comt = "Alternative for {} not updated".format(name)
        ret.update({"comment": comt, "result": True})
        with patch.dict(alternatives.__opts__, {"test": False}):
            assert alternatives.set_(name, path) == ret
        comt = "Alternative {} for {} doesn't exist".format(path, name)
        ret.update({"comment": comt, "result": False})
        assert alternatives.set_(name, path) == ret