author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> |
Fri, 31 Jul 2009 22:37:28 +0200 | |
changeset 2613 | 5e19c2bb370e |
parent 1977 | 606923dff11b |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
1 |
"""tests for server config |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
""" |
0 | 8 |
|
9 |
from os.path import join, dirname |
|
10 |
||
11 |
from logilab.common.testlib import TestCase, unittest_main |
|
12 |
||
13 |
from cubicweb.devtools import TestServerConfiguration |
|
14 |
||
15 |
class ConfigTC(TestCase): |
|
16 |
||
17 |
def test_load_hooks_twice(self): |
|
18 |
class vreg: |
|
19 |
@staticmethod |
|
20 |
def registry_objects(registry): |
|
21 |
return [] |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
22 |
|
0 | 23 |
cfg1 = TestServerConfiguration('data/config1') |
24 |
cfg1.bootstrap_cubes() |
|
25 |
cfg2 = TestServerConfiguration('data/config2') |
|
26 |
cfg2.bootstrap_cubes() |
|
27 |
self.failIf(cfg1.load_hooks(vreg) is cfg2.load_hooks(vreg)) |
|
28 |
self.failUnless('after_add_relation' in cfg1.load_hooks(vreg)) |
|
29 |
self.failUnless('after_delete_relation' in cfg2.load_hooks(vreg)) |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
30 |
|
0 | 31 |
|
32 |
if __name__ == '__main__': |
|
33 |
unittest_main() |