Skip to content

Commit 433e335

Browse files
committed
filterx: add light test for pubsub attributes empty values handling
Signed-off-by: shifter <shifter@axoflow.com>
1 parent 16aa02e commit 433e335

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/light/functional_tests/filterx/test_filterx.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2634,13 +2634,15 @@ def test_pubsub_message(config, syslog_ng):
26342634
config, r"""
26352635
$MSG = json();
26362636
$MSG.msg = pubsub_message("my pubsub message", {"foo":"bar"});
2637+
$MSG.empty = pubsub_message("empty attribute value", {"empty":""});
26372638
""",
26382639
)
26392640
syslog_ng.start(config)
26402641

26412642
assert file_true.get_stats()["processed"] == 1
26422643
assert "processed" not in file_false.get_stats()
26432644
exp = (
2644-
r"""{"msg":{"data":"my pubsub message","attributes":{"foo":"bar"}}}""" + "\n"
2645+
r"""{"msg":{"data":"my pubsub message","attributes":{"foo":"bar"}},"""
2646+
""""empty":{"data":"empty attribute value","attributes":{"empty":""}}}""" + "\n"
26452647
)
26462648
assert file_true.read_log() == exp

0 commit comments

Comments
 (0)