async def test_disclose(self): ctx = RequestContext() registry = ProtocolRegistry() registry.register_message_types({TEST_MESSAGE_TYPE: object()}) ctx.injector.bind_instance(ProtocolRegistry, registry) ctx.message = Disclose(protocols=[{ "pid": "did:sov:BzCbsNYhMrjHiqZDTUASHg;test_proto/test_message", "roles": [], }]) handler = DiscloseHandler() mock_responder = MockResponder() await handler.handle(ctx, mock_responder) assert not mock_responder.messages
async def test_called(self): request_context = RequestContext() request_context.connection_record = async_mock.MagicMock() request_context.connection_record.connection_id = "dummy" handler.save_connection_menu = async_mock.CoroutineMock() responder = MockResponder() request_context.message = handler.Menu() handler_inst = handler.MenuHandler() await handler_inst.handle(request_context, responder) handler.save_connection_menu.assert_called_once_with( request_context.message, request_context.connection_record.connection_id, request_context, )