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

Method test_spaces

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

Source from the content-addressed store, hash-verified

171 self.assertEqualMetrics([metric_family], list(families))
172
173 def test_spaces(self):
174 families = text_string_to_metric_families("""# TYPE a counter
175# HELP a help
176a{ foo = "bar" } 1
177a\t\t{\t\tfoo\t\t=\t\t"baz"\t\t}\t\t2
178a { foo = "buz" } 3
179a\t { \t foo\t = "biz"\t } \t 4
180a \t{\t foo = "boz"\t}\t 5
181a{foo="bez"}6
182""")
183 metric_family = CounterMetricFamily("a", "help", labels=["foo"])
184 metric_family.add_metric(["bar"], 1)
185 metric_family.add_metric(["baz"], 2)
186 metric_family.add_metric(["buz"], 3)
187 metric_family.add_metric(["biz"], 4)
188 metric_family.add_metric(["boz"], 5)
189 metric_family.add_metric(["bez"], 6)
190 self.assertEqualMetrics([metric_family], list(families))
191
192 def test_commas(self):
193 families = text_string_to_metric_families("""# TYPE a counter

Callers

nothing calls this directly

Calls 4

add_metricMethod · 0.95
assertEqualMetricsMethod · 0.95
CounterMetricFamilyClass · 0.90

Tested by

no test coverage detected