code: def test_get_k8s_pod_yaml(render_k8s_pod_yaml, redact, dag_maker):
      """
      Test that k8s_pod_yaml is rendered correctly, stored in the Database,
      and are correctly fetched using RTIF.get_k8s_pod_yaml
      """
      with dag_maker("test_get_k8s_pod_yaml") as dag:
          task = BashOperator(task_id="test", bash_command="echo hi")
      dr = dag_maker.create_dagrun()
      dag.fileloc = TEST_DAGS_FOLDER + "/test_get_k8s_pod_yaml.py"
  
      ti = dr.task_instances[0]
      ti.task = task
  
      render_k8s_pod_yaml.return_value = {"I'm a": "pod"}
  
      rtif = RTIF(ti=ti)
  
      assert ti.dag_id == rtif.dag_id
      assert ti.task_id == rtif.task_id
      assert ti.run_id == rtif.run_id
  
      expected_pod_yaml = {"I'm a": "pod"}
  
      assert rtif.k8s_pod_yaml == render_k8s_pod_yaml.return_value
      # K8s pod spec dict was passed to redact
      redact.assert_any_call(rtif.k8s_pod_yaml)
  
      with create_session() as session:
          session.add(rtif)
          session.flush()
  
          assert expected_pod_yaml == RTIF.get_k8s_pod_yaml(
              ti=ti, session=session
          )
          make_transient(ti)
          # "Delete" it from the DB
          session.rollback()
  
          # Test the else part of get_k8s_pod_yaml
          # i.e. for the TIs that are not stored in RTIF table
          # Fetching them will return None
          assert RTIF.get_k8s_pod_yaml(ti=ti, session=session) is None
  
file_path: airflow/tests/providers/cncf/kubernetes/test_template_rendering.py
imports: from __future__ import annotations
  import os
  from unittest import mock
  import pytest
  from sqlalchemy.orm import make_transient
  from airflow.configuration import TEST_DAGS_FOLDER
  from airflow.models.renderedtifields import RenderedTaskInstanceFields, RenderedTaskInstanceFields
  from airflow.operators.bash import BashOperator
  from airflow.utils.session import create_session
  from airflow.version import version
  from tests.models import DEFAULT_DATE
label_desc: Use image node_id 3 for calling a global function with example usage: test_get_k8s_pod_yaml(render_k8s_pod_yaml, redact, dag_maker) without return types