(self)
| 157 | self.assert_outputs(outputs, metric_name, help_text, increments, compressed=True) |
| 158 | |
| 159 | def test_gzip_disabled(self): |
| 160 | # Increment a metric. |
| 161 | metric_name = "counter" |
| 162 | help_text = "A counter" |
| 163 | increments = 2 |
| 164 | self.increment_metrics(metric_name, help_text, increments) |
| 165 | # Disable compression explicitly. |
| 166 | app = make_asgi_app(self.registry, disable_compression=True) |
| 167 | self.seed_app(app) |
| 168 | # Send input with gzip header. |
| 169 | self.scope["headers"] = [(b"accept-encoding", b"gzip")] |
| 170 | self.send_input({"type": "http.request", "body": b""}) |
| 171 | # Assert outputs are not compressed. |
| 172 | outputs = self.get_all_output() |
| 173 | self.assert_outputs(outputs, metric_name, help_text, increments, compressed=False) |
| 174 | |
| 175 | def test_openmetrics_encoding(self): |
| 176 | """Response content type is application/openmetrics-text when appropriate Accept header is in request""" |
nothing calls this directly
no test coverage detected