Skip to content

Commit

Permalink
Fix tests with latest python-ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed May 11, 2018
1 parent 3f6a4c4 commit e7da2ed
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Calling ``bind`` creates and returns the LDAP connection:
.. code-block:: pycon
>>> connector.bind()
<ldap.ldapobject.simple.SimpleLDAPObject instance at ...>
<ldap.ldapobject.SimpleLDAPObject instance at ...>
Calling ``unbind`` destroys the connection:

Expand Down
4 changes: 2 additions & 2 deletions src/node/ext/ldap/_node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ Changing the rdn attribute on loaded nodes fails.::
>>> person()
Traceback (most recent call last):
...
NAMING_VIOLATION: {'info': "value of naming attribute 'cn'
is not present in entry", 'desc': 'Naming violation'}
NAMING_VIOLATION: {'info': u"value of naming attribute 'cn'
is not present in entry", 'desc': u'Naming violation'}

>>> person.attrs.load()
>>> person.attrs['cn']
Expand Down
8 changes: 4 additions & 4 deletions src/node/ext/ldap/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Test main script, could be used by command line with

>>> sys.argv[-1] = '12346'
>>> main()
{'info': 'Transport endpoint is not connected',
{u'info': 'Transport endpoint is not connected',
'errno': 107,
'desc': "Can't contact LDAP server"}
'desc': u"Can't contact LDAP server"}

>>> sys.argv = []
>>> main()
Expand All @@ -57,9 +57,9 @@ Test node.ext.ldap base objects. Test LDAP connectivity::
'success'

>>> testLDAPConnectivity('127.0.0.1', 12346)
SERVER_DOWN({'info': 'Transport endpoint is not connected',
SERVER_DOWN({u'info': 'Transport endpoint is not connected',
'errno': 107,
'desc': "Can't contact LDAP server"},)
'desc': u"Can't contact LDAP server"},)

Create connector.::

Expand Down
2 changes: 1 addition & 1 deletion src/node/ext/ldap/schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CN Attribute::
>>> attrcn.ordering

>>> attrcn.schema_attribute
'attributeTypes'
u'attributeTypes'

>>> attrcn.single_value
False
Expand Down
4 changes: 2 additions & 2 deletions src/node/ext/ldap/session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ Create the session with invalid ``LDAPProps``::
>>> props = LDAPProps()
>>> session = LDAPSession(props)
>>> session.checkServerProperties()
(False, SERVER_DOWN({'info': 'Transport endpoint is not connected',
'errno': 107, 'desc': "Can't contact LDAP server"},))
(False, SERVER_DOWN({u'info': 'Transport endpoint is not connected',
'errno': 107, 'desc': u"Can't contact LDAP server"},))
10 changes: 5 additions & 5 deletions src/node/ext/ldap/ugm/principals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Query all user nodes::
[<cn=user1,dc=my-domain,dc=com:cn=user1 - False>,
<cn=user2,ou=customers,dc=my-domain,dc=com:cn=user2 - False>,
<cn=user3,ou=customers,dc=my-domain,dc=com:cn=user3 - False>,
<cn=n?sty\2C User,ou=customers,dc=my-domain,dc=com:cn=n?sty\2C User - False>]
<cn=n?sty\, User,ou=customers,dc=my-domain,dc=com:cn=n?sty\, User - False>]

Authenticate a user, via the user object. (also see 'via LDAPUsers' below,
after passwd, this is to make sure, that LDAPUsers.authenticate does not work
Expand Down Expand Up @@ -395,7 +395,7 @@ Invalidate principals::

>>> user_container = users[u'Schmidt'].context.parent.storage
>>> len(user_container.keys())
10
9

>>> users.invalidate(u'Schmidt')
>>> sorted(users.storage.items())
Expand All @@ -404,7 +404,7 @@ Invalidate principals::
(u'Umhauer', <User object 'Umhauer' at ...>)]

>>> len(user_container.keys())
9
8

>>> len(users.context.keys())
6
Expand Down Expand Up @@ -568,14 +568,14 @@ Add and remove user from group::
[u'Schmidt', u'M\xfcller']

>>> group.translate_key('Umhauer')
u'cn=n\xe4sty\\2C User,ou=customers,dc=my-domain,dc=com'
u'cn=n\xe4sty\\, User,ou=customers,dc=my-domain,dc=com'

>>> group.add('Umhauer')
>>> group.attrs.items()
[('member',
[u'cn=user3,ou=customers,dc=my-domain,dc=com',
u'cn=user2,ou=customers,dc=my-domain,dc=com',
u'cn=n\xe4sty\\2C User,ou=customers,dc=my-domain,dc=com']),
u'cn=n\xe4sty\\, User,ou=customers,dc=my-domain,dc=com']),
('rdn', u'group1')]

>>> group.member_ids
Expand Down

0 comments on commit e7da2ed

Please sign in to comment.