mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 09:24:21 +01:00
adding unit test for ppolicy
This commit is contained in:
parent
cd13bf5d22
commit
4a55d040f9
@ -99,6 +99,16 @@ auth.mode = 'or'
|
|||||||
# custom auth module to load
|
# custom auth module to load
|
||||||
#auth.module = 'ldapcherry.auth.modNone'
|
#auth.module = 'ldapcherry.auth.modNone'
|
||||||
|
|
||||||
|
[ppolicy]
|
||||||
|
|
||||||
|
# password policy module
|
||||||
|
ppolicy.module = 'ldapcherry.ppolicy.simple'
|
||||||
|
|
||||||
|
# parameters of the module
|
||||||
|
min_length = 8
|
||||||
|
min_upper = 1
|
||||||
|
min_digit = 1
|
||||||
|
|
||||||
# resources parameters
|
# resources parameters
|
||||||
[resources]
|
[resources]
|
||||||
# templates directory
|
# templates directory
|
||||||
|
@ -87,6 +87,13 @@ class TestError(object):
|
|||||||
app._set_access_log(cfg, logging.DEBUG)
|
app._set_access_log(cfg, logging.DEBUG)
|
||||||
app._set_error_log(cfg, logging.DEBUG)
|
app._set_error_log(cfg, logging.DEBUG)
|
||||||
|
|
||||||
|
def testPPolicy(self):
|
||||||
|
app = LdapCherry()
|
||||||
|
loadconf('./tests/cfg/ldapcherry.ini', app)
|
||||||
|
wrong = app._checkppolicy('password')['match']
|
||||||
|
good = app._checkppolicy('Passw0rd.')['match']
|
||||||
|
assert wrong == False and good == True
|
||||||
|
|
||||||
def testMissingBackend(self):
|
def testMissingBackend(self):
|
||||||
app = LdapCherry()
|
app = LdapCherry()
|
||||||
loadconf('./tests/cfg/ldapcherry.ini', app)
|
loadconf('./tests/cfg/ldapcherry.ini', app)
|
||||||
|
Loading…
Reference in New Issue
Block a user