16 # |
16 # |
17 # You should have received a copy of the GNU Lesser General Public License along |
17 # You should have received a copy of the GNU Lesser General Public License along |
18 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
19 """unit/functional tests for cubicweb.server.hook""" |
19 """unit/functional tests for cubicweb.server.hook""" |
20 |
20 |
21 from __future__ import with_statement |
|
22 |
|
23 from logilab.common.testlib import TestCase, unittest_main, mock_object |
21 from logilab.common.testlib import TestCase, unittest_main, mock_object |
24 |
|
25 |
22 |
26 from cubicweb.devtools import TestServerConfiguration, fake |
23 from cubicweb.devtools import TestServerConfiguration, fake |
27 from cubicweb.devtools.testlib import CubicWebTC |
24 from cubicweb.devtools.testlib import CubicWebTC |
28 from cubicweb.server import hook |
25 from cubicweb.server import hook |
29 from cubicweb.hooks import integrity, syncschema |
26 from cubicweb.hooks import integrity, syncschema |
30 |
|
31 |
27 |
32 def clean_session_ops(func): |
28 def clean_session_ops(func): |
33 def wrapper(self, *args, **kwargs): |
29 def wrapper(self, *args, **kwargs): |
34 try: |
30 try: |
35 return func(self, *args, **kwargs) |
31 return func(self, *args, **kwargs) |