Commit 842ff3ad authored by MinchinWeb's avatar MinchinWeb

tests: add leading zero the the name of select testcases, so they still sort alphabetically

parent 7af6e77f
......@@ -87,7 +87,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo(1).source(), "(C) " + self.today + " Foo")
self.assertEqual(self.errors, "")
def test_add_dep1(self):
def test_add_dep01(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
command.execute()
......@@ -98,7 +98,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar p:1")
self.assertEqual(self.errors, "")
def test_add_dep2(self):
def test_add_dep02(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
command.execute()
......@@ -109,7 +109,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar p:1")
self.assertEqual(self.errors, "")
def test_add_dep3(self):
def test_add_dep03(self):
command = AddCommand.AddCommand(["Foo"], self.todolist)
command.execute()
......@@ -120,7 +120,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo(2).source(), self.today + " Bar id:1")
self.assertEqual(self.errors, "")
def test_add_dep4(self):
def test_add_de04(self):
""" Test for using an after: tag with non-existing value. """
command = AddCommand.AddCommand(["Foo after:1"], self.todolist, self.out, self.error)
command.execute()
......@@ -130,7 +130,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.output, "| 1| " + self.todolist.todo(1).source() + "\n")
self.assertEqual(self.errors, "")
def test_add_dep5(self):
def test_add_dep05(self):
""" Test for using an after: tag with non-existing value. """
command = AddCommand.AddCommand(["Foo after:2"], self.todolist, self.out, self.error)
command.execute()
......@@ -140,7 +140,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.output, "| 1| " + self.todolist.todo(1).source() + "\n")
self.assertEqual(self.errors, "")
def test_add_dep6(self):
def test_add_dep06(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
command.execute()
......@@ -155,7 +155,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo(3).source(), self.today + " Baz p:1 p:2")
self.assertEqual(self.errors, "")
def test_add_dep7(self):
def test_add_dep07(self):
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
command.execute()
......@@ -170,7 +170,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo(3).source(), self.today + " Baz id:1")
self.assertEqual(self.errors, "")
def test_add_dep8(self):
def test_add_dep08(self):
config("test/data/todolist-uid.conf")
command = AddCommand.AddCommand(["Foo"], self.todolist, self.out, self.error)
......@@ -182,7 +182,7 @@ class AddCommandTest(CommandTest):
self.assertEqual(self.todolist.todo('7ui').source(), "{} Foo p: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_dep09(self):
"""
The text ID shown after adding and after an 'ls' must be equal."
By appending the parent's projects, the textual ID may change.
......
......@@ -25,14 +25,14 @@ from topydo.lib.Todo import Todo
from test.TopydoTest import TopydoTest
class FilterTest(TopydoTest):
def test_filter3(self):
def test_filter03(self):
todo = Todo("(C) Relevant")
relevance = Filter.RelevanceFilter()
result = relevance.filter([todo])
self.assertEqual(result, [todo])
def test_filter4(self):
def test_filter04(self):
""" Test case insensitive match. """
todos = load_file('test/data/FilterTest1.txt')
grep = Filter.GrepFilter('+project')
......@@ -43,7 +43,7 @@ class FilterTest(TopydoTest):
self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference))
def test_filter5(self):
def test_filter05(self):
""" Test case sensitive match. """
todos = load_file('test/data/FilterTest1.txt')
grep = Filter.GrepFilter('+Project')
......@@ -54,7 +54,7 @@ class FilterTest(TopydoTest):
self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference))
def test_filter6(self):
def test_filter06(self):
""" Test case sensitive match (forced, with lowercase). """
todos = load_file('test/data/FilterTest1.txt')
grep = Filter.GrepFilter('+project', True)
......@@ -65,7 +65,7 @@ class FilterTest(TopydoTest):
self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference))
def test_filter7(self):
def test_filter07(self):
""" Tests the dependency filter. """
todolist = load_file_to_todolist('test/data/FilterTest2.txt')
depfilter = Filter.DependencyFilter(todolist)
......@@ -76,7 +76,7 @@ class FilterTest(TopydoTest):
self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference))
def test_filter8(self):
def test_filter08(self):
""" Test case sensitive match (forced, with lowercase). """
todos = load_file('test/data/FilterTest1.txt')
grep = Filter.GrepFilter('+Project', False)
......@@ -87,7 +87,7 @@ class FilterTest(TopydoTest):
self.assertEqual(todolist_to_string(filtered_todos), \
todolist_to_string(reference))
def test_filter9(self):
def test_filter09(self):
""" Test instance filter """
todos = load_file('test/data/FilterTest1.txt')
instance_filter = Filter.InstanceFilter(todos[2:])
......
......@@ -29,7 +29,7 @@ class ListCommandTest(CommandTest):
super(ListCommandTest, self).setUp()
self.todolist = load_file_to_todolist("test/data/ListCommandTest.txt")
def test_list1(self):
def test_list01(self):
command = ListCommand([""], self.todolist, self.out, self.error)
command.execute()
......@@ -37,7 +37,7 @@ class ListCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_list3(self):
def test_list03(self):
command = ListCommand(["Context1"], self.todolist, self.out, self.error)
command.execute()
......@@ -45,7 +45,7 @@ class ListCommandTest(CommandTest):
self.assertEqual(self.output, "| 2| (D) Bar @Context1 +Project2\n")
self.assertEqual(self.errors, "")
def test_list4(self):
def test_list04(self):
command = ListCommand(["-x", "Context1"], self.todolist, self.out, self.error)
command.execute()
......@@ -53,7 +53,7 @@ class ListCommandTest(CommandTest):
self.assertEqual(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEqual(self.errors, "")
def test_list5(self):
def test_list05(self):
command = ListCommand(["-x"], self.todolist, self.out, self.error)
command.execute()
......@@ -61,7 +61,7 @@ class ListCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_list6(self):
def test_list06(self):
command = ListCommand(["Project3"], self.todolist, self.out, self.error)
command.execute()
......@@ -69,7 +69,7 @@ class ListCommandTest(CommandTest):
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "")
def test_list7(self):
def test_list07(self):
command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist, self.out, self.error)
command.execute()
......@@ -77,7 +77,7 @@ class ListCommandTest(CommandTest):
self.assertEqual(self.output, "| 3| (C) Baz @Context1 +Project1 key:value\n| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n")
self.assertEqual(self.errors, "")
def test_list8(self):
def test_list08(self):
command = ListCommand(["--", "-project1"], self.todolist, self.out, self.error)
command.execute()
......@@ -85,7 +85,7 @@ class ListCommandTest(CommandTest):
self.assertEqual(self.output, "| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2\n")
self.assertEqual(self.errors, "")
def test_list9(self):
def test_list09(self):
command = ListCommand(["--", "-project1", "-Drink"], self.todolist, self.out, self.error)
command.execute()
......
......@@ -42,7 +42,7 @@ class PostponeCommandTest(CommandTest):
self.todolist = TodoList(todos)
def test_postpone1(self):
def test_postpone01(self):
command = PostponeCommand(["1", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -52,7 +52,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 1| Foo due:{}\n".format(due.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone2(self):
def test_postpone02(self):
command = PostponeCommand(["2", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -62,7 +62,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 2| Bar due:{}\n".format(due.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone3(self):
def test_postpone03(self):
command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -72,7 +72,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 2| Bar due:{}\n".format(due.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone4(self):
def test_postpone04(self):
command = PostponeCommand(["3", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -82,7 +82,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), self.start.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone5(self):
def test_postpone05(self):
command = PostponeCommand(["-s", "3", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -94,7 +94,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone6(self):
def test_postpone06(self):
command = PostponeCommand(["4", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -104,7 +104,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 4| Past due:{}\n".format(due.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone7(self):
def test_postpone07(self):
command = PostponeCommand(["5", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -115,7 +115,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), self.future_start.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone8(self):
def test_postpone08(self):
command = PostponeCommand(["-s", "5", "1w"], self.todolist, self.out, self.error)
command.execute()
......@@ -127,7 +127,7 @@ class PostponeCommandTest(CommandTest):
self.assertEqual(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
self.assertEqual(self.errors, "")
def test_postpone9(self):
def test_postpone09(self):
command = PostponeCommand(["1", "foo"], self.todolist, self.out, self.error)
command.execute()
......
......@@ -36,26 +36,26 @@ class SorterTest(TopydoTest):
self.assertEqual(todos_sorted, todos_ref)
self.assertEqual(todolist_to_string(todos), text_before)
def test_sort1(self):
def test_sort01(self):
""" Alphabetically sorted """
sorter = Sorter('text')
self.sort_file('test/data/SorterTest1.txt', 'test/data/SorterTest1-result.txt', sorter)
def test_sort2a(self):
def test_sort02a(self):
"""
Ascendingly sorted by priority. Also checks stableness of the sort.
"""
sorter = Sorter('prio')
self.sort_file('test/data/SorterTest2.txt', 'test/data/SorterTest2-result.txt', sorter)
def test_sort2b(self):
def test_sort02b(self):
"""
Ascendingly sorted by priority. Also checks stableness of the sort.
"""
sorter = Sorter('asc:prio')
self.sort_file('test/data/SorterTest2.txt', 'test/data/SorterTest2-result.txt', sorter)
def test_sort3(self):
def test_sort03(self):
"""
Descendingly sorted by priority. Also checks stableness of the
sort.
......@@ -63,32 +63,32 @@ class SorterTest(TopydoTest):
sorter = Sorter('desc:prio')
self.sort_file('test/data/SorterTest3.txt', 'test/data/SorterTest3-result.txt', sorter)
def test_sort4(self):
def test_sort04(self):
""" Ascendingly sorted by due date """
sorter = Sorter(config().tag_due())
self.sort_file('test/data/SorterTest4.txt', 'test/data/SorterTest4-result.txt', sorter)
def test_sort5(self):
def test_sort05(self):
""" Descendingly sorted by due date """
sorter = Sorter('desc:due')
self.sort_file('test/data/SorterTest5.txt', 'test/data/SorterTest5-result.txt', sorter)
def test_sort6(self):
def test_sort06(self):
""" Ascendingly sorted by creation date """
sorter = Sorter('creation')
self.sort_file('test/data/SorterTest6.txt', 'test/data/SorterTest6-result.txt', sorter)
def test_sort7(self):
def test_sort07(self):
""" Ascendingly sorted by completion date. """
sorter = Sorter('completion')
self.sort_file('test/data/SorterTest7.txt', 'test/data/SorterTest7-result.txt', sorter)
def test_sort8(self):
def test_sort08(self):
""" Descendingly sorted by importance """
sorter = Sorter('desc:importance')
self.sort_file('test/data/SorterTest8.txt', 'test/data/SorterTest8-result.txt', sorter)
def test_sort9(self):
def test_sort09(self):
"""
Sort on multiple levels: first descending importance, then
ascending priority.
......
......@@ -67,7 +67,7 @@ class TagCommandTest(CommandTest):
self.assertFalse(self.output)
self.assertEqual(self.errors, "Invalid todo number.\n")
def test_set_tag4(self):
def test_set_tag04(self):
command = TagCommand(["3", "due", "2014-10-20"], self.todolist, self.out, self.error)
command.execute()
......@@ -75,7 +75,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, "| 3| Baz due:2014-10-20\n")
self.assertEqual(self.errors, "")
def test_set_tag5(self):
def test_set_tag05(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "all")
command.execute()
......@@ -83,7 +83,7 @@ class TagCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_set_tag6(self):
def test_set_tag06(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "1")
command.execute()
......@@ -91,7 +91,7 @@ class TagCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_set_tag7(self):
def test_set_tag07(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "2")
command.execute()
......@@ -99,7 +99,7 @@ class TagCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_set_tag8(self):
def test_set_tag08(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "")
command.execute()
......@@ -107,7 +107,7 @@ class TagCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_set_tag9(self):
def test_set_tag09(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist, self.out, self.error, lambda t: "99")
command.execute()
......@@ -123,7 +123,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, "| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEqual(self.errors, "")
def test_rm_tag1(self):
def test_rm_tag01(self):
command = TagCommand(["1", "due"], self.todolist, self.out, self.error)
command.execute()
......@@ -131,7 +131,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, "| 1| Foo\n")
self.assertEqual(self.errors, "")
def test_rm_tag2(self):
def test_rm_tag02(self):
command = TagCommand(["2", "due"], self.todolist, self.out, self.error)
command.execute()
......@@ -139,7 +139,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, "| 2| Bar\n")
self.assertEqual(self.errors, "")
def test_rm_tag3(self):
def test_rm_tag03(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "all")
command.execute()
......@@ -147,7 +147,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord\n")
self.assertEqual(self.errors, "")
def test_rm_tag4(self):
def test_rm_tag04(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "1")
command.execute()
......@@ -155,7 +155,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-22\n")
self.assertEqual(self.errors, "")
def test_rm_tag6(self):
def test_rm_tag06(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "99")
command.execute()
......@@ -163,7 +163,7 @@ class TagCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_rm_tag7(self):
def test_rm_tag07(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error, lambda t: "A")
command.execute()
......@@ -171,7 +171,7 @@ class TagCommandTest(CommandTest):
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.assertEqual(self.errors, "")
def test_rm_tag8(self):
def test_rm_tag08(self):
command = TagCommand(["5", "due"], self.todolist, self.out, self.error)
command.execute()
......@@ -179,7 +179,7 @@ class TagCommandTest(CommandTest):
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "Invalid todo number.\n")
def test_rm_tag9(self):
def test_rm_tag09(self):
command = TagCommand(["A", "due"], self.todolist, self.out, self.error)
command.execute()
......
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