File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 15
15
import ldif
16
16
from ldap .ldapobject import SimpleLDAPObject
17
17
import ldap .schema
18
- from ldap .schema .models import ObjectClass
18
+ from ldap .schema .models import ObjectClass , AttributeType
19
19
from slapdtest import SlapdTestCase , requires_ldapi
20
20
21
21
HERE = os .path .abspath (os .path .dirname (__file__ ))
@@ -65,6 +65,22 @@ def test_urlfetch_file(self):
65
65
)
66
66
67
67
68
+ class TestXOrigin (unittest .TestCase ):
69
+ def get_attribute_type (self , oid ):
70
+ openldap_uri = 'file://{}' .format (TEST_SUBSCHEMA_FILES [1 ])
71
+ dn , schema = ldap .schema .urlfetch (openldap_uri )
72
+ return schema .get_obj (AttributeType , oid )
73
+
74
+ def test_origin_none (self ):
75
+ self .assertEqual (
76
+ self .get_attribute_type ('2.5.4.0' ).x_origin , None )
77
+
78
+ def test_origin_string (self ):
79
+ self .assertEqual (
80
+ self .get_attribute_type ('1.3.6.1.4.1.3401.8.2.8' ).x_origin ,
81
+ 'Pretty Good Privacy (PGP)' )
82
+
83
+
68
84
class TestSubschemaUrlfetchSlapd (SlapdTestCase ):
69
85
ldap_object_class = SimpleLDAPObject
70
86
You can’t perform that action at this time.
0 commit comments