Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 9
0
    def test_sort_name(self):
        name = SortCommand.name()

        self.assertEqual(name, 'sort')
Ejemplo n.º 10
0
    def test_sort_name(self):
        name = SortCommand.name()

        self.assertEqual(name, 'sort')