def METHOD_NAME(tempdir: Path, file_pusher: Mock):
    elapsed = 0
    with patch.object(time, "time", lambda: elapsed):
        f = tempdir / "my-file.txt"
        write_with_mtime(f, b"content", mtime=0)
        policy = PolicyLive(str(f), f.name, file_pusher)
        policy.on_modified()
        file_pusher.reset_mock()
        elapsed += 1
        write_with_mtime(f, b"new content", mtime=elapsed)
        policy.on_modified()  # modifying the file shouldn't re-upload it because of the rate-limiting...
        file_pusher.file_changed.assert_not_called()
        policy.finish()  # ...but finish() should force a re-upload
        file_pusher.file_changed.assert_called()