server/test/unittest_config.py
branchtls-sprint
changeset 1802 d628defebc17
parent 0 b97547f5f1fa
child 1977 606923dff11b
equal deleted inserted replaced
1801:672acc730ce5 1802:d628defebc17
    11     def test_load_hooks_twice(self):
    11     def test_load_hooks_twice(self):
    12         class vreg:
    12         class vreg:
    13             @staticmethod
    13             @staticmethod
    14             def registry_objects(registry):
    14             def registry_objects(registry):
    15                 return []
    15                 return []
    16             
    16 
    17         cfg1 = TestServerConfiguration('data/config1')
    17         cfg1 = TestServerConfiguration('data/config1')
    18         cfg1.bootstrap_cubes()
    18         cfg1.bootstrap_cubes()
    19         cfg2 = TestServerConfiguration('data/config2')
    19         cfg2 = TestServerConfiguration('data/config2')
    20         cfg2.bootstrap_cubes()
    20         cfg2.bootstrap_cubes()
    21         self.failIf(cfg1.load_hooks(vreg) is cfg2.load_hooks(vreg))
    21         self.failIf(cfg1.load_hooks(vreg) is cfg2.load_hooks(vreg))
    22         self.failUnless('after_add_relation' in cfg1.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))
    23         self.failUnless('after_delete_relation' in cfg2.load_hooks(vreg))
    24         
    24 
    25 
    25 
    26 if __name__ == '__main__':
    26 if __name__ == '__main__':
    27     unittest_main()
    27     unittest_main()