Exemplo n.º 1
0
    def test_append5(self):
        command = AppendCommand([1, "Bar", "Baz"], self.todolist, self.out,
                                self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| Foo Bar Baz\n")
        self.assertEqual(self.errors, "")
Exemplo n.º 2
0
    def test_append2(self):
        command = AppendCommand([2, "Bar"], self.todolist, self.out,
                                self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Invalid todo number given.\n")
Exemplo n.º 3
0
    def test_append5(self):
        command = AppendCommand([1, "Bar", "Baz"], self.todolist, self.out,
                                self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| Foo Bar Baz\n")
        self.assertEqual(self.errors, "")
Exemplo n.º 4
0
    def test_append2(self):
        command = AppendCommand([2, "Bar"], self.todolist, self.out,
                                self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Invalid todo number given.\n")
Exemplo n.º 5
0
    def test_help(self):
        command = AppendCommand(["help"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors,
                         command.usage() + "\n\n" + command.help() + "\n")
Exemplo n.º 6
0
    def test_append8(self):
        command = AppendCommand([1, "due:today t:today"], self.todolist,
                                self.out, self.error)
        command.execute()

        self.assertEqual(self.output,
                         "|  1| Foo due:%s t:%s\n" % (self.today, self.today))
        self.assertEqual(self.errors, "")
Exemplo n.º 7
0
    def test_append8(self):
        command = AppendCommand([1, "due:today t:today"], self.todolist,
                                self.out, self.error)
        command.execute()

        self.assertEqual(self.output,
                         "|  1| Foo due:%s t:%s\n" % (self.today, self.today))
        self.assertEqual(self.errors, "")
Exemplo n.º 8
0
    def test_append9(self):
        self.todolist.add("Qux due:2015-12-21 t:2015-12-21 before:1")
        self.todolist.add("Baz")
        command = AppendCommand([2, "due:today t:today before:3"], self.todolist,
                                self.out, self.error)
        command.execute()

        self.assertEqual(
                self.output,
                "|  2| Qux due:%s t:%s p:1 p:2\n" % (self.today, self.today))
        self.assertEqual(self.errors, "")
Exemplo n.º 9
0
    def test_append9(self):
        self.todolist.add("Qux due:2015-12-21 t:2015-12-21 before:1")
        self.todolist.add("Baz")
        command = AppendCommand([2, "due:today t:today before:3"],
                                self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(
            self.output,
            "|  2| Qux due:%s t:%s p:1 p:2\n" % (self.today, self.today))
        self.assertEqual(self.errors, "")
Exemplo n.º 10
0
    def test_help(self):
        command = AppendCommand(["help"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors,
                         command.usage() + "\n\n" + command.help() + "\n")
Exemplo n.º 11
0
    def test_append7(self):
        command = AppendCommand(["Bar"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, command.usage() + "\n")
Exemplo n.º 12
0
    def test_append3(self):
        command = AppendCommand([1, ""], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.output, "")
Exemplo n.º 13
0
    def test_append7(self):
        command = AppendCommand(["Bar"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, command.usage() + "\n")
Exemplo n.º 14
0
    def test_append3(self):
        command = AppendCommand([1, ""], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.output, "")
Exemplo n.º 15
0
    def test_append_name(self):
        name = AppendCommand.name()

        self.assertEqual(name, 'append')
Exemplo n.º 16
0
    def test_append_name(self):
        name = AppendCommand.name()

        self.assertEqual(name, 'append')