Skip to content

Commit

Permalink
Ignore SASL methods in DSE test
Browse files Browse the repository at this point in the history
OpenLDAP may not offer SASL in restricted environments.

https://github.com/python-ldap/python-ldap/pull/163
Closes: https://github.com/python-ldap/python-ldap/issues/160
Signed-off-by: Christian Heimes <cheimes@redhat.com>
  • Loading branch information
Christian Heimes authored and Petr Viktorin committed Jan 15, 2018
1 parent 2387fe6 commit 1266c65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Tests/t_ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,15 @@ def test_dse(self):
dse = self._ldap_conn.read_rootdse_s()
self.assertIsInstance(dse, dict)
self.assertEqual(dse[u'supportedLDAPVersion'], [b'3'])
keys = set(dse)
# SASL info may be missing in restricted build environments
keys.discard(u'supportedSASLMechanisms')
self.assertEqual(
sorted(dse),
[u'configContext', u'entryDN', u'namingContexts', u'objectClass',
keys,
{u'configContext', u'entryDN', u'namingContexts', u'objectClass',
u'structuralObjectClass', u'subschemaSubentry',
u'supportedControl', u'supportedExtension', u'supportedFeatures',
u'supportedLDAPVersion', u'supportedSASLMechanisms']
u'supportedLDAPVersion'}
)
self.assertEqual(
self._ldap_conn.get_naming_contexts(),
Expand Down

0 comments on commit 1266c65

Please sign in to comment.