code: def test_py_spark_processor_run(
      mock_generate_current_job_name,
      mock_stage_submit_deps,
      mock_super_run,
      py_spark_processor,
      config,
      expected,
  ):
      mock_stage_submit_deps.return_value = (processing_input, "opt")
      mock_generate_current_job_name.return_value = "jobName"
  
      if expected is ValueError:
          with pytest.raises(expected):
              py_spark_processor.run(
                  submit_app=config["submit_app"],
                  submit_py_files=config["files"],
                  submit_jars=config["files"],
                  submit_files=config["files"],
                  inputs=config["inputs"],
              )
      else:
          py_spark_processor.run(
              submit_app=config["submit_app"],
              submit_py_files=config["files"],
              submit_jars=config["files"],
              submit_files=config["files"],
              inputs=config["inputs"],
          )
  
          mock_super_run.assert_called_with(
              submit_app=config["submit_app"],
              inputs=expected,
              outputs=None,
              arguments=None,
              wait=True,
              logs=True,
              job_name="jobName",
              experiment_config=None,
              kms_key=None,
          )
  
imports: from __future__ import absolute_import
  import pathlib
  import subprocess
  import tempfile
  from io import BytesIO
  from typing import Generator
  from unittest.case import TestCase
  from unittest.mock import MagicMock, Mock, call, mock_open, patch
  import pytest
  from sagemaker.processing import ProcessingInput, ProcessingOutput
  from sagemaker.session_settings import SessionSettings
  from sagemaker.spark.processing import PySparkProcessor, SparkJarProcessor, _SparkProcessorBase, _HistoryServer, FileType, SparkConfigUtils
label_desc: Use image node_id 28 for calling a global function with example usage: test_py_spark_processor_run(mock_generate_current_job_name, mock_stage_submit_deps, mock_super_run, py_spark_processor, config, expected) without return types