예제 #1
0
async def test_send_elements_without_buttons():
    from rasa.core.channels.channel import OutputChannel

    async def test_message(sender, message):
        assert sender == "user"
        assert message == "a : b"

    channel = OutputChannel()
    channel.send_text_message = test_message
    await channel.send_elements("user", [{"title": "a", "subtitle": "b"}])
예제 #2
0
async def test_send_custom_messages_without_buttons():
    from rasa.core.channels.channel import OutputChannel

    async def test_message(sender, message):
        assert sender == 'user'
        assert message == 'a : b'

    channel = OutputChannel()
    channel.send_text_message = test_message
    await channel.send_custom_message("user", [{
        'title': 'a',
        'subtitle': 'b'
    }])