class_docstr: Tests basic helm chart tests.
class_docstr_tok: ["Tests","basic","helm","chart","tests","."]
code: def test_priority_classes(self):
      pc = [
          {
              "name": "class1",
              "preemptionPolicy": "PreemptLowerPriority",
              "value": 1000,
          },
          {
              "name": "class2",
              "preemptionPolicy": "Never",
              "value": 10000,
          },
      ]
      objs = render_chart(
          "my-release",
          show_only=["templates/priorityclasses/priority-classes.yaml"],
          values={"priorityClasses": pc},
      )
  
      assert len(objs) == 2
  
      for i in range(len(objs)):
          assert objs[i]["kind"] == "PriorityClass"
          assert objs[i]["apiVersion"] == "scheduling.k8s.io/v1"
          assert objs[i]["metadata"]["name"] == (
              "my-release" + "-" + pc[i]["name"]
          )
          assert (
              objs[i]["preemptionPolicy"] == pc[i]["preemptionPolicy"]
          )
          assert objs[i]["value"] == pc[i]["value"]
          assert (
              objs[i]["description"]
              == "This priority class will not cause other pods to be preempted."
          )
  
imports: from __future__ import annotations
  import base64
  import warnings
  from subprocess import CalledProcessError
  from typing import Any
  from unittest import mock
  import jmespath
  import pytest
  from tests.charts.helm_template_generator import render_chart
label_desc: Use image node_id 21 for calling the TestBaseChartTest obj's underlying member method code with example usage: obj.test_priority_classes() without return types