author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Mon, 25 May 2009 16:11:30 +0200 | |
branch | stable |
changeset 1924 | dc903af1a34e |
parent 1802 | d628defebc17 |
child 1977 | 606923dff11b |
permissions | -rw-r--r-- |
0 | 1 |
"""tests for server config""" |
2 |
||
3 |
from os.path import join, dirname |
|
4 |
||
5 |
from logilab.common.testlib import TestCase, unittest_main |
|
6 |
||
7 |
from cubicweb.devtools import TestServerConfiguration |
|
8 |
||
9 |
class ConfigTC(TestCase): |
|
10 |
||
11 |
def test_load_hooks_twice(self): |
|
12 |
class vreg: |
|
13 |
@staticmethod |
|
14 |
def registry_objects(registry): |
|
15 |
return [] |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
16 |
|
0 | 17 |
cfg1 = TestServerConfiguration('data/config1') |
18 |
cfg1.bootstrap_cubes() |
|
19 |
cfg2 = TestServerConfiguration('data/config2') |
|
20 |
cfg2.bootstrap_cubes() |
|
21 |
self.failIf(cfg1.load_hooks(vreg) is cfg2.load_hooks(vreg)) |
|
22 |
self.failUnless('after_add_relation' in cfg1.load_hooks(vreg)) |
|
23 |
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
|
24 |
|
0 | 25 |
|
26 |
if __name__ == '__main__': |
|
27 |
unittest_main() |