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

Method test_gzip_disabled

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

Source from the content-addressed store, hash-verified

99 self.assert_outputs(outputs, metric_name, help_text, increments, compressed=True)
100
101 def test_gzip_disabled(self):
102 # Increment a metric
103 metric_name = "counter"
104 help_text = "A counter"
105 increments = 2
106 self.increment_metrics(metric_name, help_text, increments)
107 # Disable compression explicitly.
108 app = make_wsgi_app(self.registry, disable_compression=True)
109 # Try accessing metrics using the gzip Accept-Content header.
110 gzip_environ = dict(self.environ)
111 gzip_environ['HTTP_ACCEPT_ENCODING'] = 'gzip'
112 outputs = app(gzip_environ, self.capture)
113 # Assert outputs are not compressed.
114 self.assert_outputs(outputs, metric_name, help_text, increments, compressed=False)

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