Pack notifications to be compatible with SDL golang
In SDL Golang 'publish' API implementation packs all the events to single DB
notification, where events are separated by '___' characters. In SDL Golang
subscriber receives this packed DB notification and it splits the DB
notification by '___' characters and calls application notification handler
callback function with list of received events.
Current implementation of SDL Python is however different, is does not do any
packing for events and hence it calls application notification callback many
times, once for each event it has received. Also if SDL Python application is
used as event subscriber and SDL Golang application as event published,
Python application won't be able to handle those notifications what are packed
to one db notification by SDL Golang application.
With this commit implement notification packing to SDL Python.
Issue-ID: RIC-795
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Ie494430cf46756ea476b98343a8c651a2fa1dbcd
diff --git a/ricsdl-package/tests/test_configuration.py b/ricsdl-package/tests/test_configuration.py
index a9d24ba..1c89663 100644
--- a/ricsdl-package/tests/test_configuration.py
+++ b/ricsdl-package/tests/test_configuration.py
@@ -62,6 +62,9 @@
db_type=DbBackendType.FAKE_DICT)
assert expected_config == self.config.get_params()
+ def test_get_event_separator_function_return_expected_separator(self, config_fixture):
+ assert "___" == _Configuration.get_event_separator()
+
def test_get_params_function_can_raise_exception_if_wrong_fake_db_type(self):
with pytest.raises(ValueError, match=r"Configuration error"):
_Configuration(fake_db_backend='bad value')