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

slightly more robust unit tests

pre-cleanup to avoid contamination if other tests fail
This commit is contained in:
kakwa 2019-02-12 23:28:52 +01:00
parent dc60300a29
commit 30c28c5feb

View File

@ -119,10 +119,15 @@ class TestError(object):
@travis_disabled @travis_disabled
def testSearchUser(self): def testSearchUser(self):
inv = Backend(cfg, cherrypy.log, u'test☭', attr, 'sAMAccountName') inv = Backend(cfg, cherrypy.log, u'test☭', attr, 'sAMAccountName')
try:
inv.del_user(u'☭default_user')
except: pass
try:
inv.del_user(u'☭default_user2')
except: pass
try: try:
inv.add_user(default_user.copy()) inv.add_user(default_user.copy())
except: except: pass
pass
inv.add_user(default_user2.copy()) inv.add_user(default_user2.copy())
ret = inv.search(u'test☭') ret = inv.search(u'test☭')
expected = [u'☭default_user', u'☭default_user2'] expected = [u'☭default_user', u'☭default_user2']