class_docstr: Tests PgBouncer.
class_docstr_tok: ["Tests","PgBouncer","."]
code: def test_pgbouncer_service_with_custom_ports(self):
      docs = render_chart(
          values={
              "pgbouncer": {"enabled": True},
              "ports": {"pgbouncer": 1111, "pgbouncerScrape": 2222},
          },
          show_only=["templates/pgbouncer/pgbouncer-service.yaml"],
      )
  
      assert "true" == jmespath.search(
          'metadata.annotations."prometheus.io/scrape"', docs[0]
      )
      assert "2222" == jmespath.search(
          'metadata.annotations."prometheus.io/port"', docs[0]
      )
      assert {
          "name": "pgbouncer",
          "protocol": "TCP",
          "port": 1111,
      } in jmespath.search("spec.ports", docs[0])
      assert {
          "name": "pgbouncer-metrics",
          "protocol": "TCP",
          "port": 2222,
      } in jmespath.search("spec.ports", docs[0])
  
imports: from __future__ import annotations
  import base64
  import jmespath
  import pytest
  from tests.charts.helm_template_generator import render_chart
label_desc: Use image node_id 4 for calling the TestPgbouncer obj's underlying member method code with example usage: obj.test_pgbouncer_service_with_custom_ports() without return types