-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lib/ldap/controls/sss: use str instead of basestring on Python 3
* Python 3 has no basestring, use str instead * Add a very minimal test to create a SSSRequestControl Fixes: https://github.com/python-ldap/python-ldap/issues/255
- Loading branch information
Ondřej Kuzník
authored and
Petr Viktorin
committed
Jan 30, 2019
1 parent
576d5bf
commit 2059c13
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import unittest | ||
|
||
# Switch off processing .ldaprc or ldap.conf before importing _ldap | ||
os.environ['LDAPNOINIT'] = '1' | ||
|
||
from ldap.controls import sss | ||
|
||
|
||
class TestControlsPPolicy(unittest.TestCase): | ||
def test_create_sss_request_control(self): | ||
control = sss.SSSRequestControl(ordering_rules=['-uidNumber']) | ||
self.assertEqual(control.ordering_rules, ['-uidNumber']) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |