def METHOD_NAME(self, bash, family, result):
    assert_bash_exec(
        bash,
        "unset -v COMPREPLY BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE",
    )
    output = assert_bash_exec(
        bash,
        "BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE= "
        "_known_hosts_real -%sF _known_hosts_real/localhost_config ''; "
        r'printf "%%s\n" "${COMPREPLY[@]}"' % family,
        want_output=True,
    )
    assert sorted(set(output.strip().split())) == sorted(result.split())