MCPcopy Create free account
hub / github.com/prometheus/client_python / test_escape_metric_name

Function test_escape_metric_name

tests/openmetrics/test_exposition.py:532–542  ·  view source on GitHub ↗
(scenario)

Source from the content-addressed store, hash-verified

530 },
531])
532def test_escape_metric_name(scenario):
533 input = scenario["input"]
534
535 got = escape_metric_name(input, UNDERSCORES)
536 assert got == scenario["expectedUnderscores"], f"[{scenario['name']}] Underscore escaping failed"
537
538 got = escape_metric_name(input, DOTS)
539 assert got == scenario["expectedDots"], f"[{scenario['name']}] Dots escaping failed"
540
541 got = escape_metric_name(input, VALUES)
542 assert got == scenario["expectedValue"], f"[{scenario['name']}] Value encoding failed"
543
544
545@pytest.mark.parametrize("scenario", [

Callers

nothing calls this directly

Calls 1

escape_metric_nameFunction · 0.90

Tested by

no test coverage detected