class_docstr: Tests worker.
class_docstr_tok: ["Tests","worker","."]
code: def test_airflow_kerberos_init_container(
      self,
      airflow_version,
      init_container_enabled,
      expected_init_containers,
  ):
      docs = render_chart(
          values={
              "airflowVersion": airflow_version,
              "workers": {
                  "kerberosInitContainer": {
                      "enabled": init_container_enabled
                  },
                  "persistence": {"fixPermissions": True},
              },
          },
          show_only=["templates/workers/worker-deployment.yaml"],
      )
  
      initContainers = jmespath.search(
          "spec.template.spec.initContainers", docs[0]
      )
      assert len(initContainers) == expected_init_containers
  
      if expected_init_containers == 3:
          assert initContainers[1]["name"] == "kerberos-init"
          assert initContainers[1]["args"] == ["kerberos", "-o"]
  
imports: from __future__ import annotations
  import jmespath
  import pytest
  from tests.charts.helm_template_generator import render_chart
  from tests.charts.log_groomer import LogGroomerTestBase
label_desc: Use image node_id 28 for calling the TestWorker obj's underlying member method code with example usage: obj.test_airflow_kerberos_init_container(airflow_version, init_container_enabled, expected_init_containers) without return types