# HG changeset patch # User Sylvain Thénault # Date 1249062198 -7200 # Node ID 45d5f2d735614b95b44e9e3cb295fa7148ea7e50 # Parent 92f2bc945261a2104f2f8312f9f089e0694dd359 [D server test] remove deprecated test on application_hooks file, and associated data diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config1/application_hooks.py --- a/server/test/data/config1/application_hooks.py Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -"""hooks for config1 - - Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE). - http://www.logilab.fr/ -- mailto:contact@logilab.fr -:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses -""" - -HOOKS = {"after_add_relation" : {"concerned_by" : [lambda: None]}} diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config1/bootstrap_packages --- a/server/test/data/config1/bootstrap_packages Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -# file generated by cubicweb-ctl diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config1/server-ctl.conf --- a/server/test/data/config1/server-ctl.conf Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# file generated by cubicweb-ctl - -APPLICATION HOME=/home/adim/etc/cubicweb.d/crmadim -DEBUG= -HOST= -LOG TRESHOLD=LOG_DEBUG -NS GROUP=cubicweb -NS HOST= -PID FILE=/home/adim/tmp/crmadim.pid -PORT= -QUERY LOG FILE= -UID=1006 -PROFILE= diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config1/sources --- a/server/test/data/config1/sources Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -# file generated by cubicweb-ctl - -[system] -ADAPTER=native -DBHOST=crater -DBDRIVER=postgres -DBNAME=whatever -ENCODING=UTF-8 -SPLIT_RELATIONS = True - diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config2/application_hooks.py --- a/server/test/data/config2/application_hooks.py Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -"""hooks for config2 - - Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE). - http://www.logilab.fr/ -- mailto:contact@logilab.fr -:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses -""" - -HOOKS = {"after_delete_relation" : {"todo_by" : [lambda: 1]}} diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config2/bootstrap_packages --- a/server/test/data/config2/bootstrap_packages Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -# file generated by cubicweb-ctl diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config2/server-ctl.conf --- a/server/test/data/config2/server-ctl.conf Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# file generated by cubicweb-ctl - -APPLICATION HOME=/home/adim/etc/cubicweb.d/crmadim -DEBUG= -HOST= -LOG TRESHOLD=LOG_DEBUG -NS GROUP=cubicweb -NS HOST= -PID FILE=/home/adim/tmp/crmadim.pid -PORT= -QUERY LOG FILE= -UID=1006 -PROFILE= diff -r 92f2bc945261 -r 45d5f2d73561 server/test/data/config2/sources --- a/server/test/data/config2/sources Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -# file generated by cubicweb-ctl - -[system] -ADAPTER=native -DBHOST=crater -DBDRIVER=postgres -DBNAME=whatever -ENCODING=UTF-8 -SPLIT_RELATIONS = True - diff -r 92f2bc945261 -r 45d5f2d73561 server/test/unittest_config.py --- a/server/test/unittest_config.py Fri Jul 31 14:25:30 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -"""tests for server config - -:organization: Logilab -:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. -:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr -:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses -""" - -from os.path import join, dirname - -from logilab.common.testlib import TestCase, unittest_main - -from cubicweb.devtools import TestServerConfiguration - -class ConfigTC(TestCase): - - def test_load_hooks_twice(self): - class vreg: - @staticmethod - def registry_objects(registry): - return [] - - cfg1 = TestServerConfiguration('data/config1') - cfg1.bootstrap_cubes() - cfg2 = TestServerConfiguration('data/config2') - cfg2.bootstrap_cubes() - self.failIf(cfg1.load_hooks(vreg) is cfg2.load_hooks(vreg)) - self.failUnless('after_add_relation' in cfg1.load_hooks(vreg)) - self.failUnless('after_delete_relation' in cfg2.load_hooks(vreg)) - - -if __name__ == '__main__': - unittest_main()