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

Method test_empty_label

tests/test_parser.py:236–245  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

234 self.assertTrue(math.isnan(list(families)[0].samples[0][2]))
235
236 def test_empty_label(self):
237 families = text_string_to_metric_families("""# TYPE a counter
238# HELP a help
239a{foo="bar"} 1
240a{foo=""} 2
241""")
242 metric_family = CounterMetricFamily("a", "help", labels=["foo"])
243 metric_family.add_metric(["bar"], 1)
244 metric_family.add_metric([""], 2)
245 self.assertEqualMetrics([metric_family], list(families))
246
247 def test_label_escaping(self):
248 for escaped_val, unescaped_val in [

Callers

nothing calls this directly

Calls 4

add_metricMethod · 0.95
assertEqualMetricsMethod · 0.95
CounterMetricFamilyClass · 0.90

Tested by

no test coverage detected