[Python-modules-commits] [mockldap] 01/07: Import mockldap_0.2.8.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Sun Mar 19 07:10:49 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch experimental
in repository mockldap.
commit 2aca990d7187d5be78a88e82c4277706919cc2c1
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Sun Mar 19 07:57:58 2017 +0100
Import mockldap_0.2.8.orig.tar.gz
---
CHANGES | 9 ++++++++-
PKG-INFO | 2 +-
docs/source/conf.py | 2 +-
setup.cfg | 1 -
setup.py | 2 +-
src/mockldap.egg-info/PKG-INFO | 2 +-
src/mockldap/ldapobject.py | 10 +++++-----
src/mockldap/tests.py | 6 ++++++
8 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/CHANGES b/CHANGES
index 877e587..8e150c0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,14 @@
+v0.2.8 - May 31, 2016 - Fix rename_s
+------------------------------------
+
+- Don't delete attribute when moving an entry to new subtree with unchanged rdn.
+ Thanks to Pär Wieslander.
+
+
v0.2.7 - April 18, 2016 - attrlist
----------------------------------
-- Support '*' in attrlist.
+- Support ``'*'`` in attrlist.
v0.2.6 - September 29, 2015 - pyldap
diff --git a/PKG-INFO b/PKG-INFO
index 94be487..55ee385 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mockldap
-Version: 0.2.7
+Version: 0.2.8
Summary: A simple mock implementation of python-ldap.
Home-page: http://bitbucket.org/psagers/mockldap/
Author: Peter Sagerson
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 1e49183..094559d 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -61,7 +61,7 @@ copyright = u'2013, Peter Sagerson'
# The short X.Y version.
version = '0.2'
# The full version, including alpha/beta/rc tags.
-release = '0.2.7'
+release = '0.2.8'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..8bfd5a1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index 7d827f6..167fae3 100755
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ else:
setup(
name='mockldap',
- version='0.2.7',
+ version='0.2.8',
description=u"A simple mock implementation of python-ldap.",
long_description=open('README').read(),
url='http://bitbucket.org/psagers/mockldap/',
diff --git a/src/mockldap.egg-info/PKG-INFO b/src/mockldap.egg-info/PKG-INFO
index 94be487..55ee385 100644
--- a/src/mockldap.egg-info/PKG-INFO
+++ b/src/mockldap.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mockldap
-Version: 0.2.7
+Version: 0.2.8
Summary: A simple mock implementation of python-ldap.
Home-page: http://bitbucket.org/psagers/mockldap/
Author: Peter Sagerson
diff --git a/src/mockldap/ldapobject.py b/src/mockldap/ldapobject.py
index 4c3eb3c..14c6613 100644
--- a/src/mockldap/ldapobject.py
+++ b/src/mockldap/ldapobject.py
@@ -360,17 +360,17 @@ class LDAPObject(RecordableMethods):
oldattr, oldvalue = dn.split(',')[0].split('=')
newattr, newvalue = newrdn.split('=')
+ if oldattr == newattr or len(entry[oldattr]) > 1:
+ entry[oldattr].remove(oldvalue)
+ else:
+ del entry[oldattr]
+
try:
if newvalue not in entry[newattr]:
entry[newattr].append(newvalue)
except KeyError:
entry[newattr] = [newvalue]
- if oldattr == newattr or len(entry[oldattr]) > 1:
- entry[oldattr].remove(oldvalue)
- else:
- del entry[oldattr]
-
self.directory[newfulldn] = entry
del self.directory[dn]
diff --git a/src/mockldap/tests.py b/src/mockldap/tests.py
index 53c09d7..df2cc05 100644
--- a/src/mockldap/tests.py
+++ b/src/mockldap/tests.py
@@ -537,6 +537,12 @@ class TestLDAPObject(unittest.TestCase):
self.assertIn('uid=alice1,ou=new,o=test', self.ldapobj.directory)
+ def test_rename_s_newsuperior_same_rdn_keeps_unchanged_attr(self):
+ self.ldapobj.rename_s(alice[0], 'cn=alice', other[0])
+
+ self.assertEqual(self.ldapobj.directory['cn=alice,ou=other,o=test']['cn'],
+ ['alice'])
+
def test_rename_s_no_such_object(self):
self.assertRaises(ldap.NO_SUCH_OBJECT, self.ldapobj.rename_s,
'uid=invalid,ou=example,o=test', 'uid=invalid2')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/mockldap.git
More information about the Python-modules-commits
mailing list