Commit b5a3dfea authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add ability to set the priority through the todolist.

parent f79f683c
......@@ -285,6 +285,11 @@ class TodoList(object):
todo.set_completed()
self.dirty = True
def set_priority(self, p_number, p_priority):
todo = self.todo(p_number)
todo.set_priority(p_priority)
self.dirty = True
def __str__(self):
return '\n'.join(pretty_print(self._todos))
......@@ -145,6 +145,12 @@ class TodoListTester(unittest.TestCase):
def test_todo_complete(self):
self.todolist.set_todo_completed(1)
self.assertTrue(self.todolist.todo(1).is_completed())
self.assertTrue(self.todolist.is_dirty())
def test_todo_priority(self):
self.todolist.set_priority(1, 'F')
self.assertEquals(self.todolist.todo(1).priority(), 'F')
self.assertTrue(self.todolist.is_dirty())
class TodoListDependencyTester(unittest.TestCase):
def setUp(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment