code: def test_send_snippet_with_invalid_token(self, patch):
      def _conversations_list(params={}):
          return _slack_response(
              token="valid",
              data={
                  "ok": True,
                  "channels": [{"name": "valid", "id": "valid_id"}],
                  "response_metadata": {"next_cursor": ""},
              },
          )
  
      def _api_call(method, data={}):
          assert method == "files.upload"
          return {"ok": False, "error": "error_reason"}
  
      mock_client = MagicMock()
      mock_client.conversations_list = MagicMock(
          side_effect=_conversations_list
      )
      mock_client.api_call = MagicMock(side_effect=_api_call)
      patch.return_value = mock_client
  
      with LogCapture() as log:
          api = gokart.slack.SlackAPI(
              token="valid", channel="valid", to_user="test user"
          )
          api.send_snippet(
              comment="test", title="title", content="content"
          )
          log.check(
              (
                  "gokart.slack.slack_api",
                  "WARNING",
                  'Failed to send slack notification: Error while uploading file. The error reason is "error_reason".',
              )
          )
  
file_path: gokart/test/slack/test_slack_api.py
imports: import unittest
  from logging import getLogger
  from unittest import mock
  from unittest.mock import MagicMock
  from slack_sdk import WebClient
  from slack_sdk.web.slack_response import SlackResponse
  from testfixtures import LogCapture
  import gokart.slack
label_desc: Use image node_id 3 for calling the TestSlackAPI obj's underlying member method code with example usage: obj.test_send_snippet_with_invalid_token(patch) and returns: _slack_response, dict