cubicweb/server/test/unittest_hook.py
changeset 12036 4c2c731f9190
parent 12035 2fcb9339f69a
child 12513 6f42f1460f99
equal deleted inserted replaced
12035:2fcb9339f69a 12036:4c2c731f9190
   132         self.assertEqual(hooks.CALLED_EVENTS['server_startup'], True)
   132         self.assertEqual(hooks.CALLED_EVENTS['server_startup'], True)
   133         # don't actually call repository.shutdown !
   133         # don't actually call repository.shutdown !
   134         self.repo.hm.call_hooks('server_shutdown', repo=self.repo)
   134         self.repo.hm.call_hooks('server_shutdown', repo=self.repo)
   135         self.assertEqual(hooks.CALLED_EVENTS['server_shutdown'], True)
   135         self.assertEqual(hooks.CALLED_EVENTS['server_shutdown'], True)
   136 
   136 
   137     def test_session_open_close(self):
       
   138         import hooks # cubicweb/server/test/data/hooks.py
       
   139         anonaccess = self.new_access('anon')
       
   140         with anonaccess.repo_cnx() as cnx:
       
   141             self.assertEqual(hooks.CALLED_EVENTS['session_open'], 'anon')
       
   142 
       
   143 
   137 
   144 if __name__ == '__main__':
   138 if __name__ == '__main__':
   145     unittest.main()
   139     unittest.main()