コード例 #1
0
def test_json_parse_pause():
    # DOCS MARKER ConversationPaused
    evt = \
        {
            'event': 'pause',
        }
    # DOCS END
    assert Event.from_parameters(evt) == ConversationPaused()
コード例 #2
0
    def test_restart_if_paused(self, priority, domain_with_mapping):
        policy = self.create_policy(None, priority)
        events = [ConversationPaused(), user_uttered(USER_INTENT_RESTART, 1)]

        assert (
            self._get_next_action(policy, events, domain_with_mapping)
            == ACTION_RESTART_NAME
        )
コード例 #3
0
ファイル: test_events.py プロジェクト: zzBBc/rasa
def test_json_parse_pause():
    # DOCS MARKER ConversationPaused
    evt = {"event": "pause"}
    # DOCS END
    assert Event.from_parameters(evt) == ConversationPaused()
コード例 #4
0
ファイル: test_events.py プロジェクト: zzBBc/rasa
 "one_event,another_event",
 [
     (
         UserUttered("/greet", {
             "name": "greet",
             "confidence": 1.0
         }, []),
         UserUttered("/goodbye", {
             "name": "goodbye",
             "confidence": 1.0
         }, []),
     ),
     (SlotSet("my_slot", "value"), SlotSet("my__other_slot", "value")),
     (Restarted(), None),
     (AllSlotsReset(), None),
     (ConversationPaused(), None),
     (ConversationResumed(), None),
     (StoryExported(), None),
     (ActionReverted(), None),
     (UserUtteranceReverted(), None),
     (ActionExecuted("my_action"), ActionExecuted("my_other_action")),
     (FollowupAction("my_action"), FollowupAction("my_other_action")),
     (
         BotUttered("my_text", {"my_data": 1}),
         BotUttered("my_other_test", {"my_other_data": 1}),
     ),
     (
         AgentUttered("my_text", "my_data"),
         AgentUttered("my_other_test", "my_other_data"),
     ),
     (
コード例 #5
0
ファイル: test_events.py プロジェクト: zuiwanting/rasa
def test_json_parse_pause():
    evt = {"event": "pause"}
    assert Event.from_parameters(evt) == ConversationPaused()