def METHOD_NAME(cause_error: bool):
    keyboard = create_keyboard(cause_error)
    sent_string = "ABC"
    keyboard_index = list(keyboard.SendMode).index(keyboard.SendMode.KEYBOARD)
    if cause_error:
        # Verify the test setup and swallow the exception created by the Mock
        assert_that(
            calling(keyboard.send_keys).with_args(sent_string, send_mode=keyboard_index),
            raises(Exception))
    else:
        keyboard.send_keys(sent_string, send_mode=keyboard_index)
    mock_mediator: MagicMock = keyboard.mediator
    mock_mediator.send_string.assert_called_once_with(sent_string)
    mock_mediator.paste_string.assert_not_called()
    mock_mediator.interface.finish_send.assert_called_once()