Skip to content

Commit

Permalink
Tests: Add a smoke-check for listall() and attribute_types()
Browse files Browse the repository at this point in the history
  • Loading branch information
pyldap contributors authored and Petr Viktorin committed Nov 24, 2017
1 parent 2949e78 commit ebcdaae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tests/t_ldap_schema_subentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import ldif
import ldap.schema
from ldap.schema.models import ObjectClass

TEST_SUBSCHEMA_FILES = (
'Tests/ldif/subschema-ipa.demo1.freeipa.org.ldif',
Expand All @@ -30,6 +31,15 @@ def test_subschema_file(self):
_, subschema_subentry = ldif_parser.all_records[0]
sub_schema = ldap.schema.SubSchema(subschema_subentry)

# Smoke-check for listall() and attribute_types()
for objclass in sub_schema.listall(ObjectClass):
must, may = sub_schema.attribute_types([objclass])

for oid, attributetype in must.items():
self.assertEqual(attributetype.oid, oid)
for oid, attributetype in may.items():
self.assertEqual(attributetype.oid, oid)


if __name__ == '__main__':
unittest.main()

0 comments on commit ebcdaae

Please sign in to comment.