class_docstr: Tests HPA.
docstr: If worker persistence is enabled, scaleTargetRef should be StatefulSet else Deployment.
code: def test_persistence(self, enabled, kind):
      """If worker persistence is enabled, scaleTargetRef should be StatefulSet else Deployment."""
      is_enabled = enabled == "enabled"
      docs = render_chart(
          values={
              "workers": {
                  "hpa": {"enabled": True},
                  "persistence": {"enabled": is_enabled},
              },
              "executor": "CeleryExecutor",
          },
          show_only=["templates/workers/worker-hpa.yaml"],
      )
      assert (
          jmespath.search("spec.scaleTargetRef.kind", docs[0]) == kind
      )
  
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 5 for calling the TestHPA obj's underlying member method code with example usage: obj.test_persistence(enabled, kind) without return types