From 5c278dbdb0f35768fb850e923fcc7e0e9a8b5f0d Mon Sep 17 00:00:00 2001 From: shifter Date: Wed, 22 Jan 2025 11:29:13 +0100 Subject: [PATCH] filterx: add light test for pubsub attributes empty values handling Signed-off-by: shifter --- tests/light/functional_tests/filterx/test_filterx.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/light/functional_tests/filterx/test_filterx.py b/tests/light/functional_tests/filterx/test_filterx.py index c95bf0c02..2953751f3 100644 --- a/tests/light/functional_tests/filterx/test_filterx.py +++ b/tests/light/functional_tests/filterx/test_filterx.py @@ -2634,6 +2634,7 @@ def test_pubsub_message(config, syslog_ng): config, r""" $MSG = json(); $MSG.msg = pubsub_message("my pubsub message", {"foo":"bar"}); + $MSG.empty = pubsub_message("empty attribute value", {"empty":""}); """, ) syslog_ng.start(config) @@ -2641,6 +2642,7 @@ def test_pubsub_message(config, syslog_ng): assert file_true.get_stats()["processed"] == 1 assert "processed" not in file_false.get_stats() exp = ( - r"""{"msg":{"data":"my pubsub message","attributes":{"foo":"bar"}}}""" + "\n" + r"""{"msg":{"data":"my pubsub message","attributes":{"foo":"bar"}},""" + """"empty":{"data":"empty attribute value","attributes":{"empty":""}}}""" + "\n" ) assert file_true.read_log() == exp