def test_add_blank_action(self): processor = MongoProcessor() with pytest.raises(ValidationError): processor.add_action(" ", "tests", "testUser")
def test_add_action(self): processor = MongoProcessor() assert processor.add_action("utter_priority", "tests", "testUser") == None action = Actions.objects(bot="tests").get(name="utter_priority") assert action.name == "utter_priority"
def test_add_action_duplicate(self): processor = MongoProcessor() with pytest.raises(Exception): assert processor.add_action("utter_priority", "tests", "testUser") == None
def test_add_empty_action(self): processor = MongoProcessor() with pytest.raises(AssertionError): processor.add_action("", "tests", "testUser")