(self)
| 142 | self.validate_metrics("failed_requests", "Number of failed requests", 7) |
| 143 | |
| 144 | def test_gzip(self): |
| 145 | # Increment a metric. |
| 146 | metric_name = "counter" |
| 147 | help_text = "A counter" |
| 148 | increments = 2 |
| 149 | self.increment_metrics(metric_name, help_text, increments) |
| 150 | app = make_asgi_app(self.registry) |
| 151 | self.seed_app(app) |
| 152 | # Send input with gzip header. |
| 153 | self.scope["headers"] = [(b"accept-encoding", b"gzip")] |
| 154 | self.send_input({"type": "http.request", "body": b""}) |
| 155 | # Assert outputs are compressed. |
| 156 | outputs = self.get_all_output() |
| 157 | self.assert_outputs(outputs, metric_name, help_text, increments, compressed=True) |
| 158 | |
| 159 | def test_gzip_disabled(self): |
| 160 | # Increment a metric. |
nothing calls this directly
no test coverage detected