Skip to content

Commit

Permalink
Unit test for error checking:
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Costanzo <[email protected]>
  • Loading branch information
ianco committed Aug 11, 2020
1 parent 0ad8d11 commit 98335ae
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions aries_cloudagent/core/tests/test_conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 98335ae

Please sign in to comment.