Commits

Anonymous committed 05be323 Draft

new tests

Comments (0)

Files changed (2)

test/plugin_manager_test.py

     return sut.PluginManager(config)
 
 
+def test_plugin_subconfig(plugin_manager):
+    sub_config = plugin_manager.plugin_subconfig(
+        "araldo.endpoints.endpoint", "mock_1")
+    assert sub_config == {
+        'channel': 'channel_1',
+        'id': 'endpoint-mock',
+        'name': 'mock_1'}
+
+
 def test_load_plugins_new(plugin_manager):
     plugin_manager._plugins = None
     plugin_manager.load_plugins()

test/raw_marshalling_test.py

 import pytest
 from datetime import datetime
 from araldo.marshalling import raw as sut
+from araldo.message import Message
 
 
 @pytest.fixture
 
 
 @pytest.fixture
+def timestamp_str(timestamp):
+    return str(timestamp)
+
+
+@pytest.fixture
 def payload():
     return "test_payload"
 
     assert message.payload == payload
     assert message.creation_timestamp.__class__ == datetime
     assert message.creation_timestamp is not None
+
+
+def test_to_externam_format(marshalling, message_obj, message_str, payload):
+    message = Message(**message_obj)
+    serialized_message_str = marshalling.to_external_format(message)
+    assert serialized_message_str == payload