def test_help(self): command = SortCommand(["help"], self.todolist, self.out, self.error) command.execute() self.assertEqual(self.output, "") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
def test_sort1(self): """ Alphabetically sorted """ command = SortCommand(["text"], self.todolist, self.out, self.error) command.execute() self.assertEqual(self.todolist.print_todos(), "First\n(A) Foo\n2014-06-14 Last")
def test_sort1(self): """ Alphabetically sorted. """ command = SortCommand(["text"], self.todolist, self.out, self.error) command.execute() self.assertEqual(self.todolist.print_todos(), "First\n(A) Foo\n2014-06-14 Last")
def test_sort3(self): """ Check that order does not influence the UID of a todo. """ config("test/data/todolist-uid.conf") todo1 = self.todolist.todo('7ui') command = SortCommand(["text"], self.todolist, self.out, self.error) command.execute() todo2 = self.todolist.todo('7ui') self.assertEqual(todo1.source(), todo2.source())
def test_sort2(self): command = SortCommand([], self.todolist, self.out, self.error) command.execute() self.assertEqual(self.todolist.print_todos(), "(A) Foo\n2014-06-14 Last\nFirst")
def test_sort_name(self): name = SortCommand.name() self.assertEqual(name, 'sort')