Skip to content

Commit ebcdaae

Browse files
pyldap contributorsencukou
authored andcommitted
Tests: Add a smoke-check for listall() and attribute_types()
1 parent 2949e78 commit ebcdaae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tests/t_ldap_schema_subentry.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import ldif
1212
import ldap.schema
13+
from ldap.schema.models import ObjectClass
1314

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

34+
# Smoke-check for listall() and attribute_types()
35+
for objclass in sub_schema.listall(ObjectClass):
36+
must, may = sub_schema.attribute_types([objclass])
37+
38+
for oid, attributetype in must.items():
39+
self.assertEqual(attributetype.oid, oid)
40+
for oid, attributetype in may.items():
41+
self.assertEqual(attributetype.oid, oid)
42+
3343

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy