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

Method test_gzip

tests/test_wsgi.py:87–99  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85 self.assertEqual(mock.call_count, 1)
86
87 def test_gzip(self):
88 # Increment a metric
89 metric_name = "counter"
90 help_text = "A counter"
91 increments = 2
92 self.increment_metrics(metric_name, help_text, increments)
93 app = make_wsgi_app(self.registry)
94 # Try accessing metrics using the gzip Accept-Content header.
95 gzip_environ = dict(self.environ)
96 gzip_environ['HTTP_ACCEPT_ENCODING'] = 'gzip'
97 outputs = app(gzip_environ, self.capture)
98 # Assert outputs are compressed.
99 self.assert_outputs(outputs, metric_name, help_text, increments, compressed=True)
100
101 def test_gzip_disabled(self):
102 # Increment a metric

Callers

nothing calls this directly

Calls 3

increment_metricsMethod · 0.95
assert_outputsMethod · 0.95
make_wsgi_appFunction · 0.90

Tested by

no test coverage detected