Add missing docstrings and 1 unittest for LDAP utf-8 fixes

A minimal backport of these accepted master commits:

https://review.openstack.org/#/c/82396/
https://review.openstack.org/#/c/82398/
https://review.openstack.org/#/c/82399/

was done for Icehouse in the following:

https://review.openstack.org/#/c/91883/

In the above backport review it was requested docstrings be added for
some functions and an additional unittest be added. That work was done
for the Icehouse backport and was positively reviewed, at the same it
was requested the those changes be reflected back into master so as
not to lose them going forward. This patch does that, adds the
docstrings and one additional small unittest.

Change-Id: I881ba9b274692427d4c7b9f5357ee4735b4e6699
Related-Bug: #1172106
Merge "Add missing docstrings and 1 unittest for LDAP utf-8 fixes"