diff --git a/Tests/t_ldap_schema_subentry.py b/Tests/t_ldap_schema_subentry.py index 5869b9d..edce931 100644 --- a/Tests/t_ldap_schema_subentry.py +++ b/Tests/t_ldap_schema_subentry.py @@ -15,7 +15,7 @@ import ldif from ldap.ldapobject import SimpleLDAPObject import ldap.schema -from ldap.schema.models import ObjectClass +from ldap.schema.models import ObjectClass, AttributeType from slapdtest import SlapdTestCase, requires_ldapi HERE = os.path.abspath(os.path.dirname(__file__)) @@ -65,6 +65,22 @@ def test_urlfetch_file(self): ) +class TestXOrigin(unittest.TestCase): + def get_attribute_type(self, oid): + openldap_uri = 'file://{}'.format(TEST_SUBSCHEMA_FILES[1]) + dn, schema = ldap.schema.urlfetch(openldap_uri) + return schema.get_obj(AttributeType, oid) + + def test_origin_none(self): + self.assertEqual( + self.get_attribute_type('2.5.4.0').x_origin, None) + + def test_origin_string(self): + self.assertEqual( + self.get_attribute_type('1.3.6.1.4.1.3401.8.2.8').x_origin, + 'Pretty Good Privacy (PGP)') + + class TestSubschemaUrlfetchSlapd(SlapdTestCase): ldap_object_class = SimpleLDAPObject