1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-06-27 06:02:55 +02:00

implement unit test on auth test

This commit is contained in:
kakwa 2015-05-22 01:33:15 +02:00
parent 95232ba432
commit 31afad5ee9

View File

@ -75,11 +75,13 @@ class TestError(object):
def testAuthSuccess(self): def testAuthSuccess(self):
inv = Backend(cfg, cherrypy.log, 'ldap') inv = Backend(cfg, cherrypy.log, 'ldap')
return True ret = inv.auth('jwatson', 'passwordwatson')
assert ret == True
def testAuthFailure(self): def testAuthFailure(self):
inv = Backend(cfg, cherrypy.log, 'ldap') inv = Backend(cfg, cherrypy.log, 'ldap')
return True res = inv.auth('notauser', 'password') or inv.auth('jwatson', 'notapassword')
assert res == False
def testMissingParam(self): def testMissingParam(self):
cfg2 = {} cfg2 = {}