class_docstr: To run: "python -m saliency.core.gradients_test" from the top-level directory.
docstr: Tests that call_model_function receives all inputs.
docstr_tok: ["Tests","that","call_model_function","receives","all","inputs","."]
code: def testGradientCallModelArgs(self):
      """Tests that call_model_function receives all inputs."""
      expected_keys = [INPUT_OUTPUT_GRADIENTS]
      call_model_args = {"foo": "bar"}
      x_input = [3, 2, 1]
      mock_call_model = mock.MagicMock(
          return_value={INPUT_OUTPUT_GRADIENTS: [x_input]}
      )
      grad_instance = gradients.GradientSaliency()
  
      grad_instance.GetMask(
          x_value=x_input,
          call_model_function=mock_call_model,
          call_model_args=call_model_args,
      )
      calls = mock_call_model.mock_calls
  
      self.assertEqual(len(calls), 1)
      for call in calls:
          kwargs = call[2]
          self.assertEqual(
              kwargs["call_model_args"],
              call_model_args,
              msg="function was called with incorrect call_model_args.",
          )
          self.assertEqual(
              kwargs["expected_keys"],
              expected_keys,
              msg="function was called with incorrect expected_keys.",
          )
  
file_path: saliency/saliency/core/gradients_test.py
imports: import unittest
  import unittest.mock
  from .base import INPUT_OUTPUT_GRADIENTS
  from .base import SHAPE_ERROR_MESSAGE
  from .None import gradients
  import numpy
label_desc: Use image node_id 5 for calling the GradientSaliencyTest obj's underlying member method code with example usage: obj.testGradientCallModelArgs() without return types