Skip to content

Commit

Permalink
removed pseudo test script from module ldap.cidict and added sub-modu…
Browse files Browse the repository at this point in the history
…le for testing class ldap.cidict.cidict
  • Loading branch information
stroeder committed Aug 15, 2017
1 parent e2bdb37 commit 09ec9c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Changes since 2.4.41:
Lib/
* added new SlapdObject methods _ln_schema_files() and
_create_sub_dirs()
* removed pseudo test script from module ldap.cidict

Tests/
* added sub-module for testing class ldap.cidict.cidict

----------------------------------------------------------------
Released 2.4.41 2017-07-12
Expand Down Expand Up @@ -1469,4 +1473,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.454 2017/08/03 17:26:59 stroeder Exp $
$Id: CHANGES,v 1.455 2017/08/15 16:14:04 stroeder Exp $
26 changes: 3 additions & 23 deletions Lib/ldap/cidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
returned from LDAP servers containing attribute
names of variable case.
See http://www.python-ldap.org/ for details.
See https://www.python-ldap.org/ for details.
$Id: cidict.py,v 1.13 2009/04/17 14:34:34 stroeder Exp $
$Id: cidict.py,v 1.14 2017/08/15 16:14:04 stroeder Exp $
"""

__version__ = """$Revision: 1.13 $"""
__version__ = """$Revision: 1.14 $"""

from UserDict import UserDict
from string import lower
Expand Down Expand Up @@ -103,23 +103,3 @@ def strlist_union(a,b):
for elt in b:
temp[elt] = elt
return temp.values()


if __debug__ and __name__ == '__main__':
x = { 'AbCDeF' : 123 }
cix = cidict(x)
assert cix["ABCDEF"] == 123
assert cix.get("ABCDEF",None) == 123
assert cix.get("not existent",None) is None
cix["xYZ"] = 987
assert cix["XyZ"] == 987
assert cix.get("XyZ",None) == 987
cix_keys = cix.keys()
cix_keys.sort()
assert cix_keys==['AbCDeF','xYZ'],ValueError(repr(cix_keys))
cix_items = cix.items()
cix_items.sort()
assert cix_items==[('AbCDeF',123),('xYZ',987)],ValueError(repr(cix_items))
del cix["abcdEF"]
assert not cix._keys.has_key("abcdef")
assert not cix.has_key("AbCDef")
5 changes: 3 additions & 2 deletions Tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"""
Automatic tests for python-ldap
See http://www.python-ldap.org/ for details.
See https://www.python-ldap.org/ for details.
$Id: __init__.py,v 1.5 2017/04/28 07:30:59 stroeder Exp $
$Id: __init__.py,v 1.6 2017/08/15 16:17:29 stroeder Exp $
"""

import t_cext
import t_cidict
import t_ldap_dn
import t_ldap_filter
import t_ldap_functions
Expand Down
4 changes: 2 additions & 2 deletions Tests/t_cidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"""
Automatic tests for python-ldap's module ldap.cidict
See http://www.python-ldap.org/ for details.
See https://www.python-ldap.org/ for details.
$Id: t_cidict.py,v 1.1 2017/08/15 15:18:35 stroeder Exp $
$Id: t_cidict.py,v 1.2 2017/08/15 16:14:04 stroeder Exp $
"""

# from Python's standard lib
Expand Down

0 comments on commit 09ec9c5

Please sign in to comment.