def test_add_story_end_with_user(self): processor = MongoProcessor() events = [ {"name": "greeting", "type": "user"}, {"name": "utter_greet", "type": "action"}, {"name": "mood_great", "type": "user"}, ] with pytest.raises(ValidationError): processor.add_story("greeting", events, "tests", "testUser")
def test_add_story(self): processor = MongoProcessor() events = [ {"name": "greet", "type": "user"}, {"name": "utter_greet", "type": "action"}, {"name": "mood_great", "type": "user"}, {"name": "utter_greet", "type": "action"}, ] processor.add_story("happy path", events, "tests", "testUser")
def test_add_duplicate_story(self): processor = MongoProcessor() events = [ {"name": "greet", "type": "user"}, {"name": "utter_greet", "type": "action"}, {"name": "mood_great", "type": "user"}, {"name": "utter_greet", "type": "action"}, ] with pytest.raises(Exception): processor.add_story("happy path", events, "tests", "testUser")
def test_add_blank_story_name(self): processor = MongoProcessor() events = [ { "name": "greeting", "type": "user" }, { "name": "utter_greet", "type": "action" }, { "name": "mood_great", "type": "user" }, { "name": "utter_greet", "type": "action" }, ] with pytest.raises(AssertionError): processor.add_story(" ", events, "tests", "testUser")
def test_add_empty_story_event(self): processor = MongoProcessor() with pytest.raises(ValidationError): processor.add_story("happy path", [], "tests", "testUser")