code: def check_hook_methods_called(self, func):
      def check_method_called(name):
          with mock.patch.object(self.h, name) as patched:
              with self.h:
                  func()
              patched.assert_called()
  
      check_method_called("forward_preprocess")
      check_method_called("forward_postprocess")
      check_method_called("backward_preprocess")
      check_method_called("backward_postprocess")
  
file_path: chainer/tests/chainer_tests/test_function_hook.py
imports: import unittest
  import mock
  import numpy
  import chainer
  from chainer import testing
label_desc: Use image node_id 7 for calling the TestFunctionHook obj's underlying member method code with example usage: obj.check_hook_methods_called(func) without return types