MCPcopy Index your code
hub / github.com/prometheus/client_python / test_gzip_disabled

Method test_gzip_disabled

tests/test_aiohttp.py:133–148  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

131 self.assert_metrics(output, metric_name, help_text, increments)
132
133 async def test_gzip_disabled(self):
134 # Increment a metric.
135 metric_name = "counter"
136 help_text = "A counter"
137 increments = 2
138 self.increment_metrics(metric_name, help_text, increments)
139
140 async with self.client.get(
141 "/metrics_uncompressed",
142 auto_decompress=False,
143 headers={hdrs.ACCEPT_ENCODING: "gzip"},
144 ) as response:
145 response.raise_for_status()
146 self.assertNotIn(hdrs.CONTENT_ENCODING, response.headers)
147 output = await response.text()
148 self.assert_metrics(output, metric_name, help_text, increments)
149
150 async def test_openmetrics_encoding(self):
151 """Response content type is application/openmetrics-text when appropriate Accept header is in request"""

Callers

nothing calls this directly

Calls 4

increment_metricsMethod · 0.95
assert_metricsMethod · 0.95
getMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected