code: def test_spark_session_factory(mock_spark_context):
      env_helper = Mock()
      env_helper.get_instance_count.return_value = 1
      spark_session_factory = SparkSessionFactory(env_helper)
  
      spark_session_factory.spark_session
  
      _, _, kw_args = mock_spark_context.mock_calls[0]
      spark_conf = kw_args["conf"]
  
      mock_spark_context.assert_called_once()
      assert spark_conf.get("spark.master") == "local[*]"
      for cfg in spark_session_factory._get_spark_configs(True):
          assert spark_conf.get(cfg[0]) == cfg[1]
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/feature_store/feature_processor/test_spark_session_factory.py
imports: from __future__ import absolute_import
  import feature_store_pyspark
  import pytest
  from mock import Mock, patch, call
  from sagemaker.feature_store.feature_processor._spark_factory import FeatureStoreManagerFactory, SparkSessionFactory
label_desc: Use image node_id 4 for calling a global function with example usage: test_spark_session_factory(mock_spark_context) without return types