code: def test_job_status():
      for s in JobStatus:
          terminal = s.is_terminal()
          if s.name in ["FAILED", "SUCCEEDED", "UNAVAILABLE"]:
              assert terminal
          else:
              assert not terminal
  
      # completed jobs
      status = V1JobStatus(completion_time=datetime.now(), succeeded=1)
      job_info = V1Job(status=status)
      job_status = JobStatus.from_job_info(job_info)
      assert job_status == JobStatus.SUCCEEDED
  
      status = V1JobStatus(completion_time=datetime.now(), succeeded=0)
      job_info = V1Job(status=status)
      job_status = JobStatus.from_job_info(job_info)
      assert job_status == JobStatus.FAILED
  
      # active jobs
      status = V1JobStatus(completion_time=None, active=1)
      job_info = V1Job(status=status)
      job_status = JobStatus.from_job_info(job_info)
      assert job_status == JobStatus.RUNNING
  
      # pending jobs
      status = V1JobStatus(completion_time=None, active=0)
      job_info = V1Job(status=status)
      job_status = JobStatus.from_job_info(job_info)
      assert job_status == JobStatus.PENDING
  
      # unknown state
      status = V1JobStatus()
      job_info = V1Job(status=status)
      job_status = JobStatus.from_job_info(job_info)
      assert job_status == JobStatus.STATE_UNSPECIFIED
  
      job_info = V1Job()
      job_status = JobStatus.from_job_info(job_info)
      assert job_status == JobStatus.STATE_UNSPECIFIED
  
      job_status = JobStatus.from_job_info(None)
      assert job_status == JobStatus.STATE_UNSPECIFIED
  
file_path: caliban/tests/caliban/platform/gke/test_types.py
imports: import unittest
  from datetime import datetime
  import hypothesis.strategies
  from hypothesis import given
  from kubernetes.client import V1Job, V1JobStatus
  import caliban.platform.gke.types
  from caliban.platform.gke.types import ReleaseChannel, JobStatus
label_desc: Use image node_id 1 for calling a global function with example usage: test_job_status() without return types