File tree 1 file changed +16
-0
lines changed 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,14 @@ def test_no_metadata(self):
173
173
metric_family .add_sample ("a" , {}, 1 )
174
174
self .assertEqual ([metric_family ], list (families ))
175
175
176
+ def test_empty_metadata (self ):
177
+ families = text_string_to_metric_families ("""# HELP a
178
+ # UNIT a
179
+ # EOF
180
+ """ )
181
+ metric_family = Metric ("a" , "" , "untyped" )
182
+ self .assertEqual ([metric_family ], list (families ))
183
+
176
184
def test_untyped (self ):
177
185
# https://github.com/prometheus/client_python/issues/79
178
186
families = text_string_to_metric_families ("""# HELP redis_connected_clients Redis connected clients
@@ -315,6 +323,14 @@ def test_escaping(self):
315
323
metric_family .add_metric (["b\\ a\\ z" ], 2 )
316
324
self .assertEqual ([metric_family ], list (families ))
317
325
326
+ def test_null_byte (self ):
327
+ families = text_string_to_metric_families ("""# TYPE a counter
328
+ # HELP a he\0 lp
329
+ # EOF
330
+ """ )
331
+ metric_family = CounterMetricFamily ("a" , "he\0 lp" )
332
+ self .assertEqual ([metric_family ], list (families ))
333
+
318
334
def test_timestamps (self ):
319
335
families = text_string_to_metric_families ("""# TYPE a counter
320
336
# HELP a help
You can’t perform that action at this time.
0 commit comments