57
57
"""
58
58
59
59
60
- class Test01_SimpleLDAPObject (SlapdTestCase ):
60
+ class Test00_SimpleLDAPObject (SlapdTestCase ):
61
61
"""
62
62
test LDAP search operations
63
63
"""
@@ -66,7 +66,7 @@ class Test01_SimpleLDAPObject(SlapdTestCase):
66
66
67
67
@classmethod
68
68
def setUpClass (cls ):
69
- super (Test01_SimpleLDAPObject , cls ).setUpClass ()
69
+ super (Test00_SimpleLDAPObject , cls ).setUpClass ()
70
70
# insert some Foo* objects via ldapadd
71
71
cls .server .ldapadd (
72
72
LDIF_TEMPLATE % {
@@ -85,7 +85,7 @@ def setUp(self):
85
85
# open local LDAP connection
86
86
self ._ldap_conn = self ._open_ldap_conn ()
87
87
88
- def test_search_subtree (self ):
88
+ def test001_search_subtree (self ):
89
89
result = self ._ldap_conn .search_s (
90
90
self .server .suffix ,
91
91
ldap .SCOPE_SUBTREE ,
@@ -115,7 +115,7 @@ def test_search_subtree(self):
115
115
]
116
116
)
117
117
118
- def test_search_onelevel (self ):
118
+ def test002_search_onelevel (self ):
119
119
result = self ._ldap_conn .search_s (
120
120
self .server .suffix ,
121
121
ldap .SCOPE_ONELEVEL ,
@@ -141,7 +141,7 @@ def test_search_onelevel(self):
141
141
]
142
142
)
143
143
144
- def test_search_oneattr (self ):
144
+ def test003_search_oneattr (self ):
145
145
result = self ._ldap_conn .search_s (
146
146
self .server .suffix ,
147
147
ldap .SCOPE_SUBTREE ,
@@ -154,7 +154,7 @@ def test_search_oneattr(self):
154
154
[('cn=Foo4,ou=Container,' + self .server .suffix , {'cn' : ['Foo4' ]})]
155
155
)
156
156
157
- def test_errno107 (self ):
157
+ def test004_errno107 (self ):
158
158
l = self .ldap_object_class ('ldap://127.0.0.1:42' )
159
159
try :
160
160
m = l .simple_bind_s ("" , "" )
@@ -169,7 +169,7 @@ def test_errno107(self):
169
169
else :
170
170
self .fail ("expected SERVER_DOWN, got %r" % r )
171
171
172
- def test_invalid_credentials (self ):
172
+ def test005_invalid_credentials (self ):
173
173
l = self .ldap_object_class (self .server .ldap_uri )
174
174
# search with invalid filter
175
175
try :
@@ -180,7 +180,7 @@ def test_invalid_credentials(self):
180
180
else :
181
181
self .fail ("expected INVALID_CREDENTIALS, got %r" % r )
182
182
183
- def test_sasl_extenal_bind_s (self ):
183
+ def test006_sasl_extenal_bind_s (self ):
184
184
l = self .ldap_object_class (self .server .ldapi_uri )
185
185
l .sasl_external_bind_s ()
186
186
self .assertEqual (l .whoami_s (), 'dn:' + self .server .root_dn .lower ())
@@ -190,30 +190,30 @@ def test_sasl_extenal_bind_s(self):
190
190
self .assertEqual (l .whoami_s (), authz_id .lower ())
191
191
192
192
193
- class Test02_ReconnectLDAPObject ( Test01_SimpleLDAPObject ):
193
+ class Test01_ReconnectLDAPObject ( Test00_SimpleLDAPObject ):
194
194
"""
195
195
test ReconnectLDAPObject by restarting slapd
196
196
"""
197
197
198
198
ldap_object_class = ReconnectLDAPObject
199
199
200
- def test_reconnect_sasl_external (self ):
200
+ def test101_reconnect_sasl_external (self ):
201
201
l = self .ldap_object_class (self .server .ldapi_uri )
202
202
l .sasl_external_bind_s ()
203
203
authz_id = l .whoami_s ()
204
204
self .assertEqual (authz_id , 'dn:' + self .server .root_dn .lower ())
205
205
self .server .restart ()
206
206
self .assertEqual (l .whoami_s (), authz_id )
207
207
208
- def test_reconnect_simple_bind (self ):
208
+ def test102_reconnect_simple_bind (self ):
209
209
l = self .ldap_object_class (self .server .ldapi_uri )
210
210
bind_dn = 'cn=user1,' + self .server .suffix
211
211
l .simple_bind_s (bind_dn , 'user1_pw' )
212
212
self .assertEqual (l .whoami_s (), 'dn:' + bind_dn )
213
213
self .server .restart ()
214
214
self .assertEqual (l .whoami_s (), 'dn:' + bind_dn )
215
215
216
- def test_reconnect_get_state (self ):
216
+ def test103_reconnect_get_state (self ):
217
217
l1 = self .ldap_object_class (self .server .ldapi_uri )
218
218
bind_dn = 'cn=user1,' + self .server .suffix
219
219
l1 .simple_bind_s (bind_dn , 'user1_pw' )
0 commit comments