def METHOD_NAME(tmp_path):
    """
    Test to create a beacon based on a file
    """
    name = "/tmp/tempfile"
    event_returns = [
        {
            "complete": True,
            "tag": "/salt/minion/minion_beacons_list_complete",
            "beacons": {},
        },
        {
            "complete": True,
            "tag": "/salt/minion/minion_beacons_list_complete",
            "beacons": {},
        },
        {
            "complete": True,
            "tag": "/salt/minion/minion_beacons_list_available_complete",
            "beacons": ["inotify"],
        },
        {
            "valid": True,
            "tag": "/salt/minion/minion_beacon_validation_complete",
            "vcomment": "Valid beacon configuration",
        },
        {
            "complete": True,
            "tag": "/salt/minion/minion_beacon_add_complete",
            "beacons": {
                "beacon_inotify_/tmp/tempfile": [
                    {
                        "files": {
                            "/tmp/tempfile": {"mask": ["create", "delete", "modify"]},
                        }
                    },
                    {"interval": 60},
                    {"coalesce": False},
                    {"beacon_module": "inotify"},
                ]
            },
        },
    ]
    mock = MagicMock(return_value=True)
    beacon_state_mocks = {
        "beacons.list": beaconmod.list_,
        "beacons.add": beaconmod.add,
        "beacons.list_available": beaconmod.list_available,
        "event.fire": mock,
    }
    beacon_mod_mocks = {"event.fire": mock}
    sock_dir = str(tmp_path / "test-socks")
    with patch.dict(filestate.__states__, {"beacon.present": beaconstate.present}):
        with patch.dict(beaconstate.__salt__, beacon_state_mocks):
            with patch.dict(beaconmod.__salt__, beacon_mod_mocks):
                with patch.dict(
                    beaconmod.__opts__, {"beacons": {}, "sock_dir": sock_dir}
                ):
                    with patch.object(
                        SaltEvent, "get_event", side_effect=event_returns
                    ):
                        ret = filestate.mod_beacon(name, sfun="managed", beacon="True")
                        expected = {
                            "name": "beacon_inotify_/tmp/tempfile",
                            "changes": {},
                            "result": True,
                            "comment": "Adding beacon_inotify_/tmp/tempfile to beacons",
                        }
                        assert ret == expected