def METHOD_NAME(token, remote_dir: str, filename: str):
    """
    Checks that
        (1) the file was actually copied to latch, and
        (2) the file contents do not change from local -> latch -> local
    """
    filename = _normalize_remote_path(filename)
    remote_dir = _normalize_remote_path(remote_dir)
    initial = Path(f"initial_{filename}").resolve()
    final = Path(f"final_{filename}").resolve()
    try:
        if not remote_dir:
            remote_path = f"latch:///{filename}"
        else:
            remote_path = f"latch:///{remote_dir}/{filename}"
        initial_text = _random_name(100)
        with open(initial, "w") as f:
            f.write(initial_text)
        cmd = ["latch", "cp", initial, remote_path]
        _run_and_verify(cmd, f"Successfully copied {initial} to {remote_path}")
        assert _file_exists(token, remote_dir, filename)
        cmd = ["latch", "cp", remote_path, final]
        _run_and_verify(cmd, f"Successfully copied {remote_path} to {final}")
        with open(final, "r") as f:
            final_text = f.read()
        assert initial_text == final_text
        cmd = ["latch", "rm", remote_path]
        _run_and_verify(cmd, f"Successfully deleted {remote_path}")
        assert not _file_exists(token, remote_dir, filename)
    finally:
        if os.path.isfile(initial):
            os.remove(initial)
        if os.path.isfile(final):
            os.remove(final)