Commit e93393b9 authored by Bram Schoenmakers's avatar Bram Schoenmakers

When new priority is the same, don't print it has changed.

parent 958398e1
......@@ -51,6 +51,13 @@ class PriorityCommandTest(CommandTest.CommandTest):
self.assertEquals(self.output, "Priority changed from A to B\n(B) Foo\n")
self.assertEquals(self.errors, "")
def test_set_prio4(self):
command = PriorityCommand.PriorityCommand(["1", "A"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "(A) Foo\n")
self.assertEquals(self.errors, "")
def test_invalid1(self):
command = PriorityCommand.PriorityCommand(["99", "A"], self.todolist, self.out, self.error)
......
......@@ -41,9 +41,9 @@ class PriorityCommand(Command):
old_priority = todo.priority()
self.todolist.set_priority(todo, priority)
if old_priority and priority:
if old_priority and priority and old_priority != priority:
self.out("Priority changed from %s to %s" % (old_priority, priority))
else:
elif not old_priority:
self.out("Priority set to %s." % priority)
self.out(pretty_print(todo))
......
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