Normal CLI tools should not have access to LDAP/IMAP
Fix the test and then ship it.
In general I think for the with_imap/with_ldap/with_files options; The tests should respect the config and e.g. just not test the ldap side if with_ldap is false because that test will simply never succeed if ldap is not available.
Your choice to fix that in this commit or separately.