async def test_has_prior_events(): sliced_states = [ None, {}, { PREVIOUS_ACTION: {"action_name": ACTION_LISTEN_NAME}, USER: {"intent": "greet"}, }, {PREVIOUS_ACTION: {"action_name": "utter_greet"}, USER: {"intent": "greet"}}, ] conflict = StoryConflict(sliced_states) assert conflict.conflict_has_prior_events
async def test_has_prior_events(): sliced_states = [ None, {}, { "intent_greet": 1.0, "prev_action_listen": 1.0 }, { "prev_utter_greet": 1.0, "intent_greet": 1.0 }, ] conflict = StoryConflict(sliced_states) assert conflict.conflict_has_prior_events
async def test_add_conflicting_action(): sliced_states = [ None, {}, {"intent_greet": 1.0, "prev_action_listen": 1.0}, {"prev_utter_greet": 1.0, "intent_greet": 1.0}, ] conflict = StoryConflict(sliced_states) conflict.add_conflicting_action("utter_greet", "xyz") conflict.add_conflicting_action("utter_default", "uvw") assert conflict.conflicting_actions == ["utter_greet", "utter_default"]
async def test_has_no_prior_events(): sliced_states = [None] conflict = StoryConflict(sliced_states) assert not conflict.conflict_has_prior_events