code: def test_if_right_pid_is_read(
      self, mock_process, mock_setup_locations, tmp_path
  ):
      args = self.parser.parse_args(["celery", "stop"])
      pid = "123"
      path = tmp_path / "testfile"
      # Create pid file
      path.write_text(pid)
      # Setup mock
      mock_setup_locations.return_value = (
          os.fspath(path),
          None,
          None,
          None,
      )
  
      # Calling stop_worker should delete the temporary pid file
      celery_command.stop_worker(args)
      # Check if works as expected
      assert not path.exists()
      mock_process.assert_called_once_with(int(pid))
      mock_process.return_value.terminate.assert_called_once_with()
  
imports: from __future__ import annotations
  import importlib
  import os
  from argparse import Namespace
  from unittest import mock
  import pytest
  import sqlalchemy
  import airflow
  from airflow.cli import cli_parser
  from airflow.cli.commands import celery_command
  from airflow.configuration import conf
  from tests.test_utils.config import conf_vars
label_desc: Use image node_id 2 for calling the TestCeleryStopCommand obj's underlying member method code with example usage: obj.test_if_right_pid_is_read(mock_process, mock_setup_locations, tmp_path) without return types