class_docstr: Tests webserver network policy.
class_docstr_tok: ["Tests","webserver","network","policy","."]
code: def test_ports_overrides(self, ports, expected_ports):
      docs = render_chart(
          values={
              "networkPolicies": {"enabled": True},
              "webserver": {
                  "networkPolicy": {
                      "ingress": {
                          "from": [
                              {
                                  "namespaceSelector": {
                                      "matchLabels": {
                                          "release": "myrelease"
                                      }
                                  }
                              }
                          ],
                          "ports": ports,
                      }
                  }
              },
          },
          show_only=[
              "templates/webserver/webserver-networkpolicy.yaml"
          ],
      )
  
      assert expected_ports == jmespath.search(
          "spec.ingress[0].ports", docs[0]
      )
  
imports: from __future__ import annotations
  import jmespath
  import pytest
  from tests.charts.helm_template_generator import render_chart
label_desc: Use image node_id 3 for calling the TestWebserverNetworkPolicy obj's underlying member method code with example usage: obj.test_ports_overrides(ports, expected_ports) without return types