Exemplo n.º 1
0
    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")    
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)       
Exemplo n.º 4
0
 def test_adding_task(self):
     task = Task(self.task_id, self.title, self.status)
     new_task = task.create_task()
     self.assertEquals(new_task, True)