code: def test_state_transitions():
      mlflow_run_id = 1
      job_name = "job-name"
      job_namespace = "job-namespace"
      submitted_run = kb.KubernetesSubmittedRun(
          mlflow_run_id, job_name, job_namespace
      )
  
      with mock.patch(
          "kubernetes.client.BatchV1Api.read_namespaced_job_status"
      ) as kube_api_mock:
  
          def set_return_value(**kwargs):
              job_status = kubernetes.client.models.V1JobStatus(
                  **kwargs
              )
              kube_api_mock.return_value = (
                  kubernetes.client.models.V1Job(status=job_status)
              )
  
          set_return_value()
          assert RunStatus.SCHEDULED == submitted_run.get_status()
          set_return_value(start_time=1)
          assert RunStatus.RUNNING == submitted_run.get_status()
          set_return_value(start_time=1, failed=1)
          assert RunStatus.RUNNING == submitted_run.get_status()
          set_return_value(start_time=1, failed=1)
          assert RunStatus.RUNNING == submitted_run.get_status()
          set_return_value(start_time=1, failed=1, active=1)
          assert RunStatus.RUNNING == submitted_run.get_status()
          set_return_value(start_time=1, failed=1, succeeded=1)
          assert RunStatus.RUNNING == submitted_run.get_status()
          set_return_value(
              start_time=1, failed=1, succeeded=1, completion_time=2
          )
          assert RunStatus.RUNNING == submitted_run.get_status()
          condition = kubernetes.client.models.V1JobCondition(
              type="Complete", status="True"
          )
          set_return_value(
              conditions=[condition],
              failed=1,
              start_time=1,
              completion_time=2,
              succeeded=1,
          )
          assert RunStatus.FINISHED == submitted_run.get_status()
  
file_path: mlflow/tests/projects/test_kubernetes.py
imports: from unittest import mock
  import kubernetes
  import pytest
  import yaml
  from kubernetes.config.config_exception import ConfigException
  from mlflow.entities import RunStatus
  from mlflow.exceptions import ExecutionException
  from mlflow.projects import kubernetes
label_desc: Use image node_id 12 for calling a global function with example usage: test_state_transitions() without return types