1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 01:14:21 +01:00

more unicode testing

This commit is contained in:
kakwa 2016-07-28 19:53:32 +02:00
parent 9367bc3288
commit ff950dd88b

View File

@ -178,9 +178,9 @@ class TestError(object):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid') inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
user = { user = {
'uid': u'test☭', 'uid': u'test☭',
'sn': 'test', 'sn': u'test',
'cn': 'test', 'cn': u'test',
'userPassword': 'test', 'userPassword': u'test',
'uidNumber': '42', 'uidNumber': '42',
'gidNumber': '42', 'gidNumber': '42',
'homeDirectory': '/home/test/' 'homeDirectory': '/home/test/'
@ -192,9 +192,9 @@ class TestError(object):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid') inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
user = { user = {
'uid': u'test☭', 'uid': u'test☭',
'sn': 'test', 'sn': u'test',
'cn': 'test', 'cn': u'test',
'userPassword': 'test', 'userPassword': u'test',
'uidNumber': '42', 'uidNumber': '42',
'gidNumber': '42', 'gidNumber': '42',
'homeDirectory': '/home/test/' 'homeDirectory': '/home/test/'
@ -206,11 +206,11 @@ class TestError(object):
def testAddUserDuplicate(self): def testAddUserDuplicate(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid') inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
user = { user = {
'uid': 'test', 'uid': u'test',
'sn': 'test', 'sn': u'test',
'cn': 'test', 'cn': u'test',
'uidNumber': '42', 'uidNumber': '42',
'userPassword': 'test', 'userPassword': u'test',
'gidNumber': '42', 'gidNumber': '42',
'homeDirectory': '/home/test/' 'homeDirectory': '/home/test/'
} }
@ -218,17 +218,17 @@ class TestError(object):
inv.add_user(user) inv.add_user(user)
inv.add_user(user) inv.add_user(user)
except UserAlreadyExists: except UserAlreadyExists:
inv.del_user('test') inv.del_user(u'test')
return return
else: else:
inv.del_user('test') inv.del_user(u'test')
raise AssertionError("expected an exception") raise AssertionError("expected an exception")
def testDelUserDontExists(self): def testDelUserDontExists(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid') inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
try: try:
inv.del_user('test') inv.del_user(u'test')
inv.del_user('test') inv.del_user(u'test')
except UserDoesntExist: except UserDoesntExist:
return return
else: else:
@ -243,10 +243,10 @@ class TestError(object):
def testAddUserMissingMustattribute(self): def testAddUserMissingMustattribute(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid') inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
user = { user = {
'uid': 'test', 'uid': u'test',
'sn': 'test', 'sn': u'test',
'cn': 'test', 'cn': u'test',
'userPassword': 'test', 'userPassword': u'test',
'gidNumber': '42', 'gidNumber': '42',
'homeDirectory': '/home/test/' 'homeDirectory': '/home/test/'
} }
@ -255,5 +255,5 @@ class TestError(object):
except ldap.OBJECT_CLASS_VIOLATION: except ldap.OBJECT_CLASS_VIOLATION:
return return
else: else:
inv.del_user('test') inv.del_user(u'test')
raise AssertionError("expected an exception") raise AssertionError("expected an exception")