"""tests for server config"""fromos.pathimportjoin,dirnamefromlogilab.common.testlibimportTestCase,unittest_mainfromcubicweb.devtoolsimportTestServerConfigurationclassConfigTC(TestCase):deftest_load_hooks_twice(self):classvreg:@staticmethoddefregistry_objects(registry):return[]cfg1=TestServerConfiguration('data/config1')cfg1.bootstrap_cubes()cfg2=TestServerConfiguration('data/config2')cfg2.bootstrap_cubes()self.failIf(cfg1.load_hooks(vreg)iscfg2.load_hooks(vreg))self.failUnless('after_add_relation'incfg1.load_hooks(vreg))self.failUnless('after_delete_relation'incfg2.load_hooks(vreg))if__name__=='__main__':unittest_main()