def METHOD_NAME(
    tempdir: Path, dir_watcher: DirWatcher
):
    f = tempdir / "my-file.txt"
    write_with_mtime(f, b"content", mtime=0)
    dir_watcher.update_policy("my-file.txt", "live")
    assert isinstance(
        dir_watcher._get_file_event_handler(str(f), "my-file.txt"), PolicyLive
    )
    dir_watcher.update_policy("my-file.txt", "end")
    assert isinstance(
        dir_watcher._get_file_event_handler(str(f), "my-file.txt"), PolicyEnd
    )