Only metrics that match the 'name[]' query string param appear
(self)
| 225 | ) |
| 226 | |
| 227 | def test_qs_parsing_multi(self): |
| 228 | """Only metrics that match the 'name[]' query string param appear""" |
| 229 | |
| 230 | app = make_asgi_app(self.registry) |
| 231 | metrics = [ |
| 232 | ("asdf", "first test metric", 1), |
| 233 | ("bsdf", "second test metric", 2), |
| 234 | ("csdf", "third test metric", 3) |
| 235 | ] |
| 236 | |
| 237 | for m in metrics: |
| 238 | self.increment_metrics(*m) |
| 239 | |
| 240 | self.seed_app(app) |
| 241 | self.scope['query_string'] = "&".join([f"name[]={m[0]}_total" for m in metrics[0:2]]).encode("utf-8") |
| 242 | self.send_default_request() |
| 243 | |
| 244 | outputs = self.get_all_output() |
| 245 | response_body = outputs[1] |
| 246 | output = response_body['body'].decode('utf8') |
| 247 | |
| 248 | self.assert_metrics(output, *metrics[0]) |
| 249 | self.assert_metrics(output, *metrics[1]) |
| 250 | self.assert_not_metrics(output, *metrics[2]) |
| 251 | |
| 252 | asyncio.new_event_loop().run_until_complete( |
| 253 | self.communicator.wait() |
| 254 | ) |
nothing calls this directly
no test coverage detected