class_docstr: Tests pod template file.
class_docstr_tok: ["Tests","pod","template","file","."]
code: def test_workers_container_lifecycle_webhooks_are_configurable(
      self, hook_type="preStop"
  ):
      lifecycle_hook_params = CONTAINER_LIFECYCLE_PARAMETERS[hook_type]
      lifecycle_hooks_config = {
          hook_type: lifecycle_hook_params["lifecycle_templated"]
      }
      docs = render_chart(
          name=lifecycle_hook_params["release_name"],
          values={
              "workers": {
                  "containerLifecycleHooks": lifecycle_hooks_config
              },
          },
          show_only=["templates/pod-template-file.yaml"],
          chart_dir=self.temp_chart_dir,
      )
  
      assert lifecycle_hook_params[
          "lifecycle_parsed"
      ] == jmespath.search(
          f"spec.containers[0].lifecycle.{hook_type}", docs[0]
      )
  
imports: from __future__ import annotations
  import re
  from pathlib import Path
  from shutil import copyfile, copytree
  from tempfile import TemporaryDirectory
  import jmespath
  import pytest
  from helm_tests.airflow_aux.test_container_lifecycle import CONTAINER_LIFECYCLE_PARAMETERS
  from tests.charts.helm_template_generator import render_chart
label_desc: Use image node_id 36 for calling the TestPodTemplateFile obj's underlying member method code with example usage: obj.test_workers_container_lifecycle_webhooks_are_configurable(hook_type) without return types