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")
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, "")
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")
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, "")
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, "")
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")
def test_append3(self): command = AppendCommand([1, ""], self.todolist, self.out, self.error) command.execute() self.assertEqual(self.output, "") self.assertEqual(self.output, "")