Example #1
0
def test_default_action(default_dispatcher_collecting, default_domain):
    tracker = DialogueStateTracker("default", default_domain.slots)

    fallback_action = action.ActionDefaultFallback()

    events = fallback_action.run(default_dispatcher_collecting, tracker,
                                 default_domain)

    channel = default_dispatcher_collecting.output_channel
    assert channel.messages == [{
        u'text': u'default message',
        u'recipient_id': u'my-sender'
    }]
    assert events == [UserUtteranceReverted()]
Example #2
0
async def test_default_action(default_dispatcher_collecting, default_domain):
    tracker = DialogueStateTracker("default", default_domain.slots)

    fallback_action = action.ActionDefaultFallback()

    events = await fallback_action.run(default_dispatcher_collecting, tracker,
                                       default_domain)

    channel = default_dispatcher_collecting.output_channel
    assert channel.messages == [{
        u'text': u'sorry, I didn\'t get that, can you rephrase it?',
        u'recipient_id': u'my-sender'
    }]
    assert events == [UserUtteranceReverted()]