def METHOD_NAME(lab: typing.Optional[selftest.SelftestHost] = None) -> None:
    """Test if using a path on the wrong host fails."""
    with lab or selftest.SelftestHost() as lh:
        p = lh.workdir / "folder" / "file.txt"
        with tbot.acquire_lab() as lh2:
            raised = False
            try:
                # mypy detects that this is wrong
                lh2.exec0("echo", p)  # type: ignore
            except tbot.error.WrongHostError:
                raised = True
            assert raised
        # It is ok to clone a machine and reuse the path
        with lh.clone() as lh3:
            lh3.exec0("echo", p)
        lh.exec0("mkdir", "-p", p.parent)
        assert p.parent.is_dir()
        lh.exec0("uname", "-a", linux.RedirStdout(p))
        assert p.is_file()
        lh.exec0("rm", "-r", p.parent)
        assert not p.exists()
        assert not p.parent.exists()