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

Method test_counter_utf8

tests/test_exposition.py:53–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51""", generate_latest(self.registry, openmetrics.ALLOWUTF8))
52
53 def test_counter_utf8(self):
54 c = Counter('utf8.cc', 'A counter', registry=self.registry)
55 c.inc()
56 self.assertEqual(b"""# HELP "utf8.cc_total" A counter
57# TYPE "utf8.cc_total" counter
58{"utf8.cc_total"} 1.0
59# HELP "utf8.cc_created" A counter
60# TYPE "utf8.cc_created" gauge
61{"utf8.cc_created"} 123.456
62""", generate_latest(self.registry, openmetrics.ALLOWUTF8))
63
64 def test_counter_utf8_escaped_underscores(self):
65 c = Counter('utf8.cc', 'A counter', registry=self.registry)

Callers

nothing calls this directly

Calls 3

incMethod · 0.95
CounterClass · 0.90
generate_latestFunction · 0.90

Tested by

no test coverage detected