Commit 7104428d authored by Bram Schoenmakers's avatar Bram Schoenmakers

assertEquals is deprecated, global replace-all to assertEqual.

parent 8a243132
...@@ -34,48 +34,48 @@ class AddCommandTest(CommandTest): ...@@ -34,48 +34,48 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(args, self.todolist, self.out, self.error) command = AddCommand.AddCommand(args, self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " New todo") self.assertEqual(self.todolist.todo(1).source(), self.today + " New todo")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_multiple_args(self): def test_add_multiple_args(self):
args = ["New", "todo"] args = ["New", "todo"]
command = AddCommand.AddCommand(args, self.todolist, self.out, self.error) command = AddCommand.AddCommand(args, self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " New todo") self.assertEqual(self.todolist.todo(1).source(), self.today + " New todo")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_priority1(self): def test_add_priority1(self):
command = AddCommand.AddCommand(["Foo (C)"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo (C)"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).priority(), 'C') self.assertEqual(self.todolist.todo(1).priority(), 'C')
self.assertEquals(self.todolist.todo(1).source(), "(C) " + self.today + " Foo") self.assertEqual(self.todolist.todo(1).source(), "(C) " + self.today + " Foo")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_priority2(self): def test_add_priority2(self):
command = AddCommand.AddCommand(["Foo (CC)"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo (CC)"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).priority(), None) self.assertEqual(self.todolist.todo(1).priority(), None)
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo (CC)") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo (CC)")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_priority3(self): def test_add_priority3(self):
command = AddCommand.AddCommand(["Fo(C)o"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Fo(C)o"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).priority(), None) self.assertEqual(self.todolist.todo(1).priority(), None)
self.assertEquals(self.todolist.todo(1).source(), self.today + " Fo(C)o" ) self.assertEqual(self.todolist.todo(1).source(), self.today + " Fo(C)o" )
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_priority4(self): def test_add_priority4(self):
command = AddCommand.AddCommand(["(C) Foo"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["(C) Foo"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).priority(), 'C') self.assertEqual(self.todolist.todo(1).priority(), 'C')
self.assertEquals(self.todolist.todo(1).source(), "(C) " + self.today + " Foo") self.assertEqual(self.todolist.todo(1).source(), "(C) " + self.today + " Foo")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep1(self): def test_add_dep1(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
...@@ -84,9 +84,9 @@ class AddCommandTest(CommandTest): ...@@ -84,9 +84,9 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(["Bar before:1"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Bar before:1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo id:1") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo id:1")
self.assertEquals(self.todolist.todo(2).source(), self.today + " Bar p:1") self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar p:1")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep2(self): def test_add_dep2(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
...@@ -95,9 +95,9 @@ class AddCommandTest(CommandTest): ...@@ -95,9 +95,9 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(["Bar partof:1"], self.todolist) command = AddCommand.AddCommand(["Bar partof:1"], self.todolist)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo id:1") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo id:1")
self.assertEquals(self.todolist.todo(2).source(), self.today + " Bar p:1") self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar p:1")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep3(self): def test_add_dep3(self):
command = AddCommand.AddCommand(["Foo"], self.todolist) command = AddCommand.AddCommand(["Foo"], self.todolist)
...@@ -106,9 +106,9 @@ class AddCommandTest(CommandTest): ...@@ -106,9 +106,9 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(["Bar after:1"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Bar after:1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo p:1") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo p:1")
self.assertEquals(self.todolist.todo(2).source(), self.today + " Bar id:1") self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar id:1")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep4(self): def test_add_dep4(self):
""" Test for using an after: tag with non-existing value. """ """ Test for using an after: tag with non-existing value. """
...@@ -116,9 +116,9 @@ class AddCommandTest(CommandTest): ...@@ -116,9 +116,9 @@ class AddCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.todo(1).has_tag("after")) self.assertFalse(self.todolist.todo(1).has_tag("after"))
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo")
self.assertEquals(self.output, "| 1| " + str(self.todolist.todo(1)) + "\n") self.assertEqual(self.output, "| 1| " + str(self.todolist.todo(1)) + "\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep5(self): def test_add_dep5(self):
""" Test for using an after: tag with non-existing value. """ """ Test for using an after: tag with non-existing value. """
...@@ -126,9 +126,9 @@ class AddCommandTest(CommandTest): ...@@ -126,9 +126,9 @@ class AddCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.todo(1).has_tag("after")) self.assertFalse(self.todolist.todo(1).has_tag("after"))
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo")
self.assertEquals(self.output, "| 1| " + str(self.todolist.todo(1)) + "\n") self.assertEqual(self.output, "| 1| " + str(self.todolist.todo(1)) + "\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep6(self): def test_add_dep6(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
...@@ -140,10 +140,10 @@ class AddCommandTest(CommandTest): ...@@ -140,10 +140,10 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(["Baz before:1 before:2"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Baz before:1 before:2"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo id:1") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo id:1")
self.assertEquals(self.todolist.todo(2).source(), self.today + " Bar id:2") self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar id:2")
self.assertEquals(self.todolist.todo(3).source(), self.today + " Baz p:1 p:2") self.assertEqual(self.todolist.todo(3).source(), self.today + " Baz p:1 p:2")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep7(self): def test_add_dep7(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
...@@ -155,10 +155,10 @@ class AddCommandTest(CommandTest): ...@@ -155,10 +155,10 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(["Baz after:1 after:2"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Baz after:1 after:2"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo p:1") self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo p:1")
self.assertEquals(self.todolist.todo(2).source(), self.today + " Bar p:1") self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar p:1")
self.assertEquals(self.todolist.todo(3).source(), self.today + " Baz id:1") self.assertEqual(self.todolist.todo(3).source(), self.today + " Baz id:1")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_dep8(self): def test_add_dep8(self):
config("test/data/todolist-uid.conf") config("test/data/todolist-uid.conf")
...@@ -169,8 +169,8 @@ class AddCommandTest(CommandTest): ...@@ -169,8 +169,8 @@ class AddCommandTest(CommandTest):
command = AddCommand.AddCommand(["Bar after:7ui"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Bar after:7ui"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo('7ui').source(), "{} Foo p:1".format(self.today)) self.assertEqual(self.todolist.todo('7ui').source(), "{} Foo p:1".format(self.today))
self.assertEquals(self.todolist.todo('8to').source(), "{} Bar id:1".format(self.today)) self.assertEqual(self.todolist.todo('8to').source(), "{} Bar id:1".format(self.today))
def test_add_dep9(self): def test_add_dep9(self):
""" """
...@@ -190,7 +190,7 @@ class AddCommandTest(CommandTest): ...@@ -190,7 +190,7 @@ class AddCommandTest(CommandTest):
command = ListCommand.ListCommand(["Bar"], self.todolist, self.out, self.error) command = ListCommand.ListCommand(["Bar"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "|kbn| {today} Bar p:1 +Project\n|kbn| {today} Bar +Project\n".format(today=self.today)) self.assertEqual(self.output, "|kbn| {today} Bar p:1 +Project\n|kbn| {today} Bar +Project\n".format(today=self.today))
def test_add_dep10(self): def test_add_dep10(self):
""" """
...@@ -210,36 +210,36 @@ class AddCommandTest(CommandTest): ...@@ -210,36 +210,36 @@ class AddCommandTest(CommandTest):
command = ListCommand.ListCommand(["Bar"], self.todolist, self.out, self.error) command = ListCommand.ListCommand(["Bar"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "|wb3| {today} Bar p:1 @Context\n|wb3| {today} Bar @Context\n".format(today=self.today)) self.assertEqual(self.output, "|wb3| {today} Bar p:1 @Context\n|wb3| {today} Bar @Context\n".format(today=self.today))
def test_add_reldate1(self): def test_add_reldate1(self):
command = AddCommand.AddCommand(["Foo due:today"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo due:today"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo due:" + self.today) self.assertEqual(self.todolist.todo(1).source(), self.today + " Foo due:" + self.today)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_reldate2(self): def test_add_reldate2(self):
command = AddCommand.AddCommand(["Foo t:today due:today"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["Foo t:today due:today"], self.todolist, self.out, self.error)
command.execute() command.execute()
result = "| 1| {} Foo t:{} due:{}\n".format(self.today, self.today, self.today) result = "| 1| {} Foo t:{} due:{}\n".format(self.today, self.today, self.today)
self.assertEquals(self.output, result) self.assertEqual(self.output, result)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add_empty(self): def test_add_empty(self):
command = AddCommand.AddCommand([], self.todolist, self.out, self.error) command = AddCommand.AddCommand([], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_help(self): def test_help(self):
command = AddCommand.AddCommand(["help"], self.todolist, self.out, self.error) command = AddCommand.AddCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -79,8 +79,8 @@ class AppendCommandTest(CommandTest): ...@@ -79,8 +79,8 @@ class AppendCommandTest(CommandTest):
command = AppendCommand(["help"], self.todolist, self.out, self.error) command = AppendCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -31,8 +31,8 @@ class ArchiveCommandTest(CommandTest): ...@@ -31,8 +31,8 @@ class ArchiveCommandTest(CommandTest):
self.assertTrue(todolist.is_dirty()) self.assertTrue(todolist.is_dirty())
self.assertTrue(archive.is_dirty()) self.assertTrue(archive.is_dirty())
self.assertEquals(str(todolist), "x Not complete\n(C) Active") self.assertEqual(str(todolist), "x Not complete\n(C) Active")
self.assertEquals(str(archive), "x 2014-10-19 Complete\nx 2014-10-20 Another one complete") self.assertEqual(str(archive), "x 2014-10-19 Complete\nx 2014-10-20 Another one complete")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
......
...@@ -21,7 +21,7 @@ from test.TopydoTest import TopydoTest ...@@ -21,7 +21,7 @@ from test.TopydoTest import TopydoTest
class ConfigTest(TopydoTest): class ConfigTest(TopydoTest):
def test_config1(self): def test_config1(self):
self.assertEquals(config("test/data/config1").default_command(), 'do') self.assertEqual(config("test/data/config1").default_command(), 'do')
def test_config2(self): def test_config2(self):
self.assertNotEquals(config("").default_command(), 'do') self.assertNotEquals(config("").default_command(), 'do')
......
...@@ -43,70 +43,70 @@ class DeleteCommandTest(CommandTest): ...@@ -43,70 +43,70 @@ class DeleteCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Bar") self.assertEqual(self.todolist.todo(1).source(), "Bar")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n") self.assertEqual(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_del1_regex(self): def test_del1_regex(self):
command = DeleteCommand(["Foo"], self.todolist, self.out, self.error, _no_prompt) command = DeleteCommand(["Foo"], self.todolist, self.out, self.error, _no_prompt)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Bar") self.assertEqual(self.todolist.todo(1).source(), "Bar")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n") self.assertEqual(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_del2(self): def test_del2(self):
command = DeleteCommand(["1"], self.todolist, self.out, self.error, _yes_prompt) command = DeleteCommand(["1"], self.todolist, self.out, self.error, _yes_prompt)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.count(), 0) self.assertEqual(self.todolist.count(), 0)
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Bar\nRemoved: Foo\n") self.assertEqual(self.output, "| 2| Bar p:1\nRemoved: Bar\nRemoved: Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_del3(self): def test_del3(self):
command = DeleteCommand(["-f", "1"], self.todolist, self.out, self.error, _yes_prompt) command = DeleteCommand(["-f", "1"], self.todolist, self.out, self.error, _yes_prompt)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.count(), 1) # force won't delete subtasks self.assertEqual(self.todolist.count(), 1) # force won't delete subtasks
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n") self.assertEqual(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_del4(self): def test_del4(self):
command = DeleteCommand(["--force", "1"], self.todolist, self.out, self.error, _yes_prompt) command = DeleteCommand(["--force", "1"], self.todolist, self.out, self.error, _yes_prompt)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.count(), 1) # force won't delete subtasks self.assertEqual(self.todolist.count(), 1) # force won't delete subtasks
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n") self.assertEqual(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_del5(self): def test_del5(self):
command = DeleteCommand(["2"], self.todolist, self.out, self.error) command = DeleteCommand(["2"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Foo") self.assertEqual(self.todolist.todo(1).source(), "Foo")
self.assertEquals(self.output, "Removed: Bar p:1\nThe following todo item(s) became active:\n| 1| Foo\n") self.assertEqual(self.output, "Removed: Bar p:1\nThe following todo item(s) became active:\n| 1| Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_del7(self): def test_del7(self):
command = DeleteCommand(["99"], self.todolist, self.out, self.error) command = DeleteCommand(["99"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_del8(self): def test_del8(self):
command = DeleteCommand(["A"], self.todolist, self.out, self.error) command = DeleteCommand(["A"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_del9(self): def test_del9(self):
""" Test deletion with textual IDs. """ """ Test deletion with textual IDs. """
...@@ -115,7 +115,7 @@ class DeleteCommandTest(CommandTest): ...@@ -115,7 +115,7 @@ class DeleteCommandTest(CommandTest):
command = DeleteCommand(["8to"], self.todolist, self.out, self.error) command = DeleteCommand(["8to"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(str(self.todolist), "Foo") self.assertEqual(str(self.todolist), "Foo")
self.assertRaises(InvalidTodoException, self.todolist.todo, 'b0n') self.assertRaises(InvalidTodoException, self.todolist.todo, 'b0n')
def test_multi_del1(self): def test_multi_del1(self):
...@@ -123,14 +123,14 @@ class DeleteCommandTest(CommandTest): ...@@ -123,14 +123,14 @@ class DeleteCommandTest(CommandTest):
command = DeleteCommand(["1", "2"], self.todolist, self.out, self.error, _no_prompt) command = DeleteCommand(["1", "2"], self.todolist, self.out, self.error, _no_prompt)
command.execute() command.execute()
self.assertEquals(self.todolist.count(), 0) self.assertEqual(self.todolist.count(), 0)
def test_multi_del2(self): def test_multi_del2(self):
""" Test deletion of multiple items. """ """ Test deletion of multiple items. """
command = DeleteCommand(["1", "2"], self.todolist, self.out, self.error, _yes_prompt) command = DeleteCommand(["1", "2"], self.todolist, self.out, self.error, _yes_prompt)
command.execute() command.execute()
self.assertEquals(self.todolist.count(), 0) self.assertEqual(self.todolist.count(), 0)
def test_multi_del3(self): def test_multi_del3(self):
""" Fail if any of supplied todo numbers is invalid. """ """ Fail if any of supplied todo numbers is invalid. """
...@@ -138,8 +138,8 @@ class DeleteCommandTest(CommandTest): ...@@ -138,8 +138,8 @@ class DeleteCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given: 99.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\n")
def test_multi_del4(self): def test_multi_del4(self):
""" Check output when all supplied todo numbers are invalid. """ """ Check output when all supplied todo numbers are invalid. """
...@@ -147,8 +147,8 @@ class DeleteCommandTest(CommandTest): ...@@ -147,8 +147,8 @@ class DeleteCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: A.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: A.\n")
def test_empty(self): def test_empty(self):
command = DeleteCommand([], self.todolist, self.out, self.error) command = DeleteCommand([], self.todolist, self.out, self.error)
...@@ -156,14 +156,14 @@ class DeleteCommandTest(CommandTest): ...@@ -156,14 +156,14 @@ class DeleteCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_help(self): def test_help(self):
command = DeleteCommand(["help"], self.todolist, self.out, self.error) command = DeleteCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -40,8 +40,8 @@ class DepCommandTest(CommandTest): ...@@ -40,8 +40,8 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(4).has_tag('p', '1')) self.assertTrue(self.todolist.todo(4).has_tag('p', '1'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add2(self): def test_add2(self):
command = DepCommand(["add", "1", "4"], self.todolist, self.out, self.error) command = DepCommand(["add", "1", "4"], self.todolist, self.out, self.error)
...@@ -49,32 +49,32 @@ class DepCommandTest(CommandTest): ...@@ -49,32 +49,32 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(4).has_tag('p', '1')) self.assertTrue(self.todolist.todo(4).has_tag('p', '1'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add3(self): def test_add3(self):
command = DepCommand(["add", "99", "3"], self.todolist, self.out, self.error) command = DepCommand(["add", "99", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_add4(self): def test_add4(self):
command = DepCommand(["add", "A", "3"], self.todolist, self.out, self.error) command = DepCommand(["add", "A", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_add5(self): def test_add5(self):
command = DepCommand(["add", "1"], self.todolist, self.out, self.error) command = DepCommand(["add", "1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_add6(self): def test_add6(self):
command = DepCommand(["add", "1", "after", "4"], self.todolist, self.out, self.error) command = DepCommand(["add", "1", "after", "4"], self.todolist, self.out, self.error)
...@@ -82,8 +82,8 @@ class DepCommandTest(CommandTest): ...@@ -82,8 +82,8 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(4).has_tag('p', '1')) self.assertTrue(self.todolist.todo(4).has_tag('p', '1'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add7(self): def test_add7(self):
command = DepCommand(["add", "1", "before", "4"], self.todolist, self.out, self.error) command = DepCommand(["add", "1", "before", "4"], self.todolist, self.out, self.error)
...@@ -91,8 +91,8 @@ class DepCommandTest(CommandTest): ...@@ -91,8 +91,8 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(1).has_tag('p', '2')) self.assertTrue(self.todolist.todo(1).has_tag('p', '2'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add8(self): def test_add8(self):
command = DepCommand(["add", "1", "partof", "4"], self.todolist, self.out, self.error) command = DepCommand(["add", "1", "partof", "4"], self.todolist, self.out, self.error)
...@@ -100,8 +100,8 @@ class DepCommandTest(CommandTest): ...@@ -100,8 +100,8 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(1).has_tag('p', '2')) self.assertTrue(self.todolist.todo(1).has_tag('p', '2'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_add9(self): def test_add9(self):
command = DepCommand(["add", "Foo", "to", "4"], self.todolist, self.out, self.error) command = DepCommand(["add", "Foo", "to", "4"], self.todolist, self.out, self.error)
...@@ -109,8 +109,8 @@ class DepCommandTest(CommandTest): ...@@ -109,8 +109,8 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(4).has_tag('p', '1')) self.assertTrue(self.todolist.todo(4).has_tag('p', '1'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def rm_helper(self, p_args): def rm_helper(self, p_args):
""" """
...@@ -124,8 +124,8 @@ class DepCommandTest(CommandTest): ...@@ -124,8 +124,8 @@ class DepCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(1).has_tag('id', '1')) self.assertTrue(self.todolist.todo(1).has_tag('id', '1'))
self.assertFalse(self.todolist.todo(3).has_tag('p', '1')) self.assertFalse(self.todolist.todo(3).has_tag('p', '1'))
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm1(self): def test_rm1(self):
self.rm_helper(["rm", "1", "to", "3"]) self.rm_helper(["rm", "1", "to", "3"])
...@@ -144,64 +144,64 @@ class DepCommandTest(CommandTest): ...@@ -144,64 +144,64 @@ class DepCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_rm4(self): def test_rm4(self):
command = DepCommand(["rm", "A", "3"], self.todolist, self.out, self.error) command = DepCommand(["rm", "A", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_rm5(self): def test_rm5(self):
command = DepCommand(["rm", "1"], self.todolist, self.out, self.error) command = DepCommand(["rm", "1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_ls1(self): def test_ls1(self):
command = DepCommand(["ls", "1", "to"], self.todolist, self.out, self.error) command = DepCommand(["ls", "1", "to"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| Bar p:1\n| 3| Baz p:1\n") self.assertEqual(self.output, "| 2| Bar p:1\n| 3| Baz p:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_ls2(self): def test_ls2(self):
command = DepCommand(["ls", "99", "to"], self.todolist, self.out, self.error) command = DepCommand(["ls", "99", "to"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_ls3(self): def test_ls3(self):
command = DepCommand(["ls", "to", "3"], self.todolist, self.out, self.error) command = DepCommand(["ls", "to", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| Foo id:1\n") self.assertEqual(self.output, "| 1| Foo id:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_ls4(self): def test_ls4(self):
command = DepCommand(["ls", "to", "99"], self.todolist, self.out, self.error) command = DepCommand(["ls", "to", "99"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_ls5(self): def test_ls5(self):
command = DepCommand(["ls", "1"], self.todolist, self.out, self.error) command = DepCommand(["ls", "1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_ls6(self): def test_ls6(self):
command = DepCommand(["ls"], self.todolist, self.out, self.error) command = DepCommand(["ls"], self.todolist, self.out, self.error)
...@@ -209,7 +209,7 @@ class DepCommandTest(CommandTest): ...@@ -209,7 +209,7 @@ class DepCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def gc_helper(self, p_subcommand): def gc_helper(self, p_subcommand):
command = DepCommand([p_subcommand], self.todolist, self.out, self.error) command = DepCommand([p_subcommand], self.todolist, self.out, self.error)
...@@ -246,8 +246,8 @@ class DepCommandTest(CommandTest): ...@@ -246,8 +246,8 @@ class DepCommandTest(CommandTest):
command = DepCommand(["help"], self.todolist, self.out, self.error) command = DepCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -36,37 +36,37 @@ class DepriCommandTest(CommandTest): ...@@ -36,37 +36,37 @@ class DepriCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).priority(), None) self.assertEqual(self.todolist.todo(1).priority(), None)
self.assertEquals(self.output, "Priority removed.\n| 1| Foo\n") self.assertEqual(self.output, "Priority removed.\n| 1| Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_depri2(self): def test_depri2(self):
command = DepriCommand(["2"], self.todolist, self.out, self.error) command = DepriCommand(["2"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(2).priority(), None) self.assertEqual(self.todolist.todo(2).priority(), None)
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_depri3(self): def test_depri3(self):
command = DepriCommand(["Foo"], self.todolist, self.out, self.error) command = DepriCommand(["Foo"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).priority(), None) self.assertEqual(self.todolist.todo(1).priority(), None)
self.assertEquals(self.output, "Priority removed.\n| 1| Foo\n") self.assertEqual(self.output, "Priority removed.\n| 1| Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_depri4(self): def test_depri4(self):
command = DepriCommand(["1","Baz"], self.todolist, self.out, self.error) command = DepriCommand(["1","Baz"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).priority(), None) self.assertEqual(self.todolist.todo(1).priority(), None)
self.assertEquals(self.todolist.todo(3).priority(), None) self.assertEqual(self.todolist.todo(3).priority(), None)
self.assertEquals(self.output, "Priority removed.\n| 1| Foo\nPriority removed.\n| 3| Baz\n") self.assertEqual(self.output, "Priority removed.\n| 1| Foo\nPriority removed.\n| 3| Baz\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_invalid1(self): def test_invalid1(self):
...@@ -75,7 +75,7 @@ class DepriCommandTest(CommandTest): ...@@ -75,7 +75,7 @@ class DepriCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_invalid2(self): def test_invalid2(self):
command = DepriCommand(["99", "1"], self.todolist, self.out, self.error) command = DepriCommand(["99", "1"], self.todolist, self.out, self.error)
...@@ -83,7 +83,7 @@ class DepriCommandTest(CommandTest): ...@@ -83,7 +83,7 @@ class DepriCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given: 99.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\n")
def test_invalid3(self): def test_invalid3(self):
command = DepriCommand(["99", "FooBar"], self.todolist, self.out, self.error) command = DepriCommand(["99", "FooBar"], self.todolist, self.out, self.error)
...@@ -91,7 +91,7 @@ class DepriCommandTest(CommandTest): ...@@ -91,7 +91,7 @@ class DepriCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: FooBar.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: FooBar.\n")
def test_empty(self): def test_empty(self):
command = DepriCommand([], self.todolist, self.out, self.error) command = DepriCommand([], self.todolist, self.out, self.error)
...@@ -99,14 +99,14 @@ class DepriCommandTest(CommandTest): ...@@ -99,14 +99,14 @@ class DepriCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_help(self): def test_help(self):
command = DepriCommand(["help"], self.todolist, self.out, self.error) command = DepriCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -57,9 +57,9 @@ class DoCommandTest(CommandTest): ...@@ -57,9 +57,9 @@ class DoCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(3).is_completed()) self.assertTrue(self.todolist.todo(3).is_completed())
self.assertEquals(self.output, "Completed: x {} Baz p:1\n".format( self.assertEqual(self.output, "Completed: x {} Baz p:1\n".format(
self.today)) self.today))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_subtasks1(self): def test_do_subtasks1(self):
command = DoCommand(["1"], self.todolist, self.out, self.error, _yes_prompt) command = DoCommand(["1"], self.todolist, self.out, self.error, _yes_prompt)
...@@ -72,8 +72,8 @@ class DoCommandTest(CommandTest): ...@@ -72,8 +72,8 @@ class DoCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertFalse(self.todolist.todo(4).is_completed()) self.assertFalse(self.todolist.todo(4).is_completed())
self.assertEquals(self.output, result) self.assertEqual(self.output, result)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_subtasks2(self): def test_do_subtasks2(self):
command = DoCommand(["1"], self.todolist, self.out, self.error, _no_prompt) command = DoCommand(["1"], self.todolist, self.out, self.error, _no_prompt)
...@@ -85,8 +85,8 @@ class DoCommandTest(CommandTest): ...@@ -85,8 +85,8 @@ class DoCommandTest(CommandTest):
self.assertTrue(self.todolist.todo(1).is_completed()) self.assertTrue(self.todolist.todo(1).is_completed())
self.assertFalse(self.todolist.todo(2).is_completed()) self.assertFalse(self.todolist.todo(2).is_completed())
self.assertFalse(self.todolist.todo(3).is_completed()) self.assertFalse(self.todolist.todo(3).is_completed())
self.assertEquals(self.output, result) self.assertEqual(self.output, result)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_subtasks_force1(self): def test_do_subtasks_force1(self):
prompt_shown = False prompt_shown = False
...@@ -99,7 +99,7 @@ class DoCommandTest(CommandTest): ...@@ -99,7 +99,7 @@ class DoCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(prompt_shown) self.assertFalse(prompt_shown)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertFalse(self.todolist.todo(2).is_completed()) self.assertFalse(self.todolist.todo(2).is_completed())
def test_do_subtasks_force2(self): def test_do_subtasks_force2(self):
...@@ -113,7 +113,7 @@ class DoCommandTest(CommandTest): ...@@ -113,7 +113,7 @@ class DoCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(prompt_shown) self.assertFalse(prompt_shown)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertFalse(self.todolist.todo(2).is_completed()) self.assertFalse(self.todolist.todo(2).is_completed())
def _recurrence_helper(self, p_flags): def _recurrence_helper(self, p_flags):
...@@ -121,8 +121,8 @@ class DoCommandTest(CommandTest): ...@@ -121,8 +121,8 @@ class DoCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertEquals(self.todolist.count(), 10) self.assertEqual(self.todolist.count(), 10)
def test_recurrence(self): def test_recurrence(self):
self.assertFalse(self.todolist.todo(4).has_tag('due')) self.assertFalse(self.todolist.todo(4).has_tag('due'))
...@@ -131,7 +131,7 @@ class DoCommandTest(CommandTest): ...@@ -131,7 +131,7 @@ class DoCommandTest(CommandTest):
self.assertTrue(self.todolist.todo(4).is_completed()) self.assertTrue(self.todolist.todo(4).is_completed())
result = "| 10| {today} Recurring! rec:1d due:{tomorrow}\nCompleted: x {today} Recurring! rec:1d\n".format(today=self.today, tomorrow=self.tomorrow) result = "| 10| {today} Recurring! rec:1d due:{tomorrow}\nCompleted: x {today} Recurring! rec:1d\n".format(today=self.today, tomorrow=self.tomorrow)
self.assertEquals(self.output, result) self.assertEqual(self.output, result)
todo = self.todolist.todo(10) todo = self.todolist.todo(10)
self.assertFalse(todo.is_completed()) self.assertFalse(todo.is_completed())
...@@ -140,13 +140,13 @@ class DoCommandTest(CommandTest): ...@@ -140,13 +140,13 @@ class DoCommandTest(CommandTest):
def test_strict_recurrence1(self): def test_strict_recurrence1(self):
self._recurrence_helper(["-s", "8"]) self._recurrence_helper(["-s", "8"])
result = "| 10| {today} Strict due:2014-01-02 rec:1d\nCompleted: x {today} Strict due:2014-01-01 rec:1d\n".format(today=self.today) result = "| 10| {today} Strict due:2014-01-02 rec:1d\nCompleted: x {today} Strict due:2014-01-01 rec:1d\n".format(today=self.today)
self.assertEquals(self.output, result) self.assertEqual(self.output, result)
def test_strict_recurrence2(self): def test_strict_recurrence2(self):
self._recurrence_helper(["--strict", "8"]) self._recurrence_helper(["--strict", "8"])
result = "| 10| {today} Strict due:2014-01-02 rec:1d\nCompleted: x {today} Strict due:2014-01-01 rec:1d\n".format(today=self.today) result = "| 10| {today} Strict due:2014-01-02 rec:1d\nCompleted: x {today} Strict due:2014-01-01 rec:1d\n".format(today=self.today)
self.assertEquals(self.output, result) self.assertEqual(self.output, result)
def test_invalid1(self): def test_invalid1(self):
command = DoCommand(["99"], self.todolist, self.out, self.error) command = DoCommand(["99"], self.todolist, self.out, self.error)
...@@ -154,7 +154,7 @@ class DoCommandTest(CommandTest): ...@@ -154,7 +154,7 @@ class DoCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_invalid2(self): def test_invalid2(self):
command = DoCommand(["AAA"], self.todolist, self.out, self.error) command = DoCommand(["AAA"], self.todolist, self.out, self.error)
...@@ -162,7 +162,7 @@ class DoCommandTest(CommandTest): ...@@ -162,7 +162,7 @@ class DoCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_invalid3(self): def test_invalid3(self):
command = DoCommand(["01"], self.todolist, self.out, self.error, _yes_prompt) command = DoCommand(["01"], self.todolist, self.out, self.error, _yes_prompt)
...@@ -170,7 +170,7 @@ class DoCommandTest(CommandTest): ...@@ -170,7 +170,7 @@ class DoCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_activated_todos1(self): def test_activated_todos1(self):
command = DoCommand(["2"], self.todolist, self.out, self.error) command = DoCommand(["2"], self.todolist, self.out, self.error)
...@@ -178,30 +178,30 @@ class DoCommandTest(CommandTest): ...@@ -178,30 +178,30 @@ class DoCommandTest(CommandTest):
first_output = "Completed: x {} Bar p:1\n".format(self.today) first_output = "Completed: x {} Bar p:1\n".format(self.today)
self.assertEquals(self.output, first_output) self.assertEqual(self.output, first_output)
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
command = DoCommand(["3"], self.todolist, self.out, self.error) command = DoCommand(["3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, first_output + "Completed: x {} Baz p:1\nThe following todo item(s) became active:\n| 1| Foo id:1\n".format(self.today)) self.assertEqual(self.output, first_output + "Completed: x {} Baz p:1\nThe following todo item(s) became active:\n| 1| Foo id:1\n".format(self.today))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_activated_todos2(self): def test_activated_todos2(self):
command = DoCommand(["7"], self.todolist, self.out, self.error) command = DoCommand(["7"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "Completed: x {} Subtodo of inactive p:2\n".format(self.today)) self.assertEqual(self.output, "Completed: x {} Subtodo of inactive p:2\n".format(self.today))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_already_complete(self): def test_already_complete(self):
command = DoCommand(["5"], self.todolist, self.out, self.error) command = DoCommand(["5"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(5).completion_date(), date(2014, 10, 18)) self.assertEqual(self.todolist.todo(5).completion_date(), date(2014, 10, 18))
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Todo has already been completed.\n") self.assertEqual(self.errors, "Todo has already been completed.\n")
def test_do_regex1(self): def test_do_regex1(self):
command = DoCommand(["baz"], self.todolist, self.out, self.error) command = DoCommand(["baz"], self.todolist, self.out, self.error)
...@@ -209,40 +209,40 @@ class DoCommandTest(CommandTest): ...@@ -209,40 +209,40 @@ class DoCommandTest(CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(3).is_completed()) self.assertTrue(self.todolist.todo(3).is_completed())
self.assertEquals(self.output, "Completed: x {} Baz p:1\n".format(self.today)) self.assertEqual(self.output, "Completed: x {} Baz p:1\n".format(self.today))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date1(self): def test_do_custom_date1(self):
command = DoCommand(["-d", "2014-11-18", "3"], self.todolist, self.out, self.error) command = DoCommand(["-d", "2014-11-18", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Completed: x 2014-11-18 Baz p:1\n") self.assertEqual(self.output, "Completed: x 2014-11-18 Baz p:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date2(self): def test_do_custom_date2(self):
command = DoCommand(["-d", "2014-11-18", "1"], self.todolist, self.out, self.error, _yes_prompt) command = DoCommand(["-d", "2014-11-18", "1"], self.todolist, self.out, self.error, _yes_prompt)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x 2014-11-18 Bar p:1\nCompleted: x 2014-11-18 Baz p:1\nCompleted: x 2014-11-18 Foo id:1\n") self.assertEqual(self.output, "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x 2014-11-18 Bar p:1\nCompleted: x 2014-11-18 Baz p:1\nCompleted: x 2014-11-18 Foo id:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date3(self): def test_do_custom_date3(self):
command = DoCommand(["--date=2014-11-18", "3"], self.todolist, self.out, self.error) command = DoCommand(["--date=2014-11-18", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Completed: x 2014-11-18 Baz p:1\n") self.assertEqual(self.output, "Completed: x 2014-11-18 Baz p:1\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date4(self): def test_do_custom_date4(self):
command = DoCommand(["-d", "foo", "3"], self.todolist, self.out, self.error) command = DoCommand(["-d", "foo", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Completed: x {} Baz p:1\n".format(self.today)) self.assertEqual(self.output, "Completed: x {} Baz p:1\n".format(self.today))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date5(self): def test_do_custom_date5(self):
""" """
...@@ -253,8 +253,8 @@ class DoCommandTest(CommandTest): ...@@ -253,8 +253,8 @@ class DoCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 10| {today} Recurring! rec:1d due:{today}\nCompleted: x {yesterday} Recurring! rec:1d\n".format(today=self.today, yesterday=self.yesterday)) self.assertEqual(self.output, "| 10| {today} Recurring! rec:1d due:{today}\nCompleted: x {yesterday} Recurring! rec:1d\n".format(today=self.today, yesterday=self.yesterday))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date6(self): def test_do_custom_date6(self):
""" """
...@@ -266,8 +266,8 @@ class DoCommandTest(CommandTest): ...@@ -266,8 +266,8 @@ class DoCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 10| {today} Recurring! rec:1d due:{today}\nCompleted: x {yesterday} Recurring! rec:1d\n".format(today=self.today, yesterday=self.yesterday)) self.assertEqual(self.output, "| 10| {today} Recurring! rec:1d due:{today}\nCompleted: x {yesterday} Recurring! rec:1d\n".format(today=self.today, yesterday=self.yesterday))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_do_custom_date7(self): def test_do_custom_date7(self):
""" """
...@@ -278,8 +278,8 @@ class DoCommandTest(CommandTest): ...@@ -278,8 +278,8 @@ class DoCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 10| {today} Strict due:2014-01-02 rec:1d\nCompleted: x {yesterday} Strict due:2014-01-01 rec:1d\n".format(today=self.today, yesterday=self.yesterday)) self.assertEqual(self.output, "| 10| {today} Strict due:2014-01-02 rec:1d\nCompleted: x {yesterday} Strict due:2014-01-01 rec:1d\n".format(today=self.today, yesterday=self.yesterday))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_multi_do1(self): def test_multi_do1(self):
command = DoCommand(["1", "3"], self.todolist, self.out, self.error, _yes_prompt) command = DoCommand(["1", "3"], self.todolist, self.out, self.error, _yes_prompt)
...@@ -289,7 +289,7 @@ class DoCommandTest(CommandTest): ...@@ -289,7 +289,7 @@ class DoCommandTest(CommandTest):
self.assertTrue(self.todolist.todo(2).is_completed()) self.assertTrue(self.todolist.todo(2).is_completed())
self.assertTrue(self.todolist.todo(3).is_completed()) self.assertTrue(self.todolist.todo(3).is_completed())
self.assertEquals(self.output, "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x {today} Bar p:1\nCompleted: x {today} Baz p:1\nCompleted: x {today} Foo id:1\n".format(today=self.today)) self.assertEqual(self.output, "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x {today} Bar p:1\nCompleted: x {today} Baz p:1\nCompleted: x {today} Foo id:1\n".format(today=self.today))
def test_multi_do2(self): def test_multi_do2(self):
command = DoCommand(["1", "3"], self.todolist, self.out, self.error, _no_prompt) command = DoCommand(["1", "3"], self.todolist, self.out, self.error, _no_prompt)
...@@ -299,21 +299,21 @@ class DoCommandTest(CommandTest): ...@@ -299,21 +299,21 @@ class DoCommandTest(CommandTest):
self.assertFalse(self.todolist.todo(2).is_completed()) self.assertFalse(self.todolist.todo(2).is_completed())
self.assertTrue(self.todolist.todo(3).is_completed()) self.assertTrue(self.todolist.todo(3).is_completed())
self.assertEquals(self.output, "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x {today} Foo id:1\nCompleted: x {today} Baz p:1\n".format(today=self.today)) self.assertEqual(self.output, "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x {today} Foo id:1\nCompleted: x {today} Baz p:1\n".format(today=self.today))
def test_multi_do3(self): def test_multi_do3(self):
command = DoCommand(["3", "3"], self.todolist, self.out, self.error, _no_prompt) command = DoCommand(["3", "3"], self.todolist, self.out, self.error, _no_prompt)
command.execute() command.execute()
self.assertTrue(self.todolist.todo(3).is_completed()) self.assertTrue(self.todolist.todo(3).is_completed())
self.assertEquals(self.output, "Completed: x {} Baz p:1\n".format(self.today)) self.assertEqual(self.output, "Completed: x {} Baz p:1\n".format(self.today))
def test_multi_do4(self): def test_multi_do4(self):
command = DoCommand(["99", "3"], self.todolist, self.out, self.error, _no_prompt) command = DoCommand(["99", "3"], self.todolist, self.out, self.error, _no_prompt)
command.execute() command.execute()
self.assertFalse(self.todolist.todo(3).is_completed()) self.assertFalse(self.todolist.todo(3).is_completed())
self.assertEquals(self.errors, "Invalid todo number given: 99.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\n")
def test_multi_do5(self): def test_multi_do5(self):
""" """
...@@ -322,15 +322,15 @@ class DoCommandTest(CommandTest): ...@@ -322,15 +322,15 @@ class DoCommandTest(CommandTest):
command = DoCommand(["99", "10"], self.todolist, self.out, self.error, _no_prompt) command = DoCommand(["99", "10"], self.todolist, self.out, self.error, _no_prompt)
command.execute() command.execute()
self.assertEquals(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: 10.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: 10.\n")
def test_invalid_recurrence(self): def test_invalid_recurrence(self):
""" Show error message when an item has an invalid recurrence pattern. """ """ Show error message when an item has an invalid recurrence pattern. """
command = DoCommand(["9"], self.todolist, self.out, self.error, _no_prompt) command = DoCommand(["9"], self.todolist, self.out, self.error, _no_prompt)
command.execute() command.execute()
self.assertEquals(self.output, "Completed: x {} Invalid rec:1\n".format(self.today)) self.assertEqual(self.output, "Completed: x {} Invalid rec:1\n".format(self.today))
self.assertEquals(self.errors, "Warning: todo item has an invalid recurrence pattern.\n") self.assertEqual(self.errors, "Warning: todo item has an invalid recurrence pattern.\n")
def test_empty(self): def test_empty(self):
command = DoCommand([], self.todolist, self.out, self.error) command = DoCommand([], self.todolist, self.out, self.error)
...@@ -338,14 +338,14 @@ class DoCommandTest(CommandTest): ...@@ -338,14 +338,14 @@ class DoCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_help(self): def test_help(self):
command = DoCommand(["help"], self.todolist, self.out, self.error) command = DoCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -43,8 +43,8 @@ class EditCommandTest(CommandTest): ...@@ -43,8 +43,8 @@ class EditCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertEquals(str(self.todolist), "Bar p:1 @test\nBaz @test\nFoo id:1") self.assertEqual(str(self.todolist), "Bar p:1 @test\nBaz @test\nFoo id:1")
@mock.patch('topydo.lib.EditCommand.EditCommand._todos_from_temp') @mock.patch('topydo.lib.EditCommand.EditCommand._todos_from_temp')
@mock.patch('topydo.lib.EditCommand.EditCommand._open_in_editor') @mock.patch('topydo.lib.EditCommand.EditCommand._open_in_editor')
...@@ -57,8 +57,8 @@ class EditCommandTest(CommandTest): ...@@ -57,8 +57,8 @@ class EditCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertEquals(str(self.todolist), "Foo id:1\nBaz @test\nLazy Cat") self.assertEqual(str(self.todolist), "Foo id:1\nBaz @test\nLazy Cat")
def test_edit3(self): def test_edit3(self):
""" Throw an error after invalid todo number given as argument. """ """ Throw an error after invalid todo number given as argument. """
...@@ -66,7 +66,7 @@ class EditCommandTest(CommandTest): ...@@ -66,7 +66,7 @@ class EditCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_edit4(self): def test_edit4(self):
""" Throw an error with pointing invalid argument. """ """ Throw an error with pointing invalid argument. """
...@@ -74,7 +74,7 @@ class EditCommandTest(CommandTest): ...@@ -74,7 +74,7 @@ class EditCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.errors, "Invalid todo number given: 4.\n") self.assertEqual(self.errors, "Invalid todo number given: 4.\n")
@mock.patch('topydo.lib.EditCommand.EditCommand._todos_from_temp') @mock.patch('topydo.lib.EditCommand.EditCommand._todos_from_temp')
@mock.patch('topydo.lib.EditCommand.EditCommand._open_in_editor') @mock.patch('topydo.lib.EditCommand.EditCommand._open_in_editor')
...@@ -87,8 +87,8 @@ class EditCommandTest(CommandTest): ...@@ -87,8 +87,8 @@ class EditCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.errors, "Number of edited todos is not equal to number of supplied todo IDs.\n") self.assertEqual(self.errors, "Number of edited todos is not equal to number of supplied todo IDs.\n")
self.assertEquals(str(self.todolist), "Foo id:1\nBar p:1 @test\nBaz @test") self.assertEqual(str(self.todolist), "Foo id:1\nBar p:1 @test\nBaz @test")
@mock.patch('topydo.lib.EditCommand.EditCommand._todos_from_temp') @mock.patch('topydo.lib.EditCommand.EditCommand._todos_from_temp')
@mock.patch('topydo.lib.EditCommand.EditCommand._open_in_editor') @mock.patch('topydo.lib.EditCommand.EditCommand._open_in_editor')
...@@ -101,8 +101,8 @@ class EditCommandTest(CommandTest): ...@@ -101,8 +101,8 @@ class EditCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertEquals(str(self.todolist), "Foo id:1\nLazy Cat\nLazy Dog") self.assertEqual(str(self.todolist), "Foo id:1\nLazy Cat\nLazy Dog")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -30,7 +30,7 @@ class FilterTest(TopydoTest): ...@@ -30,7 +30,7 @@ class FilterTest(TopydoTest):
relevance = Filter.RelevanceFilter() relevance = Filter.RelevanceFilter()
result = relevance.filter([todo]) result = relevance.filter([todo])
self.assertEquals(result, [todo]) self.assertEqual(result, [todo])
def test_filter4(self): def test_filter4(self):
""" Test case insensitive match. """ """ Test case insensitive match. """
...@@ -40,7 +40,7 @@ class FilterTest(TopydoTest): ...@@ -40,7 +40,7 @@ class FilterTest(TopydoTest):
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
reference = load_file('test/data/FilterTest1a-result.txt') reference = load_file('test/data/FilterTest1a-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter5(self): def test_filter5(self):
...@@ -51,7 +51,7 @@ class FilterTest(TopydoTest): ...@@ -51,7 +51,7 @@ class FilterTest(TopydoTest):
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
reference = load_file('test/data/FilterTest1b-result.txt') reference = load_file('test/data/FilterTest1b-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter6(self): def test_filter6(self):
...@@ -62,7 +62,7 @@ class FilterTest(TopydoTest): ...@@ -62,7 +62,7 @@ class FilterTest(TopydoTest):
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
reference = load_file('test/data/FilterTest1c-result.txt') reference = load_file('test/data/FilterTest1c-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter7(self): def test_filter7(self):
...@@ -73,7 +73,7 @@ class FilterTest(TopydoTest): ...@@ -73,7 +73,7 @@ class FilterTest(TopydoTest):
filtered_todos = depfilter.filter(todolist.todos()) filtered_todos = depfilter.filter(todolist.todos())
reference = load_file('test/data/FilterTest2-result.txt') reference = load_file('test/data/FilterTest2-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter8(self): def test_filter8(self):
...@@ -84,7 +84,7 @@ class FilterTest(TopydoTest): ...@@ -84,7 +84,7 @@ class FilterTest(TopydoTest):
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
reference = load_file('test/data/FilterTest1a-result.txt') reference = load_file('test/data/FilterTest1a-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter9(self): def test_filter9(self):
...@@ -94,7 +94,7 @@ class FilterTest(TopydoTest): ...@@ -94,7 +94,7 @@ class FilterTest(TopydoTest):
filtered_todos = instance_filter.filter(todos) filtered_todos = instance_filter.filter(todos)
self.assertEquals(todos[2:], filtered_todos) self.assertEqual(todos[2:], filtered_todos)
def test_filter10(self): def test_filter10(self):
""" Test instance filter """ """ Test instance filter """
...@@ -103,7 +103,7 @@ class FilterTest(TopydoTest): ...@@ -103,7 +103,7 @@ class FilterTest(TopydoTest):
filtered_todos = instance_filter.filter(todos) filtered_todos = instance_filter.filter(todos)
self.assertEquals([], filtered_todos) self.assertEqual([], filtered_todos)
def test_filter11(self): def test_filter11(self):
""" Test instance filter """ """ Test instance filter """
...@@ -112,7 +112,7 @@ class FilterTest(TopydoTest): ...@@ -112,7 +112,7 @@ class FilterTest(TopydoTest):
filtered_todos = instance_filter.filter([]) filtered_todos = instance_filter.filter([])
self.assertEquals([], filtered_todos) self.assertEqual([], filtered_todos)
def test_filter12(self): def test_filter12(self):
""" Test limit filter. """ """ Test limit filter. """
...@@ -121,7 +121,7 @@ class FilterTest(TopydoTest): ...@@ -121,7 +121,7 @@ class FilterTest(TopydoTest):
filtered_todos = limit_filter.filter(todos) filtered_todos = limit_filter.filter(todos)
self.assertEquals([], filtered_todos) self.assertEqual([], filtered_todos)
def test_filter13(self): def test_filter13(self):
""" Test limit filter. """ """ Test limit filter. """
...@@ -130,8 +130,8 @@ class FilterTest(TopydoTest): ...@@ -130,8 +130,8 @@ class FilterTest(TopydoTest):
filtered_todos = limit_filter.filter(todos) filtered_todos = limit_filter.filter(todos)
self.assertEquals(len(filtered_todos), 1) self.assertEqual(len(filtered_todos), 1)
self.assertEquals(filtered_todos[0].source(), '(C) This is part of some +Project') self.assertEqual(filtered_todos[0].source(), '(C) This is part of some +Project')
def test_filter14(self): def test_filter14(self):
""" Test limit filter. """ """ Test limit filter. """
...@@ -140,7 +140,7 @@ class FilterTest(TopydoTest): ...@@ -140,7 +140,7 @@ class FilterTest(TopydoTest):
filtered_todos = limit_filter.filter(todos) filtered_todos = limit_filter.filter(todos)
self.assertEquals(todos, filtered_todos) self.assertEqual(todos, filtered_todos)
def test_filter15(self): def test_filter15(self):
""" Test limit filter. """ """ Test limit filter. """
...@@ -149,7 +149,7 @@ class FilterTest(TopydoTest): ...@@ -149,7 +149,7 @@ class FilterTest(TopydoTest):
filtered_todos = limit_filter.filter(todos) filtered_todos = limit_filter.filter(todos)
self.assertEquals(len(filtered_todos), 4) self.assertEqual(len(filtered_todos), 4)
def test_filter16(self): def test_filter16(self):
todos = load_file('test/data/FilterTest1.txt') todos = load_file('test/data/FilterTest1.txt')
...@@ -158,7 +158,7 @@ class FilterTest(TopydoTest): ...@@ -158,7 +158,7 @@ class FilterTest(TopydoTest):
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
reference = load_file('test/data/FilterTest3-result.txt') reference = load_file('test/data/FilterTest3-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter17(self): def test_filter17(self):
...@@ -170,7 +170,7 @@ class FilterTest(TopydoTest): ...@@ -170,7 +170,7 @@ class FilterTest(TopydoTest):
filtered_todos = andfilter.filter(todos) filtered_todos = andfilter.filter(todos)
reference = load_file('test/data/FilterTest4-result.txt') reference = load_file('test/data/FilterTest4-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter18(self): def test_filter18(self):
...@@ -182,7 +182,7 @@ class FilterTest(TopydoTest): ...@@ -182,7 +182,7 @@ class FilterTest(TopydoTest):
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
reference = load_file('test/data/FilterTest5-result.txt') reference = load_file('test/data/FilterTest5-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter19(self): def test_filter19(self):
...@@ -190,7 +190,7 @@ class FilterTest(TopydoTest): ...@@ -190,7 +190,7 @@ class FilterTest(TopydoTest):
grep = Filter.GrepFilter(1) grep = Filter.GrepFilter(1)
filtered_todos = grep.filter(todos) filtered_todos = grep.filter(todos)
self.assertEquals(filtered_todos, []) self.assertEqual(filtered_todos, [])
def test_filter20(self): def test_filter20(self):
todos = load_file('test/data/FilterTest3.txt') todos = load_file('test/data/FilterTest3.txt')
...@@ -199,7 +199,7 @@ class FilterTest(TopydoTest): ...@@ -199,7 +199,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest6-result.txt') reference = load_file('test/data/FilterTest6-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), \ self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter21(self): def test_filter21(self):
...@@ -208,7 +208,7 @@ class FilterTest(TopydoTest): ...@@ -208,7 +208,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
self.assertEquals(todolist_to_string(filtered_todos), "") self.assertEqual(todolist_to_string(filtered_todos), "")
def test_filter22(self): def test_filter22(self):
todos = load_file('test/data/FilterTest3.txt') todos = load_file('test/data/FilterTest3.txt')
...@@ -216,7 +216,7 @@ class FilterTest(TopydoTest): ...@@ -216,7 +216,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
self.assertEquals(todolist_to_string(filtered_todos), "") self.assertEqual(todolist_to_string(filtered_todos), "")
def test_filter23(self): def test_filter23(self):
todos = load_file('test/data/FilterTest3.txt') todos = load_file('test/data/FilterTest3.txt')
...@@ -224,7 +224,7 @@ class FilterTest(TopydoTest): ...@@ -224,7 +224,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
self.assertEquals(todolist_to_string(filtered_todos), "") self.assertEqual(todolist_to_string(filtered_todos), "")
def test_filter24(self): def test_filter24(self):
todos = load_file('test/data/FilterTest3.txt') todos = load_file('test/data/FilterTest3.txt')
...@@ -232,7 +232,7 @@ class FilterTest(TopydoTest): ...@@ -232,7 +232,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
self.assertEquals(todolist_to_string(filtered_todos), "") self.assertEqual(todolist_to_string(filtered_todos), "")
def test_filter25(self): def test_filter25(self):
todos = load_file('test/data/FilterTest3.txt') todos = load_file('test/data/FilterTest3.txt')
...@@ -241,7 +241,7 @@ class FilterTest(TopydoTest): ...@@ -241,7 +241,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest8-result.txt') reference = load_file('test/data/FilterTest8-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), self.assertEqual(todolist_to_string(filtered_todos),
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter26(self): def test_filter26(self):
...@@ -251,7 +251,7 @@ class FilterTest(TopydoTest): ...@@ -251,7 +251,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest9-result.txt') reference = load_file('test/data/FilterTest9-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), self.assertEqual(todolist_to_string(filtered_todos),
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter27(self): def test_filter27(self):
...@@ -261,7 +261,7 @@ class FilterTest(TopydoTest): ...@@ -261,7 +261,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest10-result.txt') reference = load_file('test/data/FilterTest10-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), self.assertEqual(todolist_to_string(filtered_todos),
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter28(self): def test_filter28(self):
...@@ -270,7 +270,7 @@ class FilterTest(TopydoTest): ...@@ -270,7 +270,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
self.assertEquals(todolist_to_string(filtered_todos), "") self.assertEqual(todolist_to_string(filtered_todos), "")
def test_filter29(self): def test_filter29(self):
todos = load_file('test/data/FilterTest3.txt') todos = load_file('test/data/FilterTest3.txt')
...@@ -279,7 +279,7 @@ class FilterTest(TopydoTest): ...@@ -279,7 +279,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest11-result.txt') reference = load_file('test/data/FilterTest11-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), self.assertEqual(todolist_to_string(filtered_todos),
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter30(self): def test_filter30(self):
...@@ -289,7 +289,7 @@ class FilterTest(TopydoTest): ...@@ -289,7 +289,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest12-result.txt') reference = load_file('test/data/FilterTest12-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), self.assertEqual(todolist_to_string(filtered_todos),
todolist_to_string(reference)) todolist_to_string(reference))
def test_filter31(self): def test_filter31(self):
...@@ -299,7 +299,7 @@ class FilterTest(TopydoTest): ...@@ -299,7 +299,7 @@ class FilterTest(TopydoTest):
filtered_todos = otf.filter(todos) filtered_todos = otf.filter(todos)
reference = load_file('test/data/FilterTest13-result.txt') reference = load_file('test/data/FilterTest13-result.txt')
self.assertEquals(todolist_to_string(filtered_todos), self.assertEqual(todolist_to_string(filtered_todos),
todolist_to_string(reference)) todolist_to_string(reference))
class OrdinalTagFilterTest(TopydoTest): class OrdinalTagFilterTest(TopydoTest):
...@@ -329,41 +329,41 @@ class OrdinalTagFilterTest(TopydoTest): ...@@ -329,41 +329,41 @@ class OrdinalTagFilterTest(TopydoTest):
result = otf.filter(self.todos) result = otf.filter(self.todos)
self.assertEquals(len(result), 1) self.assertEqual(len(result), 1)
self.assertEquals(str(result[0]), self.todo1) self.assertEqual(str(result[0]), self.todo1)
def test_filter2(self): def test_filter2(self):
otf = Filter.OrdinalTagFilter('due:=today') otf = Filter.OrdinalTagFilter('due:=today')
result = otf.filter(self.todos) result = otf.filter(self.todos)
self.assertEquals(len(result), 1) self.assertEqual(len(result), 1)
self.assertEquals(str(result[0]), self.todo1) self.assertEqual(str(result[0]), self.todo1)
def test_filter3(self): def test_filter3(self):
otf = Filter.OrdinalTagFilter('due:>today') otf = Filter.OrdinalTagFilter('due:>today')
result = otf.filter(self.todos) result = otf.filter(self.todos)
self.assertEquals(len(result), 1) self.assertEqual(len(result), 1)
self.assertEquals(str(result[0]), self.todo2) self.assertEqual(str(result[0]), self.todo2)
def test_filter4(self): def test_filter4(self):
otf = Filter.OrdinalTagFilter('due:<1w') otf = Filter.OrdinalTagFilter('due:<1w')
result = otf.filter(self.todos) result = otf.filter(self.todos)
self.assertEquals(len(result), 2) self.assertEqual(len(result), 2)
self.assertEquals(str(result[0]), self.todo1) self.assertEqual(str(result[0]), self.todo1)
self.assertEquals(str(result[1]), self.todo2) self.assertEqual(str(result[1]), self.todo2)
def test_filter5(self): def test_filter5(self):
otf = Filter.OrdinalTagFilter('due:!today') otf = Filter.OrdinalTagFilter('due:!today')
result = otf.filter(self.todos) result = otf.filter(self.todos)
self.assertEquals(len(result), 1) self.assertEqual(len(result), 1)
self.assertEquals(str(result[0]), self.todo2) self.assertEqual(str(result[0]), self.todo2)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
......
...@@ -51,34 +51,34 @@ class GraphTest(TopydoTest): ...@@ -51,34 +51,34 @@ class GraphTest(TopydoTest):
self.assertFalse(self.graph.has_edge_id("1")) self.assertFalse(self.graph.has_edge_id("1"))
def test_incoming_neighbors1(self): def test_incoming_neighbors1(self):
self.assertEquals(self.graph.incoming_neighbors(1), set()) self.assertEqual(self.graph.incoming_neighbors(1), set())
def test_edge_id_of_nonexistent_edge(self): def test_edge_id_of_nonexistent_edge(self):
self.assertFalse(self.graph.edge_id(1, 6)) self.assertFalse(self.graph.edge_id(1, 6))
def test_incoming_neighbors2(self): def test_incoming_neighbors2(self):
self.assertEquals(self.graph.incoming_neighbors(2), set([1, 6])) self.assertEqual(self.graph.incoming_neighbors(2), set([1, 6]))
def test_incoming_neighbors3(self): def test_incoming_neighbors3(self):
self.assertEquals(self.graph.incoming_neighbors(1, True), set()) self.assertEqual(self.graph.incoming_neighbors(1, True), set())
def test_incoming_neighbors4(self): def test_incoming_neighbors4(self):
self.assertEquals(self.graph.incoming_neighbors(5, True), set([1, 2, 3, 4, 6])) self.assertEqual(self.graph.incoming_neighbors(5, True), set([1, 2, 3, 4, 6]))
def test_outgoing_neighbors1(self): def test_outgoing_neighbors1(self):
self.assertEquals(self.graph.outgoing_neighbors(1), set([2, 3])) self.assertEqual(self.graph.outgoing_neighbors(1), set([2, 3]))
def test_outgoing_neighbors2(self): def test_outgoing_neighbors2(self):
self.assertEquals(self.graph.outgoing_neighbors(2), set([4])) self.assertEqual(self.graph.outgoing_neighbors(2), set([4]))
def test_outgoing_neighbors3(self): def test_outgoing_neighbors3(self):
self.assertEquals(self.graph.outgoing_neighbors(1, True), set([2, 3, 4, 5, 6])) self.assertEqual(self.graph.outgoing_neighbors(1, True), set([2, 3, 4, 5, 6]))
def test_outgoing_neighbors4(self): def test_outgoing_neighbors4(self):
self.assertEquals(self.graph.outgoing_neighbors(3), set([5])) self.assertEqual(self.graph.outgoing_neighbors(3), set([5]))
def test_outgoing_neighbors5(self): def test_outgoing_neighbors5(self):
self.assertEquals(self.graph.outgoing_neighbors(5), set([])) self.assertEqual(self.graph.outgoing_neighbors(5), set([]))
def test_remove_edge1(self): def test_remove_edge1(self):
self.graph.remove_edge(1, 2) self.graph.remove_edge(1, 2)
...@@ -165,11 +165,11 @@ class GraphTest(TopydoTest): ...@@ -165,11 +165,11 @@ class GraphTest(TopydoTest):
def test_str_output(self): def test_str_output(self):
out = 'digraph g {\n 1\n 1 -> 2 [label="1"]\n 1 -> 3\n 2\n 2 -> 4 [label="Test"]\n 3\n 3 -> 5\n 4\n 4 -> 3\n 4 -> 6\n 5\n 6\n 6 -> 2\n}\n' out = 'digraph g {\n 1\n 1 -> 2 [label="1"]\n 1 -> 3\n 2\n 2 -> 4 [label="Test"]\n 3\n 3 -> 5\n 4\n 4 -> 3\n 4 -> 6\n 5\n 6\n 6 -> 2\n}\n'
self.assertEquals(str(self.graph), out) self.assertEqual(str(self.graph), out)
def test_dot_output_without_labels(self): def test_dot_output_without_labels(self):
out = 'digraph g {\n 1\n 1 -> 2\n 1 -> 3\n 2\n 2 -> 4\n 3\n 3 -> 5\n 4\n 4 -> 3\n 4 -> 6\n 5\n 6\n 6 -> 2\n}\n' out = 'digraph g {\n 1\n 1 -> 2\n 1 -> 3\n 2\n 2 -> 4\n 3\n 3 -> 5\n 4\n 4 -> 3\n 4 -> 6\n 5\n 6\n 6 -> 2\n}\n'
self.assertEquals(self.graph.dot(False), out) self.assertEqual(self.graph.dot(False), out)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -44,15 +44,15 @@ class IcalCommandTest(CommandTest): ...@@ -44,15 +44,15 @@ class IcalCommandTest(CommandTest):
with open('test/data/ListCommandTest.ics', 'r') as ical: with open('test/data/ListCommandTest.ics', 'r') as ical:
icaltext = "".join(ical.readlines()) icaltext = "".join(ical.readlines())
self.assertEquals(replace_ical_tags(self.output), replace_ical_tags(icaltext)) self.assertEqual(replace_ical_tags(self.output), replace_ical_tags(icaltext))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_help(self): def test_help(self):
command = IcalCommand(["help"], self.todolist, self.out, self.error) command = IcalCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -31,72 +31,72 @@ class ListCommandTest(CommandTest): ...@@ -31,72 +31,72 @@ class ListCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list3(self): def test_list3(self):
command = ListCommand(["Context1"], self.todolist, self.out, self.error) command = ListCommand(["Context1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list4(self): def test_list4(self):
command = ListCommand(["-x", "Context1"], self.todolist, self.out, self.error) command = ListCommand(["-x", "Context1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list5(self): def test_list5(self):
command = ListCommand(["-x"], self.todolist, self.out, self.error) command = ListCommand(["-x"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n| 6| x 2014-12-12 Completed but with date:2014-12-12\n") self.assertEqual(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n| 6| x 2014-12-12 Completed but with date:2014-12-12\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list6(self): def test_list6(self):
command = ListCommand(["Project3"], self.todolist, self.out, self.error) command = ListCommand(["Project3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list7(self): def test_list7(self):
command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist, self.out, self.error) command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n") self.assertEqual(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list8(self): def test_list8(self):
command = ListCommand(["--", "-project1"], self.todolist, self.out, self.error) command = ListCommand(["--", "-project1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list9(self): def test_list9(self):
command = ListCommand(["--", "-project1", "-Drink"], self.todolist, self.out, self.error) command = ListCommand(["--", "-project1", "-Drink"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list10(self): def test_list10(self):
command = ListCommand(["text1", "2"], self.todolist, self.out, self.error) command = ListCommand(["text1", "2"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list11(self): def test_list11(self):
config("test/data/listcommand.conf") config("test/data/listcommand.conf")
...@@ -105,8 +105,8 @@ class ListCommandTest(CommandTest): ...@@ -105,8 +105,8 @@ class ListCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n") self.assertEqual(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list12(self): def test_list12(self):
config("test/data/listcommand.conf") config("test/data/listcommand.conf")
...@@ -115,16 +115,16 @@ class ListCommandTest(CommandTest): ...@@ -115,16 +115,16 @@ class ListCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value\n| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list13(self): def test_list13(self):
command = ListCommand(["-x", "--", "-@Context1 +Project2"], self.todolist, self.out, self.error) command = ListCommand(["-x", "--", "-@Context1 +Project2"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 6| x 2014-12-12 Completed but with date:2014-12-12\n") self.assertEqual(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 6| x 2014-12-12 Completed but with date:2014-12-12\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list14(self): def test_list14(self):
config("test/data/listcommand2.conf") config("test/data/listcommand2.conf")
...@@ -133,16 +133,16 @@ class ListCommandTest(CommandTest): ...@@ -133,16 +133,16 @@ class ListCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " | 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n | 4| (C) Drink beer @ home\n | 5| (C) 13 + 29 = 42\n | 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, " | 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n | 4| (C) Drink beer @ home\n | 5| (C) 13 + 29 = 42\n | 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list15(self): def test_list15(self):
command = ListCommand(["p:<10"], self.todolist, self.out, self.error) command = ListCommand(["p:<10"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "| 2| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list16(self): def test_list16(self):
config("test/data/todolist-uid.conf") config("test/data/todolist-uid.conf")
...@@ -151,23 +151,23 @@ class ListCommandTest(CommandTest): ...@@ -151,23 +151,23 @@ class ListCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "|t5c| (C) Foo @Context2 Not@Context +Project1 Not+Project\n|wa5| (C) Drink beer @ home\n|z63| (C) 13 + 29 = 42\n|mfg| (D) Bar @Context1 +Project2\n") self.assertEqual(self.output, "|t5c| (C) Foo @Context2 Not@Context +Project1 Not+Project\n|wa5| (C) Drink beer @ home\n|z63| (C) 13 + 29 = 42\n|mfg| (D) Bar @Context1 +Project2\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list17(self): def test_list17(self):
command = ListCommand(["-x", "id:"], self.todolist, self.out, self.error) command = ListCommand(["-x", "id:"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n") self.assertEqual(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_list18(self): def test_list18(self):
command = ListCommand(["-x", "date:2014-12-12"], self.todolist, self.out, self.error) command = ListCommand(["-x", "date:2014-12-12"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 6| x 2014-12-12 Completed but with date:2014-12-12\n") self.assertEqual(self.output, "| 6| x 2014-12-12 Completed but with date:2014-12-12\n")
def test_list19(self): def test_list19(self):
""" Force showing all tags. """ """ Force showing all tags. """
...@@ -177,15 +177,15 @@ class ListCommandTest(CommandTest): ...@@ -177,15 +177,15 @@ class ListCommandTest(CommandTest):
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| (C) Baz @Context1 +Project1 key:value id:1\n| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n") self.assertEqual(self.output, "| 3| (C) Baz @Context1 +Project1 key:value id:1\n| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_help(self): def test_help(self):
command = ListCommand(["help"], self.todolist, self.out, self.error) command = ListCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -26,7 +26,7 @@ class ListContextCommandTest(CommandTest): ...@@ -26,7 +26,7 @@ class ListContextCommandTest(CommandTest):
command = ListContextCommand([""], todolist, self.out, self.error) command = ListContextCommand([""], todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output,"Context1\nContext2\n") self.assertEqual(self.output,"Context1\nContext2\n")
self.assertFalse(self.errors) self.assertFalse(self.errors)
def test_contexts2(self): def test_contexts2(self):
...@@ -34,15 +34,15 @@ class ListContextCommandTest(CommandTest): ...@@ -34,15 +34,15 @@ class ListContextCommandTest(CommandTest):
command = ListContextCommand(["aaa"], todolist, self.out, self.error) command = ListContextCommand(["aaa"], todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output,"Context1\nContext2\n") self.assertEqual(self.output,"Context1\nContext2\n")
self.assertFalse(self.errors) self.assertFalse(self.errors)
def test_help(self): def test_help(self):
command = ListContextCommand(["help"], None, self.out, self.error) command = ListContextCommand(["help"], None, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -26,7 +26,7 @@ class ListProjectCommandTest(CommandTest): ...@@ -26,7 +26,7 @@ class ListProjectCommandTest(CommandTest):
command = ListProjectCommand([""], todolist, self.out, self.error) command = ListProjectCommand([""], todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "Project1\nProject2\n") self.assertEqual(self.output, "Project1\nProject2\n")
self.assertFalse(self.errors) self.assertFalse(self.errors)
def test_projects2(self): def test_projects2(self):
...@@ -34,15 +34,15 @@ class ListProjectCommandTest(CommandTest): ...@@ -34,15 +34,15 @@ class ListProjectCommandTest(CommandTest):
command = ListProjectCommand(["aaa"], todolist, self.out, self.error) command = ListProjectCommand(["aaa"], todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "Project1\nProject2\n") self.assertEqual(self.output, "Project1\nProject2\n")
self.assertFalse(self.errors) self.assertFalse(self.errors)
def test_help(self): def test_help(self):
command = ListProjectCommand(["help"], None, self.out, self.error) command = ListProjectCommand(["help"], None, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -47,8 +47,8 @@ class PostponeCommandTest(CommandTest): ...@@ -47,8 +47,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| Foo due:{}\n".format(due.isoformat())) self.assertEqual(self.output, "| 1| Foo due:{}\n".format(due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone2(self): def test_postpone2(self):
command = PostponeCommand(["2", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["2", "1w"], self.todolist, self.out, self.error)
...@@ -57,8 +57,8 @@ class PostponeCommandTest(CommandTest): ...@@ -57,8 +57,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| Bar due:{}\n".format(due.isoformat())) self.assertEqual(self.output, "| 2| Bar due:{}\n".format(due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone3(self): def test_postpone3(self):
command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out, self.error)
...@@ -67,8 +67,8 @@ class PostponeCommandTest(CommandTest): ...@@ -67,8 +67,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| Bar due:{}\n".format(due.isoformat())) self.assertEqual(self.output, "| 2| Bar due:{}\n".format(due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone4(self): def test_postpone4(self):
command = PostponeCommand(["3", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["3", "1w"], self.todolist, self.out, self.error)
...@@ -77,8 +77,8 @@ class PostponeCommandTest(CommandTest): ...@@ -77,8 +77,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), self.start.isoformat())) self.assertEqual(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), self.start.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone5(self): def test_postpone5(self):
command = PostponeCommand(["-s", "3", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["-s", "3", "1w"], self.todolist, self.out, self.error)
...@@ -88,8 +88,8 @@ class PostponeCommandTest(CommandTest): ...@@ -88,8 +88,8 @@ class PostponeCommandTest(CommandTest):
start = self.start + timedelta(7) start = self.start + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), start.isoformat())) self.assertEqual(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone6(self): def test_postpone6(self):
command = PostponeCommand(["4", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["4", "1w"], self.todolist, self.out, self.error)
...@@ -98,8 +98,8 @@ class PostponeCommandTest(CommandTest): ...@@ -98,8 +98,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 4| Past due:{}\n".format(due.isoformat())) self.assertEqual(self.output, "| 4| Past due:{}\n".format(due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone7(self): def test_postpone7(self):
command = PostponeCommand(["5", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["5", "1w"], self.todolist, self.out, self.error)
...@@ -108,8 +108,8 @@ class PostponeCommandTest(CommandTest): ...@@ -108,8 +108,8 @@ class PostponeCommandTest(CommandTest):
due = self.future + timedelta(7) due = self.future + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), self.future_start.isoformat())) self.assertEqual(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), self.future_start.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone8(self): def test_postpone8(self):
command = PostponeCommand(["-s", "5", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["-s", "5", "1w"], self.todolist, self.out, self.error)
...@@ -119,40 +119,40 @@ class PostponeCommandTest(CommandTest): ...@@ -119,40 +119,40 @@ class PostponeCommandTest(CommandTest):
start = self.future_start + timedelta(7) start = self.future_start + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), start.isoformat())) self.assertEqual(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone9(self): def test_postpone9(self):
command = PostponeCommand(["1", "foo"], self.todolist, self.out, self.error) command = PostponeCommand(["1", "foo"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid date pattern given.\n") self.assertEqual(self.errors, "Invalid date pattern given.\n")
def test_postpone10(self): def test_postpone10(self):
command = PostponeCommand(["99", "foo"], self.todolist, self.out, self.error) command = PostponeCommand(["99", "foo"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_postpone11(self): def test_postpone11(self):
command = PostponeCommand(["A", "foo"], self.todolist, self.out, self.error) command = PostponeCommand(["A", "foo"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_postpone12(self): def test_postpone12(self):
command = PostponeCommand(["1"], self.todolist, self.out, self.error) command = PostponeCommand(["1"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_postpone13(self): def test_postpone13(self):
command = PostponeCommand(["Foo", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["Foo", "1w"], self.todolist, self.out, self.error)
...@@ -161,8 +161,8 @@ class PostponeCommandTest(CommandTest): ...@@ -161,8 +161,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| Foo due:{}\n".format(due.isoformat())) self.assertEqual(self.output, "| 1| Foo due:{}\n".format(due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone14(self): def test_postpone14(self):
command = PostponeCommand(["1", "2", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["1", "2", "1w"], self.todolist, self.out, self.error)
...@@ -171,8 +171,8 @@ class PostponeCommandTest(CommandTest): ...@@ -171,8 +171,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| Foo due:{}\n| 2| Bar due:{}\n".format(due.isoformat(), due.isoformat())) self.assertEqual(self.output, "| 1| Foo due:{}\n| 2| Bar due:{}\n".format(due.isoformat(), due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone15(self): def test_postpone15(self):
command = PostponeCommand(["Foo", "2", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["Foo", "2", "1w"], self.todolist, self.out, self.error)
...@@ -181,8 +181,8 @@ class PostponeCommandTest(CommandTest): ...@@ -181,8 +181,8 @@ class PostponeCommandTest(CommandTest):
due = self.today + timedelta(7) due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| Foo due:{}\n| 2| Bar due:{}\n".format(due.isoformat(), due.isoformat())) self.assertEqual(self.output, "| 1| Foo due:{}\n| 2| Bar due:{}\n".format(due.isoformat(), due.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone16(self): def test_postpone16(self):
command = PostponeCommand(["-s", "2", "3", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["-s", "2", "3", "1w"], self.todolist, self.out, self.error)
...@@ -192,39 +192,39 @@ class PostponeCommandTest(CommandTest): ...@@ -192,39 +192,39 @@ class PostponeCommandTest(CommandTest):
start = self.start + timedelta(7) start = self.start + timedelta(7)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| Bar due:{}\n| 3| Baz due:{} t:{}\n".format(due.isoformat(), due.isoformat(), start.isoformat())) self.assertEqual(self.output, "| 2| Bar due:{}\n| 3| Baz due:{} t:{}\n".format(due.isoformat(), due.isoformat(), start.isoformat()))
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_postpone17(self): def test_postpone17(self):
command = PostponeCommand(["1", "2", "3"], self.todolist, self.out, self.error) command = PostponeCommand(["1", "2", "3"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid date pattern given.\n") self.assertEqual(self.errors, "Invalid date pattern given.\n")
def test_postpone18(self): def test_postpone18(self):
command = PostponeCommand(["1", "99", "123", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["1", "99", "123", "1w"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: 123.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: 123.\n")
def test_postpone19(self): def test_postpone19(self):
command = PostponeCommand(["Zoo", "99", "123", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["Zoo", "99", "123", "1w"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number given: Zoo.\nInvalid todo number given: 99.\nInvalid todo number given: 123.\n") self.assertEqual(self.errors, "Invalid todo number given: Zoo.\nInvalid todo number given: 99.\nInvalid todo number given: 123.\n")
def test_help(self): def test_help(self):
command = PostponeCommand(["help"], self.todolist, self.out, self.error) command = PostponeCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
......
...@@ -35,40 +35,40 @@ class PriorityCommandTest(CommandTest): ...@@ -35,40 +35,40 @@ class PriorityCommandTest(CommandTest):
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Priority changed from A to B\n| 1| (B) Foo\n") self.assertEqual(self.output, "Priority changed from A to B\n| 1| (B) Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_prio2(self): def test_set_prio2(self):
command = PriorityCommand(["2", "Z"], self.todolist, self.out, self.error) command = PriorityCommand(["2", "Z"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Priority set to Z.\n| 2| (Z) Bar\n") self.assertEqual(self.output, "Priority set to Z.\n| 2| (Z) Bar\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_prio3(self): def test_set_prio3(self):
command = PriorityCommand(["Foo", "B"], self.todolist, self.out, self.error) command = PriorityCommand(["Foo", "B"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Priority changed from A to B\n| 1| (B) Foo\n") self.assertEqual(self.output, "Priority changed from A to B\n| 1| (B) Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_prio4(self): def test_set_prio4(self):
command = PriorityCommand(["1", "A"], self.todolist, self.out, self.error) command = PriorityCommand(["1", "A"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| (A) Foo\n") self.assertEqual(self.output, "| 1| (A) Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_prio5(self): def test_set_prio5(self):
command = PriorityCommand(["Foo", "2", "C"], self.todolist, self.out, self.error) command = PriorityCommand(["Foo", "2", "C"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "Priority changed from A to C\n| 1| (C) Foo\nPriority set to C.\n| 2| (C) Bar\n") self.assertEqual(self.output, "Priority changed from A to C\n| 1| (C) Foo\nPriority set to C.\n| 2| (C) Bar\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_invalid1(self): def test_invalid1(self):
command = PriorityCommand(["99", "A"], self.todolist, self.out, self.error) command = PriorityCommand(["99", "A"], self.todolist, self.out, self.error)
...@@ -76,7 +76,7 @@ class PriorityCommandTest(CommandTest): ...@@ -76,7 +76,7 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given.\n") self.assertEqual(self.errors, "Invalid todo number given.\n")
def test_invalid2(self): def test_invalid2(self):
command = PriorityCommand(["1", "99", "A"], self.todolist, self.out, self.error) command = PriorityCommand(["1", "99", "A"], self.todolist, self.out, self.error)
...@@ -84,7 +84,7 @@ class PriorityCommandTest(CommandTest): ...@@ -84,7 +84,7 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given: 99.\n") self.assertEqual(self.errors, "Invalid todo number given: 99.\n")
def test_invalid3(self): def test_invalid3(self):
command = PriorityCommand(["98", "99", "A"], self.todolist, self.out, self.error) command = PriorityCommand(["98", "99", "A"], self.todolist, self.out, self.error)
...@@ -92,7 +92,7 @@ class PriorityCommandTest(CommandTest): ...@@ -92,7 +92,7 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number given: 98.\nInvalid todo number given: 99.\n") self.assertEqual(self.errors, "Invalid todo number given: 98.\nInvalid todo number given: 99.\n")
def test_invalid4(self): def test_invalid4(self):
command = PriorityCommand(["1", "ZZ"], self.todolist, self.out, self.error) command = PriorityCommand(["1", "ZZ"], self.todolist, self.out, self.error)
...@@ -100,7 +100,7 @@ class PriorityCommandTest(CommandTest): ...@@ -100,7 +100,7 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid priority given.\n") self.assertEqual(self.errors, "Invalid priority given.\n")
def test_invalid5(self): def test_invalid5(self):
command = PriorityCommand(["A"], self.todolist, self.out, self.error) command = PriorityCommand(["A"], self.todolist, self.out, self.error)
...@@ -108,7 +108,7 @@ class PriorityCommandTest(CommandTest): ...@@ -108,7 +108,7 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_invalid6(self): def test_invalid6(self):
command = PriorityCommand(["1"], self.todolist, self.out, self.error) command = PriorityCommand(["1"], self.todolist, self.out, self.error)
...@@ -116,7 +116,7 @@ class PriorityCommandTest(CommandTest): ...@@ -116,7 +116,7 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_empty(self): def test_empty(self):
command = PriorityCommand([], self.todolist, self.out, self.error) command = PriorityCommand([], self.todolist, self.out, self.error)
...@@ -124,14 +124,14 @@ class PriorityCommandTest(CommandTest): ...@@ -124,14 +124,14 @@ class PriorityCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_help(self): def test_help(self):
command = PriorityCommand(["help"], self.todolist, self.out, self.error) command = PriorityCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -35,7 +35,7 @@ class RecurrenceTest(TopydoTest): ...@@ -35,7 +35,7 @@ class RecurrenceTest(TopydoTest):
self.todo.set_tag(config().tag_due(), future.isoformat()) self.todo.set_tag(config().tag_due(), future.isoformat())
new_todo = advance_recurring_todo(self.todo) new_todo = advance_recurring_todo(self.todo)
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_duedate2(self): def test_duedate2(self):
""" Where due date is today. """ """ Where due date is today. """
...@@ -45,7 +45,7 @@ class RecurrenceTest(TopydoTest): ...@@ -45,7 +45,7 @@ class RecurrenceTest(TopydoTest):
self.todo.set_tag(config().tag_due(), today.isoformat()) self.todo.set_tag(config().tag_due(), today.isoformat())
new_todo = advance_recurring_todo(self.todo) new_todo = advance_recurring_todo(self.todo)
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_duedate3(self): def test_duedate3(self):
""" Where due date is in the past. """ """ Where due date is in the past. """
...@@ -55,7 +55,7 @@ class RecurrenceTest(TopydoTest): ...@@ -55,7 +55,7 @@ class RecurrenceTest(TopydoTest):
self.todo.set_tag(config().tag_due(), past.isoformat()) self.todo.set_tag(config().tag_due(), past.isoformat())
new_todo = advance_recurring_todo(self.todo) new_todo = advance_recurring_todo(self.todo)
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_duedate4(self): def test_duedate4(self):
""" Where due date is in the past. """ """ Where due date is in the past. """
...@@ -65,7 +65,7 @@ class RecurrenceTest(TopydoTest): ...@@ -65,7 +65,7 @@ class RecurrenceTest(TopydoTest):
self.todo.set_tag(config().tag_due(), past.isoformat()) self.todo.set_tag(config().tag_due(), past.isoformat())
new_todo = strict_advance_recurring_todo(self.todo) new_todo = strict_advance_recurring_todo(self.todo)
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_duedate5(self): def test_duedate5(self):
""" Where due date is in the future. """ """ Where due date is in the future. """
...@@ -75,7 +75,7 @@ class RecurrenceTest(TopydoTest): ...@@ -75,7 +75,7 @@ class RecurrenceTest(TopydoTest):
self.todo.set_tag(config().tag_due(), future.isoformat()) self.todo.set_tag(config().tag_due(), future.isoformat())
new_todo = strict_advance_recurring_todo(self.todo) new_todo = strict_advance_recurring_todo(self.todo)
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_duedate6(self): def test_duedate6(self):
""" Where due date is today. """ """ Where due date is today. """
...@@ -85,21 +85,21 @@ class RecurrenceTest(TopydoTest): ...@@ -85,21 +85,21 @@ class RecurrenceTest(TopydoTest):
self.todo.set_tag(config().tag_due(), today.isoformat()) self.todo.set_tag(config().tag_due(), today.isoformat())
new_todo = strict_advance_recurring_todo(self.todo) new_todo = strict_advance_recurring_todo(self.todo)
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_noduedate1(self): def test_noduedate1(self):
new_due = date.today() + timedelta(7) new_due = date.today() + timedelta(7)
new_todo = advance_recurring_todo(self.todo) new_todo = advance_recurring_todo(self.todo)
self.assertTrue(new_todo.has_tag(config().tag_due())) self.assertTrue(new_todo.has_tag(config().tag_due()))
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_noduedate2(self): def test_noduedate2(self):
new_due = date.today() + timedelta(7) new_due = date.today() + timedelta(7)
new_todo = strict_advance_recurring_todo(self.todo) new_todo = strict_advance_recurring_todo(self.todo)
self.assertTrue(new_todo.has_tag(config().tag_due())) self.assertTrue(new_todo.has_tag(config().tag_due()))
self.assertEquals(new_todo.due_date(), new_due) self.assertEqual(new_todo.due_date(), new_due)
def test_startdate1(self): def test_startdate1(self):
""" Start date is before due date. """ """ Start date is before due date. """
...@@ -110,7 +110,7 @@ class RecurrenceTest(TopydoTest): ...@@ -110,7 +110,7 @@ class RecurrenceTest(TopydoTest):
new_start = date.today() + timedelta(6) new_start = date.today() + timedelta(6)
new_todo = advance_recurring_todo(self.todo) new_todo = advance_recurring_todo(self.todo)
self.assertEquals(new_todo.start_date(), new_start) self.assertEqual(new_todo.start_date(), new_start)
def test_startdate2(self): def test_startdate2(self):
""" Strict recurrence. Start date is before due date. """ """ Strict recurrence. Start date is before due date. """
...@@ -122,7 +122,7 @@ class RecurrenceTest(TopydoTest): ...@@ -122,7 +122,7 @@ class RecurrenceTest(TopydoTest):
new_start = date.today() + timedelta(5) new_start = date.today() + timedelta(5)
new_todo = strict_advance_recurring_todo(self.todo) new_todo = strict_advance_recurring_todo(self.todo)
self.assertEquals(new_todo.start_date(), new_start) self.assertEqual(new_todo.start_date(), new_start)
def test_startdate3(self): def test_startdate3(self):
""" Start date equals due date. """ """ Start date equals due date. """
...@@ -132,7 +132,7 @@ class RecurrenceTest(TopydoTest): ...@@ -132,7 +132,7 @@ class RecurrenceTest(TopydoTest):
new_start = date.today() + timedelta(7) new_start = date.today() + timedelta(7)
new_todo = advance_recurring_todo(self.todo) new_todo = advance_recurring_todo(self.todo)
self.assertEquals(new_todo.start_date(), new_start) self.assertEqual(new_todo.start_date(), new_start)
def test_no_recurrence(self): def test_no_recurrence(self):
self.todo.remove_tag('rec') self.todo.remove_tag('rec')
......
...@@ -32,20 +32,20 @@ class RelativeDateTester(TopydoTest): ...@@ -32,20 +32,20 @@ class RelativeDateTester(TopydoTest):
def test_zero_days(self): def test_zero_days(self):
result = relative_date_to_date('0d') result = relative_date_to_date('0d')
self.assertEquals(result, self.today) self.assertEqual(result, self.today)
def test_one_day(self): def test_one_day(self):
result = relative_date_to_date('1d') result = relative_date_to_date('1d')
self.assertEquals(result, self.tomorrow) self.assertEqual(result, self.tomorrow)
def test_one_week(self): def test_one_week(self):
result = relative_date_to_date('1w') result = relative_date_to_date('1w')
self.assertEquals(result, date.today() + timedelta(weeks=1)) self.assertEqual(result, date.today() + timedelta(weeks=1))
def test_one_month(self): def test_one_month(self):
test_date = date(2015, 1, 10) test_date = date(2015, 1, 10)
result = relative_date_to_date('1m', test_date) result = relative_date_to_date('1m', test_date)
self.assertEquals(result, date(2015, 2, 10)) self.assertEqual(result, date(2015, 2, 10))
def test_one_month_ext(self): def test_one_month_ext(self):
test_date1 = date(2015, 1, 29) test_date1 = date(2015, 1, 29)
...@@ -60,31 +60,31 @@ class RelativeDateTester(TopydoTest): ...@@ -60,31 +60,31 @@ class RelativeDateTester(TopydoTest):
result4 = relative_date_to_date('1m', test_date4) result4 = relative_date_to_date('1m', test_date4)
result5 = relative_date_to_date('1m', test_date5) result5 = relative_date_to_date('1m', test_date5)
self.assertEquals(result1, date(2015, 2, 28)) self.assertEqual(result1, date(2015, 2, 28))
self.assertEquals(result2, date(2016, 2, 29)) self.assertEqual(result2, date(2016, 2, 29))
self.assertEquals(result3, date(2016, 1, 31)) self.assertEqual(result3, date(2016, 1, 31))
self.assertEquals(result4, date(2015, 8, 31)) self.assertEqual(result4, date(2015, 8, 31))
self.assertEquals(result5, date(2015, 11, 30)) self.assertEqual(result5, date(2015, 11, 30))
def test_one_year(self): def test_one_year(self):
test_date = date(2015, 1, 10) test_date = date(2015, 1, 10)
result = relative_date_to_date('1y', test_date) result = relative_date_to_date('1y', test_date)
self.assertEquals(result, date(2016, 1, 10)) self.assertEqual(result, date(2016, 1, 10))
def test_leap_year(self): def test_leap_year(self):
test_date = date(2016, 2, 29) test_date = date(2016, 2, 29)
result1 = relative_date_to_date('1y', test_date) result1 = relative_date_to_date('1y', test_date)
result2 = relative_date_to_date('4y', test_date) result2 = relative_date_to_date('4y', test_date)
self.assertEquals(result1, date(2017, 2, 28)) self.assertEqual(result1, date(2017, 2, 28))
self.assertEquals(result2, date(2020, 2, 29)) self.assertEqual(result2, date(2020, 2, 29))
def test_zero_months(self): def test_zero_months(self):
result = relative_date_to_date('0m') result = relative_date_to_date('0m')
self.assertEquals(result, self.today) self.assertEqual(result, self.today)
def test_zero_years(self): def test_zero_years(self):
result = relative_date_to_date('0y') result = relative_date_to_date('0y')
self.assertEquals(result, self.today) self.assertEqual(result, self.today)
def test_garbage1(self): def test_garbage1(self):
result = relative_date_to_date('0dd') result = relative_date_to_date('0dd')
...@@ -92,40 +92,40 @@ class RelativeDateTester(TopydoTest): ...@@ -92,40 +92,40 @@ class RelativeDateTester(TopydoTest):
def test_one_day_capital(self): def test_one_day_capital(self):
result = relative_date_to_date('1D') result = relative_date_to_date('1D')
self.assertEquals(result, self.tomorrow) self.assertEqual(result, self.tomorrow)
def test_today1(self): def test_today1(self):
result = relative_date_to_date('today') result = relative_date_to_date('today')
self.assertEquals(result, self.today) self.assertEqual(result, self.today)
def test_today2(self): def test_today2(self):
result = relative_date_to_date('tod') result = relative_date_to_date('tod')
self.assertEquals(result, self.today) self.assertEqual(result, self.today)
def test_today3(self): def test_today3(self):
result = relative_date_to_date('today', \ result = relative_date_to_date('today', \
date.today() + timedelta(1)) date.today() + timedelta(1))
self.assertEquals(result, self.today) self.assertEqual(result, self.today)
def test_tomorrow1(self): def test_tomorrow1(self):
result = relative_date_to_date('Tomorrow') result = relative_date_to_date('Tomorrow')
self.assertEquals(result, self.tomorrow) self.assertEqual(result, self.tomorrow)
def test_tomorrow2(self): def test_tomorrow2(self):
result = relative_date_to_date('tom') result = relative_date_to_date('tom')
self.assertEquals(result, self.tomorrow) self.assertEqual(result, self.tomorrow)
def test_monday1(self): def test_monday1(self):
result = relative_date_to_date('monday') result = relative_date_to_date('monday')
self.assertEquals(result, self.monday) self.assertEqual(result, self.monday)
def test_monday2(self): def test_monday2(self):
result = relative_date_to_date('mo') result = relative_date_to_date('mo')
self.assertEquals(result, self.monday) self.assertEqual(result, self.monday)
def test_monday3(self): def test_monday3(self):
result = relative_date_to_date('mon') result = relative_date_to_date('mon')
self.assertEquals(result, self.monday) self.assertEqual(result, self.monday)
def test_monday4(self): def test_monday4(self):
result = relative_date_to_date('mondayy') result = relative_date_to_date('mondayy')
...@@ -133,11 +133,11 @@ class RelativeDateTester(TopydoTest): ...@@ -133,11 +133,11 @@ class RelativeDateTester(TopydoTest):
def test_offset1(self): def test_offset1(self):
result = relative_date_to_date('1d', self.tomorrow) result = relative_date_to_date('1d', self.tomorrow)
self.assertEquals(result, date.today() + timedelta(2)) self.assertEqual(result, date.today() + timedelta(2))
def test_negative_period1(self): def test_negative_period1(self):
result = relative_date_to_date('-1d') result = relative_date_to_date('-1d')
self.assertEquals(result, date.today() - timedelta(1)) self.assertEqual(result, date.today() - timedelta(1))
def test_negative_period2(self): def test_negative_period2(self):
result = relative_date_to_date('-0d') result = relative_date_to_date('-0d')
......
...@@ -31,13 +31,13 @@ class SortCommandTest(CommandTest): ...@@ -31,13 +31,13 @@ class SortCommandTest(CommandTest):
command = SortCommand(["text"], self.todolist, self.out, self.error) command = SortCommand(["text"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(str(self.todolist), "First\n(A) Foo\n2014-06-14 Last") self.assertEqual(str(self.todolist), "First\n(A) Foo\n2014-06-14 Last")
def test_sort2(self): def test_sort2(self):
command = SortCommand([], self.todolist, self.out, self.error) command = SortCommand([], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(str(self.todolist), "(A) Foo\n2014-06-14 Last\nFirst") self.assertEqual(str(self.todolist), "(A) Foo\n2014-06-14 Last\nFirst")
def test_sort3(self): def test_sort3(self):
""" Check that order does not influence the UID of a todo. """ """ Check that order does not influence the UID of a todo. """
...@@ -48,14 +48,14 @@ class SortCommandTest(CommandTest): ...@@ -48,14 +48,14 @@ class SortCommandTest(CommandTest):
command.execute() command.execute()
todo2 = self.todolist.todo('7ui') todo2 = self.todolist.todo('7ui')
self.assertEquals(todo1.source(), todo2.source()) self.assertEqual(todo1.source(), todo2.source())
def test_help(self): def test_help(self):
command = SortCommand(["help"], self.todolist, self.out, self.error) command = SortCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -33,8 +33,8 @@ class SorterTest(TopydoTest): ...@@ -33,8 +33,8 @@ class SorterTest(TopydoTest):
todos_sorted = todolist_to_string(p_sorter.sort(todos)) todos_sorted = todolist_to_string(p_sorter.sort(todos))
todos_ref = todolist_to_string(load_file(p_filename_ref)) todos_ref = todolist_to_string(load_file(p_filename_ref))
self.assertEquals(todos_sorted, todos_ref) self.assertEqual(todos_sorted, todos_ref)
self.assertEquals(todolist_to_string(todos), text_before) self.assertEqual(todolist_to_string(todos), text_before)
def test_sort1(self): def test_sort1(self):
""" Alphabetically sorted """ """ Alphabetically sorted """
...@@ -128,7 +128,7 @@ class SorterTest(TopydoTest): ...@@ -128,7 +128,7 @@ class SorterTest(TopydoTest):
view = todolist.view(sorter, []) view = todolist.view(sorter, [])
result = load_file('test/data/SorterTest10-result.txt') result = load_file('test/data/SorterTest10-result.txt')
self.assertEquals(str(view), todolist_to_string(result)) self.assertEqual(str(view), todolist_to_string(result))
def test_sort15(self): def test_sort15(self):
""" """
...@@ -141,7 +141,7 @@ class SorterTest(TopydoTest): ...@@ -141,7 +141,7 @@ class SorterTest(TopydoTest):
view = todolist.view(sorter, []) view = todolist.view(sorter, [])
result = load_file('test/data/SorterTest11-result.txt') result = load_file('test/data/SorterTest11-result.txt')
self.assertEquals(str(view), todolist_to_string(result)) self.assertEqual(str(view), todolist_to_string(result))
def test_sort16(self): def test_sort16(self):
""" """
...@@ -153,7 +153,7 @@ class SorterTest(TopydoTest): ...@@ -153,7 +153,7 @@ class SorterTest(TopydoTest):
view = todolist.view(sorter, []) view = todolist.view(sorter, [])
result = load_file('test/data/SorterTest12-result.txt') result = load_file('test/data/SorterTest12-result.txt')
self.assertEquals(str(view), todolist_to_string(result)) self.assertEqual(str(view), todolist_to_string(result))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -36,27 +36,27 @@ class TagCommandTest(CommandTest): ...@@ -36,27 +36,27 @@ class TagCommandTest(CommandTest):
command = TagCommand(["1", "due", "2014-10-22"], self.todolist, self.out, self.error) command = TagCommand(["1", "due", "2014-10-22"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), "Foo due:2014-10-22") self.assertEqual(self.todolist.todo(1).source(), "Foo due:2014-10-22")
self.assertEquals(self.output, "| 1| Foo due:2014-10-22\n") self.assertEqual(self.output, "| 1| Foo due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
def test_add_tag2(self): def test_add_tag2(self):
command = TagCommand(["Foo", "due", "2014-10-22"], self.todolist, self.out, self.error) command = TagCommand(["Foo", "due", "2014-10-22"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(1).source(), "Foo due:2014-10-22") self.assertEqual(self.todolist.todo(1).source(), "Foo due:2014-10-22")
self.assertEquals(self.output, "| 1| Foo due:2014-10-22\n") self.assertEqual(self.output, "| 1| Foo due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
def test_add_tag3(self): def test_add_tag3(self):
command = TagCommand(["-a", "2", "due", "2014-10-19"], self.todolist, self.out, self.error) command = TagCommand(["-a", "2", "due", "2014-10-19"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.todolist.todo(2).source(), "Bar due:2014-10-22 due:2014-10-19") self.assertEqual(self.todolist.todo(2).source(), "Bar due:2014-10-22 due:2014-10-19")
self.assertEquals(self.output, "| 2| Bar due:2014-10-22 due:2014-10-19\n") self.assertEqual(self.output, "| 2| Bar due:2014-10-22 due:2014-10-19\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
def test_add_tag4(self): def test_add_tag4(self):
...@@ -65,150 +65,150 @@ class TagCommandTest(CommandTest): ...@@ -65,150 +65,150 @@ class TagCommandTest(CommandTest):
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output) self.assertFalse(self.output)
self.assertEquals(self.errors, "Invalid todo number.\n") self.assertEqual(self.errors, "Invalid todo number.\n")
def test_set_tag4(self): def test_set_tag4(self):
command = TagCommand(["3", "due", "2014-10-20"], self.todolist, self.out, self.error) command = TagCommand(["3", "due", "2014-10-20"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 3| Baz due:2014-10-20\n") self.assertEqual(self.output, "| 3| Baz due:2014-10-20\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_tag5(self): def test_set_tag5(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "all") command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "all")
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-20\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_tag6(self): def test_set_tag6(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "1") command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "1")
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_tag7(self): def test_set_tag7(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "2") command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "2")
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-20\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_tag8(self): def test_set_tag8(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "") command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "")
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_tag9(self): def test_set_tag9(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "99") command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "99")
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_set_tag10(self): def test_set_tag10(self):
command = TagCommand(["-f", "4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "99") command = TagCommand(["-f", "4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "99")
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 4| Fnord due:2014-10-20 due:2014-10-20\n") self.assertEqual(self.output, "| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag1(self): def test_rm_tag1(self):
command = TagCommand(["1", "due"], self.todolist, self.out, self.error) command = TagCommand(["1", "due"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "| 1| Foo\n") self.assertEqual(self.output, "| 1| Foo\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag2(self): def test_rm_tag2(self):
command = TagCommand(["2", "due"], self.todolist, self.out, self.error) command = TagCommand(["2", "due"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 2| Bar\n") self.assertEqual(self.output, "| 2| Bar\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag3(self): def test_rm_tag3(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "all") command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "all")
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag4(self): def test_rm_tag4(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "1") command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "1")
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-22\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag6(self): def test_rm_tag6(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "99") command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "99")
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag7(self): def test_rm_tag7(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "A") command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "A")
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n") self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_rm_tag8(self): def test_rm_tag8(self):
command = TagCommand(["5", "due"], self.todolist, self.out, self.error) command = TagCommand(["5", "due"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number.\n") self.assertEqual(self.errors, "Invalid todo number.\n")
def test_rm_tag9(self): def test_rm_tag9(self):
command = TagCommand(["A", "due"], self.todolist, self.out, self.error) command = TagCommand(["A", "due"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, "Invalid todo number.\n") self.assertEqual(self.errors, "Invalid todo number.\n")
def test_rm_tag10(self): def test_rm_tag10(self):
command = TagCommand(["-f", "4", "due"], self.todolist, self.out, self.error, lambda t: "A") command = TagCommand(["-f", "4", "due"], self.todolist, self.out, self.error, lambda t: "A")
command.execute() command.execute()
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, "| 4| Fnord\n") self.assertEqual(self.output, "| 4| Fnord\n")
self.assertEquals(self.errors, "") self.assertEqual(self.errors, "")
def test_no_tag(self): def test_no_tag(self):
command = TagCommand(["4"], self.todolist, self.out, self.error) command = TagCommand(["4"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n") self.assertEqual(self.errors, command.usage() + "\n")
def test_help(self): def test_help(self):
command = TagCommand(["help"], self.todolist, self.out, self.error) command = TagCommand(["help"], self.todolist, self.out, self.error)
command.execute() command.execute()
self.assertEquals(self.output, "") self.assertEqual(self.output, "")
self.assertEquals(self.errors, command.usage() + "\n\n" + command.help() + "\n") self.assertEqual(self.errors, command.usage() + "\n\n" + command.help() + "\n")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -48,7 +48,7 @@ class TodoBaseTester(TopydoTest): ...@@ -48,7 +48,7 @@ class TodoBaseTester(TopydoTest):
todo = TodoBase("(C) Foo id:1") todo = TodoBase("(C) Foo id:1")
todo.add_tag('id', '2') todo.add_tag('id', '2')
self.assertEquals(todo.source(), '(C) Foo id:1 id:2') self.assertEqual(todo.source(), '(C) Foo id:1 id:2')
def test_set_tag1(self): def test_set_tag1(self):
todo = TodoBase("(C) Foo foo:bar") todo = TodoBase("(C) Foo foo:bar")
...@@ -146,7 +146,7 @@ class TodoBaseTester(TopydoTest): ...@@ -146,7 +146,7 @@ class TodoBaseTester(TopydoTest):
todo = TodoBase("(A) Foo") todo = TodoBase("(A) Foo")
todo.set_priority('B') todo.set_priority('B')
self.assertEquals(todo.priority(), 'B') self.assertEqual(todo.priority(), 'B')
self.assertTrue(re.match(r'^\(B\) Foo$', todo.src)) self.assertTrue(re.match(r'^\(B\) Foo$', todo.src))
def test_set_priority2(self): def test_set_priority2(self):
...@@ -154,7 +154,7 @@ class TodoBaseTester(TopydoTest): ...@@ -154,7 +154,7 @@ class TodoBaseTester(TopydoTest):
todo = TodoBase("Foo") todo = TodoBase("Foo")
todo.set_priority('B') todo.set_priority('B')
self.assertEquals(todo.priority(), 'B') self.assertEqual(todo.priority(), 'B')
self.assertTrue(re.match(r'^\(B\) Foo$', todo.src)) self.assertTrue(re.match(r'^\(B\) Foo$', todo.src))
def test_set_priority3(self): def test_set_priority3(self):
...@@ -162,7 +162,7 @@ class TodoBaseTester(TopydoTest): ...@@ -162,7 +162,7 @@ class TodoBaseTester(TopydoTest):
todo = TodoBase("(A) Foo") todo = TodoBase("(A) Foo")
todo.set_priority('AB') todo.set_priority('AB')
self.assertEquals(todo.priority(), 'A') self.assertEqual(todo.priority(), 'A')
self.assertTrue(re.match(r'^\(A\) Foo$', todo.src)) self.assertTrue(re.match(r'^\(A\) Foo$', todo.src))
def test_set_priority4(self): def test_set_priority4(self):
...@@ -173,7 +173,7 @@ class TodoBaseTester(TopydoTest): ...@@ -173,7 +173,7 @@ class TodoBaseTester(TopydoTest):
todo.set_priority('B') todo.set_priority('B')
self.assertEquals(todo.priority(), 'B') self.assertEqual(todo.priority(), 'B')
self.assertTrue(re.match(r'^\(B\) \(A\)Foo$', todo.src)) self.assertTrue(re.match(r'^\(B\) \(A\)Foo$', todo.src))
def test_set_priority5(self): def test_set_priority5(self):
...@@ -181,7 +181,7 @@ class TodoBaseTester(TopydoTest): ...@@ -181,7 +181,7 @@ class TodoBaseTester(TopydoTest):
todo = TodoBase("(A) Foo") todo = TodoBase("(A) Foo")
todo.set_priority(None) todo.set_priority(None)
self.assertEquals(todo.priority(), None) self.assertEqual(todo.priority(), None)
self.assertTrue(re.match(r'^Foo$', todo.src)) self.assertTrue(re.match(r'^Foo$', todo.src))
def test_set_priority6(self): def test_set_priority6(self):
...@@ -190,32 +190,32 @@ class TodoBaseTester(TopydoTest): ...@@ -190,32 +190,32 @@ class TodoBaseTester(TopydoTest):
todo.set_priority('A') todo.set_priority('A')
self.assertFalse(todo.priority()) self.assertFalse(todo.priority())
self.assertEquals(todo.src, "x 2014-06-13 Foo") self.assertEqual(todo.src, "x 2014-06-13 Foo")
def test_project1(self): def test_project1(self):
todo = TodoBase("(C) Foo +Bar +Baz +Bar:") todo = TodoBase("(C) Foo +Bar +Baz +Bar:")
self.assertEquals(len(todo.projects()), 2) self.assertEqual(len(todo.projects()), 2)
self.assertIn('Bar', todo.projects()) self.assertIn('Bar', todo.projects())
self.assertIn('Baz', todo.projects()) self.assertIn('Baz', todo.projects())
def test_project2(self): def test_project2(self):
todo = TodoBase("(C) Foo +Bar+Baz") todo = TodoBase("(C) Foo +Bar+Baz")
self.assertEquals(len(todo.projects()), 1) self.assertEqual(len(todo.projects()), 1)
self.assertIn('Bar+Baz', todo.projects()) self.assertIn('Bar+Baz', todo.projects())
def test_context1(self): def test_context1(self):
todo = TodoBase("(C) Foo @Bar @Baz @Bar:") todo = TodoBase("(C) Foo @Bar @Baz @Bar:")
self.assertEquals(len(todo.contexts()), 2) self.assertEqual(len(todo.contexts()), 2)
self.assertIn('Bar', todo.contexts()) self.assertIn('Bar', todo.contexts())
self.assertIn('Baz', todo.contexts()) self.assertIn('Baz', todo.contexts())
def test_context2(self): def test_context2(self):
todo = TodoBase("(C) Foo @Bar+Baz") todo = TodoBase("(C) Foo @Bar+Baz")
self.assertEquals(len(todo.contexts()), 1) self.assertEqual(len(todo.contexts()), 1)
self.assertIn('Bar+Baz', todo.contexts()) self.assertIn('Bar+Baz', todo.contexts())
def test_completion1(self): def test_completion1(self):
...@@ -248,7 +248,7 @@ class TodoBaseTester(TopydoTest): ...@@ -248,7 +248,7 @@ class TodoBaseTester(TopydoTest):
today_str = today.isoformat() today_str = today.isoformat()
self.assertFalse(todo.priority()) self.assertFalse(todo.priority())
self.assertEquals(todo.fields['completionDate'], today) self.assertEqual(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src)) self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src))
def test_set_complete2(self): def test_set_complete2(self):
...@@ -258,7 +258,7 @@ class TodoBaseTester(TopydoTest): ...@@ -258,7 +258,7 @@ class TodoBaseTester(TopydoTest):
today = date.today() today = date.today()
today_str = today.isoformat() today_str = today.isoformat()
self.assertEquals(todo.fields['completionDate'], today) self.assertEqual(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', \ self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', \
todo.src)) todo.src))
...@@ -269,7 +269,7 @@ class TodoBaseTester(TopydoTest): ...@@ -269,7 +269,7 @@ class TodoBaseTester(TopydoTest):
today = date.today() today = date.today()
today_str = today.isoformat() today_str = today.isoformat()
self.assertEquals(todo.fields['completionDate'], today) self.assertEqual(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src)) self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src))
def test_set_complete4(self): def test_set_complete4(self):
...@@ -279,21 +279,21 @@ class TodoBaseTester(TopydoTest): ...@@ -279,21 +279,21 @@ class TodoBaseTester(TopydoTest):
today = date.today() today = date.today()
today_str = today.isoformat() today_str = today.isoformat()
self.assertEquals(todo.fields['completionDate'], today) self.assertEqual(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', todo.src)) self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', todo.src))
def test_set_complete5(self): def test_set_complete5(self):
todo = TodoBase("x 2014-06-13 Foo") todo = TodoBase("x 2014-06-13 Foo")
todo.set_completed() todo.set_completed()
self.assertEquals(todo.src, "x 2014-06-13 Foo") self.assertEqual(todo.src, "x 2014-06-13 Foo")
def test_set_complete6(self): def test_set_complete6(self):
todo = TodoBase("Foo") todo = TodoBase("Foo")
yesterday = date.today() - timedelta(1) yesterday = date.today() - timedelta(1)
todo.set_completed(yesterday) todo.set_completed(yesterday)
self.assertEquals(todo.src, "x {} Foo".format(yesterday.isoformat())) self.assertEqual(todo.src, "x {} Foo".format(yesterday.isoformat()))
def test_set_source_text(self): def test_set_source_text(self):
todo = TodoBase("(B) Foo") todo = TodoBase("(B) Foo")
...@@ -301,8 +301,8 @@ class TodoBaseTester(TopydoTest): ...@@ -301,8 +301,8 @@ class TodoBaseTester(TopydoTest):
new_text = "(C) Foo" new_text = "(C) Foo"
todo.set_source_text(new_text) todo.set_source_text(new_text)
self.assertEquals(todo.src, new_text) self.assertEqual(todo.src, new_text)
self.assertEquals(todo.priority(),'C') self.assertEqual(todo.priority(),'C')
def test_set_creation_date1(self): def test_set_creation_date1(self):
todo = TodoBase("Foo") todo = TodoBase("Foo")
...@@ -310,8 +310,8 @@ class TodoBaseTester(TopydoTest): ...@@ -310,8 +310,8 @@ class TodoBaseTester(TopydoTest):
todo.set_creation_date(creation_date) todo.set_creation_date(creation_date)
self.assertEquals(todo.creation_date(), creation_date) self.assertEqual(todo.creation_date(), creation_date)
self.assertEquals(todo.src, "2014-07-24 Foo") self.assertEqual(todo.src, "2014-07-24 Foo")
def test_set_creation_date2(self): def test_set_creation_date2(self):
todo = TodoBase("(A) Foo") todo = TodoBase("(A) Foo")
...@@ -319,8 +319,8 @@ class TodoBaseTester(TopydoTest): ...@@ -319,8 +319,8 @@ class TodoBaseTester(TopydoTest):
todo.set_creation_date(creation_date) todo.set_creation_date(creation_date)
self.assertEquals(todo.creation_date(), creation_date) self.assertEqual(todo.creation_date(), creation_date)
self.assertEquals(todo.src, "(A) 2014-07-24 Foo") self.assertEqual(todo.src, "(A) 2014-07-24 Foo")
def test_set_creation_date3(self): def test_set_creation_date3(self):
todo = TodoBase("(A) 2014-07-23 Foo") todo = TodoBase("(A) 2014-07-23 Foo")
...@@ -328,8 +328,8 @@ class TodoBaseTester(TopydoTest): ...@@ -328,8 +328,8 @@ class TodoBaseTester(TopydoTest):
todo.set_creation_date(creation_date) todo.set_creation_date(creation_date)
self.assertEquals(todo.creation_date(), creation_date) self.assertEqual(todo.creation_date(), creation_date)
self.assertEquals(todo.src, "(A) 2014-07-24 Foo") self.assertEqual(todo.src, "(A) 2014-07-24 Foo")
def test_set_creation_date4(self): def test_set_creation_date4(self):
todo = TodoBase("2014-07-23 Foo") todo = TodoBase("2014-07-23 Foo")
...@@ -337,8 +337,8 @@ class TodoBaseTester(TopydoTest): ...@@ -337,8 +337,8 @@ class TodoBaseTester(TopydoTest):
todo.set_creation_date(creation_date) todo.set_creation_date(creation_date)
self.assertEquals(todo.creation_date(), creation_date) self.assertEqual(todo.creation_date(), creation_date)
self.assertEquals(todo.src, "2014-07-24 Foo") self.assertEqual(todo.src, "2014-07-24 Foo")
def test_set_creation_date5(self): def test_set_creation_date5(self):
todo = TodoBase("x 2014-07-25 2014-07-23 Foo") todo = TodoBase("x 2014-07-25 2014-07-23 Foo")
...@@ -346,8 +346,8 @@ class TodoBaseTester(TopydoTest): ...@@ -346,8 +346,8 @@ class TodoBaseTester(TopydoTest):
todo.set_creation_date(creation_date) todo.set_creation_date(creation_date)
self.assertEquals(todo.creation_date(), creation_date) self.assertEqual(todo.creation_date(), creation_date)
self.assertEquals(todo.src, "x 2014-07-25 2014-07-24 Foo") self.assertEqual(todo.src, "x 2014-07-25 2014-07-24 Foo")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -37,12 +37,12 @@ class TodoListTester(TopydoTest): ...@@ -37,12 +37,12 @@ class TodoListTester(TopydoTest):
self.todolist = TodoList(lines) self.todolist = TodoList(lines)
def test_contexts(self): def test_contexts(self):
self.assertEquals(set(['Context1', 'Context2']), \ self.assertEqual(set(['Context1', 'Context2']), \
self.todolist.contexts()) self.todolist.contexts())
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
def test_projects(self): def test_projects(self):
self.assertEquals(set(['Project1', 'Project2']), \ self.assertEqual(set(['Project1', 'Project2']), \
self.todolist.projects()) self.todolist.projects())
self.assertFalse(self.todolist.is_dirty()) self.assertFalse(self.todolist.is_dirty())
...@@ -51,18 +51,18 @@ class TodoListTester(TopydoTest): ...@@ -51,18 +51,18 @@ class TodoListTester(TopydoTest):
count = self.todolist.count() count = self.todolist.count()
todo = self.todolist.add(text) todo = self.todolist.add(text)
self.assertEquals(self.todolist.todo(count+1).source(), text) self.assertEqual(self.todolist.todo(count+1).source(), text)
self.assertEquals(set(['Project1', 'Project2', 'Project3']), \ self.assertEqual(set(['Project1', 'Project2', 'Project3']), \
self.todolist.projects()) self.todolist.projects())
self.assertEquals(set(['Context1', 'Context2', 'Context3']), \ self.assertEqual(set(['Context1', 'Context2', 'Context3']), \
self.todolist.contexts()) self.todolist.contexts())
self.assertEquals(self.todolist.number(todo), 6) self.assertEqual(self.todolist.number(todo), 6)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
def test_add2(self): def test_add2(self):
text = str(self.todolist) text = str(self.todolist)
self.todolist.add('') self.todolist.add('')
self.assertEquals(str(self.todolist), text) self.assertEqual(str(self.todolist), text)
def test_add3a(self): def test_add3a(self):
count = self.todolist.count() count = self.todolist.count()
...@@ -83,21 +83,21 @@ class TodoListTester(TopydoTest): ...@@ -83,21 +83,21 @@ class TodoListTester(TopydoTest):
def test_add4(self): def test_add4(self):
text = str(self.todolist) text = str(self.todolist)
self.todolist.add(' ') self.todolist.add(' ')
self.assertEquals(str(self.todolist), text) self.assertEqual(str(self.todolist), text)
def test_add5(self): def test_add5(self):
text = str(self.todolist) text = str(self.todolist)
self.todolist.add("\n") self.todolist.add("\n")
self.assertEquals(str(self.todolist), text) self.assertEqual(str(self.todolist), text)
def test_delete1(self): def test_delete1(self):
count = self.todolist.count() count = self.todolist.count()
todo = self.todolist.todo(2) todo = self.todolist.todo(2)
self.todolist.delete(todo) self.todolist.delete(todo)
self.assertEquals(self.todolist.todo(2).source(), \ self.assertEqual(self.todolist.todo(2).source(), \
"(C) Baz @Context1 +Project1 key:value") "(C) Baz @Context1 +Project1 key:value")
self.assertEquals(self.todolist.count(), count - 1) self.assertEqual(self.todolist.count(), count - 1)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertRaises(InvalidTodoException, self.todolist.number, todo) self.assertRaises(InvalidTodoException, self.todolist.number, todo)
...@@ -105,9 +105,9 @@ class TodoListTester(TopydoTest): ...@@ -105,9 +105,9 @@ class TodoListTester(TopydoTest):
todo = self.todolist.todo(3) todo = self.todolist.todo(3)
self.todolist.append(todo, "@Context3") self.todolist.append(todo, "@Context3")
self.assertEquals(todo.source(), \ self.assertEqual(todo.source(), \
"(C) Baz @Context1 +Project1 key:value @Context3") "(C) Baz @Context1 +Project1 key:value @Context3")
self.assertEquals(set(['Context1', 'Context2', 'Context3']), \ self.assertEqual(set(['Context1', 'Context2', 'Context3']), \
self.todolist.contexts()) self.todolist.contexts())
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
...@@ -116,8 +116,8 @@ class TodoListTester(TopydoTest): ...@@ -116,8 +116,8 @@ class TodoListTester(TopydoTest):
text = todo.text() text = todo.text()
self.todolist.append(todo, "foo:bar") self.todolist.append(todo, "foo:bar")
self.assertEquals(todo.text(), text) self.assertEqual(todo.text(), text)
self.assertEquals(todo.source(), \ self.assertEqual(todo.source(), \
"(C) Baz @Context1 +Project1 key:value foo:bar") "(C) Baz @Context1 +Project1 key:value foo:bar")
def test_append3(self): def test_append3(self):
...@@ -125,7 +125,7 @@ class TodoListTester(TopydoTest): ...@@ -125,7 +125,7 @@ class TodoListTester(TopydoTest):
text = todo.text() text = todo.text()
self.todolist.append(todo, '') self.todolist.append(todo, '')
self.assertEquals(todo.text(), text) self.assertEqual(todo.text(), text)
def test_todo(self): def test_todo(self):
count = self.todolist.count() count = self.todolist.count()
...@@ -136,11 +136,11 @@ class TodoListTester(TopydoTest): ...@@ -136,11 +136,11 @@ class TodoListTester(TopydoTest):
def test_string(self): def test_string(self):
# readlines() always ends a string with \n, but join() in str(todolist) # readlines() always ends a string with \n, but join() in str(todolist)
# doesn't necessarily. # doesn't necessarily.
self.assertEquals(str(self.todolist) + '\n', self.text) self.assertEqual(str(self.todolist) + '\n', self.text)
def test_count(self): def test_count(self):
""" Test that empty lines are not counted. """ """ Test that empty lines are not counted. """
self.assertEquals(self.todolist.count(), 5) self.assertEqual(self.todolist.count(), 5)
def test_todo_by_dep_id(self): def test_todo_by_dep_id(self):
""" Tests that todos can be retrieved by their id tag. """ """ Tests that todos can be retrieved by their id tag. """
...@@ -155,7 +155,7 @@ class TodoListTester(TopydoTest): ...@@ -155,7 +155,7 @@ class TodoListTester(TopydoTest):
todo = self.todolist.todo(6) todo = self.todolist.todo(6)
self.assertIsInstance(todo, Todo) self.assertIsInstance(todo, Todo)
self.assertEquals(todo.text(), "No number") self.assertEqual(todo.text(), "No number")
def test_todo_number2(self): def test_todo_number2(self):
todo = Todo("Non-existent") todo = Todo("Non-existent")
...@@ -171,7 +171,7 @@ class TodoListTester(TopydoTest): ...@@ -171,7 +171,7 @@ class TodoListTester(TopydoTest):
todo = self.todolist.todo(1) todo = self.todolist.todo(1)
self.todolist.set_priority(todo, 'F') self.todolist.set_priority(todo, 'F')
self.assertEquals(self.todolist.todo(1).priority(), 'F') self.assertEqual(self.todolist.todo(1).priority(), 'F')
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
def test_todo_priority2(self): def test_todo_priority2(self):
...@@ -183,7 +183,7 @@ class TodoListTester(TopydoTest): ...@@ -183,7 +183,7 @@ class TodoListTester(TopydoTest):
def test_erase(self): def test_erase(self):
self.todolist.erase() self.todolist.erase()
self.assertEquals(self.todolist.count(), 0) self.assertEqual(self.todolist.count(), 0)
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
def test_regex1(self): def test_regex1(self):
...@@ -193,12 +193,12 @@ class TodoListTester(TopydoTest): ...@@ -193,12 +193,12 @@ class TodoListTester(TopydoTest):
def test_regex3(self): def test_regex3(self):
todo = self.todolist.todo("project2") todo = self.todolist.todo("project2")
self.assertTrue(todo) self.assertTrue(todo)
self.assertEquals(todo.source(), "(D) Bar @Context1 +Project2") self.assertEqual(todo.source(), "(D) Bar @Context1 +Project2")
def test_uid1(self): def test_uid1(self):
config("test/data/todolist-uid.conf") config("test/data/todolist-uid.conf")
self.assertEquals(self.todolist.todo('t5c').source(), "(C) Foo @Context2 Not@Context +Project1 Not+Project") self.assertEqual(self.todolist.todo('t5c').source(), "(C) Foo @Context2 Not@Context +Project1 Not+Project")
def test_uid2(self): def test_uid2(self):
""" Changing the priority should not change the identifier. """ """ Changing the priority should not change the identifier. """
...@@ -206,7 +206,7 @@ class TodoListTester(TopydoTest): ...@@ -206,7 +206,7 @@ class TodoListTester(TopydoTest):
todo = self.todolist.todo('t5c') todo = self.todolist.todo('t5c')
self.todolist.set_priority(todo, 'B') self.todolist.set_priority(todo, 'B')
self.assertEquals(self.todolist.todo('t5c').source(), "(B) Foo @Context2 Not@Context +Project1 Not+Project") self.assertEqual(self.todolist.todo('t5c').source(), "(B) Foo @Context2 Not@Context +Project1 Not+Project")
def test_uid3(self): def test_uid3(self):
""" """
...@@ -299,7 +299,7 @@ class TodoListDependencyTester(TopydoTest): ...@@ -299,7 +299,7 @@ class TodoListDependencyTester(TopydoTest):
self.todolist.add_dependency(todo6, todo7) self.todolist.add_dependency(todo6, todo7)
self.assertEquals(projects, todo7.projects()) self.assertEqual(projects, todo7.projects())
def test_add_dep4(self): def test_add_dep4(self):
""" """
...@@ -312,7 +312,7 @@ class TodoListDependencyTester(TopydoTest): ...@@ -312,7 +312,7 @@ class TodoListDependencyTester(TopydoTest):
self.todolist.add_dependency(todo6, todo8) self.todolist.add_dependency(todo6, todo8)
self.assertEquals(set(["Project", "AnotherProject"]), todo8.projects()) self.assertEqual(set(["Project", "AnotherProject"]), todo8.projects())
def test_remove_dep1(self): def test_remove_dep1(self):
from_todo = self.todolist.todo(3) from_todo = self.todolist.todo(3)
...@@ -328,7 +328,7 @@ class TodoListDependencyTester(TopydoTest): ...@@ -328,7 +328,7 @@ class TodoListDependencyTester(TopydoTest):
to_todo = self.todolist.todo(4) to_todo = self.todolist.todo(4)
self.todolist.remove_dependency(from_todo, to_todo) self.todolist.remove_dependency(from_todo, to_todo)
self.assertEquals(str(self.todolist), old) self.assertEqual(str(self.todolist), old)
def test_remove_todo_check_children(self): def test_remove_todo_check_children(self):
todo = self.todolist.todo(2) todo = self.todolist.todo(2)
......
...@@ -34,7 +34,7 @@ class ViewTest(TopydoTest): ...@@ -34,7 +34,7 @@ class ViewTest(TopydoTest):
todofilter = Filter.GrepFilter('+Project') todofilter = Filter.GrepFilter('+Project')
view = todolist.view(sorter, [todofilter]) view = todolist.view(sorter, [todofilter])
self.assertEquals(str(view), todolist_to_string(ref)) self.assertEqual(str(view), todolist_to_string(ref))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment