diff -r 72c3af2cde23 -r 92da3e6cb104 cubicweb/server/test/data/hooks.py --- a/cubicweb/server/test/data/hooks.py Fri Mar 10 14:02:31 2017 +0100 +++ b/cubicweb/server/test/data/hooks.py Fri Mar 10 14:07:15 2017 +0100 @@ -15,22 +15,24 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -""" -""" from cubicweb.server.hook import Hook CALLED_EVENTS = {} + class StartupHook(Hook): __regid__ = 'mystartup' events = ('server_startup',) + def __call__(self): CALLED_EVENTS['server_startup'] = True + class ShutdownHook(Hook): __regid__ = 'myshutdown' events = ('server_shutdown',) + def __call__(self): CALLED_EVENTS['server_shutdown'] = True @@ -38,5 +40,6 @@ class LoginHook(Hook): __regid__ = 'mylogin' events = ('session_open',) + def __call__(self): CALLED_EVENTS['session_open'] = self._cw.user.login