mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-25 18:54:29 +01:00
implement unit test on auth test
This commit is contained in:
parent
95232ba432
commit
31afad5ee9
@ -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 = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user