Example #1
0
    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")
Example #2
0
    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")
Example #3
0
    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")
Example #4
0
    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())
Example #5
0
    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())
Example #6
0
    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")
Example #7
0
    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")
Example #8
0
    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")
Example #9
0
    def test_sort_name(self):
        name = SortCommand.name()

        self.assertEqual(name, 'sort')
Example #10
0
    def test_sort_name(self):
        name = SortCommand.name()

        self.assertEqual(name, 'sort')