class_docstr: Tests HPA.
docstr: HPA should only be created when enabled and executor is Celery or CeleryKubernetes.
code: def test_hpa_enabled(self, executor, is_created):
      """HPA should only be created when enabled and executor is Celery or CeleryKubernetes."""
      docs = render_chart(
          values={
              "workers": {
                  "hpa": {"enabled": True},
                  "persistence": {"enabled": False},
              },
              "executor": executor,
          },
          show_only=["templates/workers/worker-hpa.yaml"],
      )
      if is_created:
          assert (
              jmespath.search("metadata.name", docs[0])
              == "release-name-worker"
          )
      else:
          assert docs == []
  
file_path: airflow/helm_tests/other/test_hpa.py
imports: from __future__ import annotations
  import jmespath
  import pytest
  from tests.charts.helm_template_generator import render_chart
label_desc: Use image node_id 2 for calling the TestHPA obj's underlying member method code with example usage: obj.test_hpa_enabled(executor, is_created) without return types