docstr: Test writing schema files.
docstr_tok: ["Test","writing","schema","files","."]
code: def test_save_as_csv_with_schema_file(
      self, mock_gcs_hook, mock_trino_hook
  ):
      """Test writing schema files."""
  
      def _assert_upload(
          bucket, obj, tmp_filename, mime_type, gzip, metadata=None
      ):
          if obj == SCHEMA_FILENAME:
              with open(tmp_filename, "rb") as file:
                  assert SCHEMA_JSON == file.read()
  
      mock_gcs_hook.return_value.upload.side_effect = _assert_upload
  
      mock_cursor = (
          mock_trino_hook.return_value.get_conn.return_value.cursor
      )
  
      mock_cursor.return_value.description = [
          ("some_num", "INTEGER", None, None, None, None, None),
          ("some_str", "VARCHAR", None, None, None, None, None),
      ]
  
      mock_cursor.return_value.fetchone.side_effect = [
          [42, "mock_row_content_1"],
          [43, "mock_row_content_2"],
          [44, "mock_row_content_3"],
          None,
      ]
  
      op = TrinoToGCSOperator(
          task_id=TASK_ID,
          sql=SQL,
          bucket=BUCKET,
          filename=FILENAME,
          schema_filename=SCHEMA_FILENAME,
          export_format="csv",
      )
      op.execute(None)
  
      # once for the file and once for the schema
      assert 2 == mock_gcs_hook.return_value.upload.call_count
  
file_path: airflow/tests/integration/providers/google/cloud/transfers/test_trino_to_gcs.py
imports: from __future__ import annotations
  from unittest.mock import patch
  import pytest
  from airflow.providers.google.cloud.transfers.trino_to_gcs import TrinoToGCSOperator
label_desc: Use image node_id 7 for calling the TestTrinoToGCSOperator obj's underlying member method code with example usage: obj.test_save_as_csv_with_schema_file(mock_gcs_hook, mock_trino_hook) without return types