From 98335aedf0a205e6874089ea42e0da4eb58867b0 Mon Sep 17 00:00:00 2001 From: Ian Costanzo Date: Tue, 11 Aug 2020 08:51:28 -0700 Subject: [PATCH] Unit test for error checking: Signed-off-by: Ian Costanzo --- aries_cloudagent/core/tests/test_conductor.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/aries_cloudagent/core/tests/test_conductor.py b/aries_cloudagent/core/tests/test_conductor.py index 54b9e6fd2b..10819bfbb1 100644 --- a/aries_cloudagent/core/tests/test_conductor.py +++ b/aries_cloudagent/core/tests/test_conductor.py @@ -576,3 +576,24 @@ async def test_webhook_router(self): mock_enqueue.assert_called_once_with( test_topic, test_payload, test_endpoint, test_attempts ) + + async def test_dispatch_complete_fatal_x(self): + builder: ContextBuilder = StubContextBuilder(self.test_settings) + conductor = test_module.Conductor(builder) + + message_body = "{}" + receipt = MessageReceipt(direct_response_mode="snail mail") + message = InboundMessage(message_body, receipt) + mock_task = async_mock.MagicMock( + exc_info=(test_module.LedgerTransactionError, ("Ledger is wobbly"), "..."), + ident="abc", + timing={ + "queued": 1234567890, + "unqueued": 1234567899, + "started": 1234567901, + "ended": 1234567999, + }, + ) + + await conductor.setup() + conductor.dispatch_complete(message, mock_task)