code: def test_spark_connect_auth(self, spark_mock, conf_mock, dag_maker):
      config = FakeConfig()
      conf_mock.return_value = config
  
      @task.pyspark(conn_id="spark-connect-auth")
      def f(spark, sc):
          assert spark is not None
          assert sc is None
  
          return True
  
      with dag_maker():
          ret = f()
  
      dr = dag_maker.create_dagrun()
      ret.operator.run(
          start_date=dr.execution_date, end_date=dr.execution_date
      )
      ti = dr.get_task_instances()[0]
      assert ti.xcom_pull()
      assert (
          config.get("spark.remote")
          == "sc://localhost/;user_id=connect;token=1234;use_ssl=True"
      )
      assert config.get("spark.master") is None
      assert config.get("spark.app.name")
  
file_path: airflow/tests/providers/apache/spark/decorators/test_pyspark.py
imports: from __future__ import annotations
  from typing import Any
  from unittest import mock
  import pytest
  from airflow.decorators import task
  from airflow.models import Connection
  from airflow.utils import db, timezone
label_desc: Use image node_id 5 for calling the TestPysparkDecorator obj's underlying member method code with example usage: obj.test_spark_connect_auth(spark_mock, conf_mock, dag_maker) and returns: True