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

Method test_plaintext_encoding

tests/test_asgi.py:185–192  ·  view source on GitHub ↗

Response content type is text/plain when Accept header is missing in request

(self)

Source from the content-addressed store, hash-verified

183 assert content_type == "application/openmetrics-text"
184
185 def test_plaintext_encoding(self):
186 """Response content type is text/plain when Accept header is missing in request"""
187 app = make_asgi_app(self.registry)
188 self.seed_app(app)
189 self.send_input({"type": "http.request", "body": b""})
190
191 content_type = self.get_response_header_value('Content-Type').split(";")[0]
192 assert content_type == "text/plain"
193
194 def test_qs_parsing(self):
195 """Only metrics that match the 'name[]' query string param appear"""

Callers

nothing calls this directly

Calls 4

seed_appMethod · 0.95
send_inputMethod · 0.95
make_asgi_appFunction · 0.90

Tested by

no test coverage detected