From 09ec9c53c13fe9a67e6d070f91af101f0d10ed4d Mon Sep 17 00:00:00 2001 From: stroeder Date: Tue, 15 Aug 2017 16:14:04 +0000 Subject: [PATCH] removed pseudo test script from module ldap.cidict and added sub-module for testing class ldap.cidict.cidict --- CHANGES | 6 +++++- Lib/ldap/cidict.py | 26 +++----------------------- Tests/__init__.py | 5 +++-- Tests/t_cidict.py | 4 ++-- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/CHANGES b/CHANGES index 28aa7a9..c1a397b 100644 --- a/CHANGES +++ b/CHANGES @@ -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 @@ -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 $ diff --git a/Lib/ldap/cidict.py b/Lib/ldap/cidict.py index b0a0a85..e6db46d 100644 --- a/Lib/ldap/cidict.py +++ b/Lib/ldap/cidict.py @@ -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 @@ -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") diff --git a/Tests/__init__.py b/Tests/__init__.py index cd0b8d8..3c212f0 100644 --- a/Tests/__init__.py +++ b/Tests/__init__.py @@ -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 diff --git a/Tests/t_cidict.py b/Tests/t_cidict.py index 8c34bc1..8915ceb 100644 --- a/Tests/t_cidict.py +++ b/Tests/t_cidict.py @@ -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