mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 01:14:21 +01:00
adding test on login
This commit is contained in:
parent
a335b7c109
commit
8387aa0cad
@ -15,6 +15,8 @@ from cherrypy.process import plugins, servers
|
||||
from cherrypy import Application
|
||||
import logging
|
||||
|
||||
cherrypy.session = {}
|
||||
|
||||
# monkey patching cherrypy to disable config interpolation
|
||||
def new_as_dict(self, raw=True, vars=None):
|
||||
"""Convert an INI file to a dictionary"""
|
||||
@ -76,8 +78,6 @@ class TestError(object):
|
||||
else:
|
||||
raise AssertionError("expected an exception")
|
||||
|
||||
|
||||
|
||||
def testLog(self):
|
||||
app = LdapCherry()
|
||||
cfg = { 'global' : {}}
|
||||
@ -113,6 +113,17 @@ class TestError(object):
|
||||
e = Exception()
|
||||
app._handle_exception(e)
|
||||
|
||||
def testLogin(self):
|
||||
app = LdapCherry()
|
||||
loadconf('./tests/cfg/ldapcherry.ini', app)
|
||||
try:
|
||||
app.login('jwatson', 'passwordwatson')
|
||||
except cherrypy.HTTPRedirect as e:
|
||||
expected = 'http://127.0.0.1:8080/'
|
||||
assert e[0][0] == expected
|
||||
else:
|
||||
raise AssertionError("expected an exception")
|
||||
|
||||
def testLogger(self):
|
||||
app = LdapCherry()
|
||||
loadconf('./tests/cfg/ldapcherry.ini', app)
|
||||
|
Loading…
Reference in New Issue
Block a user