code: def test_validate_parameters_catalog_and_credentials(
      mocker: MockFixture,
  ) -> None:
      from superset.db_engine_specs.gsheets import (
          GSheetsEngineSpec,
          GSheetsPropertiesType,
      )
  
      g = mocker.patch("superset.db_engine_specs.gsheets.g")
      g.user.email = "admin@example.com"
  
      create_engine = mocker.patch(
          "superset.db_engine_specs.gsheets.create_engine"
      )
      conn = create_engine.return_value.connect.return_value
      results = conn.execute.return_value
      results.fetchall.side_effect = [
          [(2,)],
          [(1,)],
          ProgrammingError(
              "Unsupported table: https://www.google.com/"
          ),
      ]
  
      properties: GSheetsPropertiesType = {
          "parameters": {
              "service_account_info": "",
              "catalog": None,
          },
          "catalog": {
              "private_sheet": "https://docs.google.com/spreadsheets/d/1/edit",
              "public_sheet": "https://docs.google.com/spreadsheets/d/1/edit#gid=1",
              "not_a_sheet": "https://www.google.com/",
          },
      }
      errors = GSheetsEngineSpec.validate_parameters(
          properties
      )  # ignore: type
      assert errors == [
          SupersetError(
              message=(
                  "The URL could not be identified. Please check for typos "
                  "and make sure that ‘Type of Google Sheets allowed’ "
                  "selection matches the input."
              ),
              error_type=SupersetErrorType.TABLE_DOES_NOT_EXIST_ERROR,
              level=ErrorLevel.WARNING,
              extra={
                  "catalog": {
                      "idx": 2,
                      "url": True,
                  },
                  "issue_codes": [
                      {
                          "code": 1003,
                          "message": "Issue 1003 - There is a syntax error in the SQL query. Perhaps there was a misspelling or a typo.",
                      },
                      {
                          "code": 1005,
                          "message": "Issue 1005 - The table was deleted or renamed in the database.",
                      },
                  ],
              },
          )
      ]
  
      create_engine.assert_called_with(
          "gsheets://",
          service_account_info={},
          subject="admin@example.com",
      )
  
file_path: superset/tests/unit_tests/db_engine_specs/test_gsheets.py
imports: import json
  import pandas
  import pytest
  from pytest_mock import MockFixture
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.exceptions import SupersetException
  from superset.sql_parse import Table
label_desc: Use image node_id 4 for calling a global function with example usage: test_validate_parameters_catalog_and_credentials(mocker) without return types