def create_new_task(self): title = raw_input("Enter task title: ") status = "to-do" task_id = len(todo_list)+1 valid = Validation.validate_task(title) if valid: print(valid) else: new_task = Task(task_id, title, status) if(new_task.create_task()): print("successfully added task") print(" ") self.show_tasks() else: print("Failed to add task")
def test_deleting_all_task(self): task = Task(self.task_id, self.title, self.status) new_task = task.create_task() delete_all_tasks = Task.delete_all_tasks() self.assertEquals(delete_all_tasks, True)
def test_finishing_task(self): task = Task(self.task_id, self.title, self.status) new_task = task.create_task() finish_task = Task.mark_as_finished(self.task_id) self.assertEquals(finish_task, True)
def test_adding_task(self): task = Task(self.task_id, self.title, self.status) new_task = task.create_task() self.assertEquals(new_task, True)