code: def test_upload_to_hf_hub__validate_upload_parameters(
      output_directory_manager,
      file_names: list[str],
      error_raised: tuple[type, str] | None,
  ):
      """Test "HuggingFaceHub._validate_upload_parameters()", which is executed in the path of upload to HuggingFace
      Hub; for example: `upload hf_hub -repo_id "hf-account/repo-name" --model_path.
  
      /content/results/api_experiment_run`.
  
      Each test case consists of: 1) Populating the temporary output directory ("training_results_output) with zero or
      more test model weights file; 2) Executing "HuggingFaceHub._validate_upload_parameters()"; and 3) Asserting on
      presence/absence of errors.
      """
      output_directory: str = output_directory_manager
      _build_fake_model_repo(
          destination_directory=output_directory,
          experiment_name="my_simple_experiment_run",
          file_names=file_names,
      )
  
      model_path: pathlib.Path = (
          pathlib.Path(output_directory) / "my_simple_experiment_run"
      )
      model_weights_path: pathlib.Path = pathlib.Path(
          model_path / "model" / "model_weights"
      )
  
      repo_id: str = "test_account/test_repo"
      model_path: str = str(model_path)
      if error_raised:
          error_class: type  # noqa [F842]  # incorrect flagging of "local variable is annotated but never used
          error_message: str  # noqa [F842]  # incorrect flagging of "local variable is annotated but never used
          error_class, error_message = error_raised
          with pytest.raises(error_class) as excinfo:
              HuggingFaceHub._validate_upload_parameters(
                  repo_id=repo_id,
                  model_path=model_path,
              )
  
          assert str(excinfo.value) == error_message.format(
              model_weights_path=model_weights_path
          )
      else:
          try:
              HuggingFaceHub._validate_upload_parameters(
                  repo_id=repo_id,
                  model_path=model_path,
              )
          except Exception as exc:
              assert (
                  False
              ), f'"HuggingFaceHub._validate_upload_parameters()" raised an exception: "{exc}".'
  
file_path: ludwig/tests/ludwig/utils/test_upload_utils.py
imports: from __future__ import annotations
  import logging
  import pathlib
  import shutil
  import pytest
  from ludwig.utils.upload_utils import HuggingFaceHub
label_desc: Use image node_id 3 for calling a global function with example usage: test_upload_to_hf_hub__validate_upload_parameters(output_directory_manager, file_names, error_raised) without return types