Commit 590f0e74 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Surround todo identifier with bars in output.

parent 241aa3e9
......@@ -113,7 +113,7 @@ class AddCommandTest(CommandTest.CommandTest):
self.assertFalse(self.todolist.todo(1).has_tag("after"))
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo")
self.assertEquals(self.output, " 1 " + str(self.todolist.todo(1)) + "\n")
self.assertEquals(self.output, "| 1| " + str(self.todolist.todo(1)) + "\n")
self.assertEquals(self.errors, "")
def test_add_dep4(self):
......@@ -123,7 +123,7 @@ class AddCommandTest(CommandTest.CommandTest):
self.assertFalse(self.todolist.todo(1).has_tag("after"))
self.assertEquals(self.todolist.todo(1).source(), self.today + " Foo")
self.assertEquals(self.output, " 1 " + str(self.todolist.todo(1)) + "\n")
self.assertEquals(self.output, "| 1| " + str(self.todolist.todo(1)) + "\n")
self.assertEquals(self.errors, "")
def test_add_dep5(self):
......@@ -167,7 +167,7 @@ class AddCommandTest(CommandTest.CommandTest):
command = AddCommand.AddCommand(["Foo t:today due:today"], self.todolist, self.out, self.error)
command.execute()
result = " 1 %s Foo t:%s due:%s\n" % (self.today, self.today, self.today)
result = "| 1| %s Foo t:%s due:%s\n" % (self.today, self.today, self.today)
self.assertEquals(self.output, result)
self.assertEquals(self.errors, "")
......
......@@ -27,7 +27,7 @@ class AppendCommandTest(CommandTest.CommandTest):
command = AppendCommand.AppendCommand([1, "Bar"], self.todolist, self.out, self.error)
command.execute()
self.assertEqual(self.output, " 1 Foo Bar\n")
self.assertEqual(self.output, "| 1| Foo Bar\n")
self.assertEqual(self.errors, "")
def test_append2(self):
......@@ -55,7 +55,7 @@ class AppendCommandTest(CommandTest.CommandTest):
command = AppendCommand.AppendCommand([1, "Bar", "Baz"], self.todolist, self.out, self.error)
command.execute()
self.assertEqual(self.output, " 1 Foo Bar Baz\n")
self.assertEqual(self.output, "| 1| Foo Bar Baz\n")
self.assertEqual(self.errors, "")
def test_append6(self):
......
......@@ -33,7 +33,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Bar")
self.assertEquals(self.output, " 2 Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "")
def test_del1_regex(self):
......@@ -42,7 +42,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Bar")
self.assertEquals(self.output, " 2 Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "")
def test_del2(self):
......@@ -51,7 +51,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.count(), 0)
self.assertEquals(self.output, " 2 Bar p:1\nRemoved: Bar\nRemoved: Foo\n")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Bar\nRemoved: Foo\n")
self.assertEquals(self.errors, "")
def test_del3(self):
......@@ -60,7 +60,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.count(), 1) # force won't delete subtasks
self.assertEquals(self.output, " 2 Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "")
def test_del4(self):
......@@ -69,7 +69,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.count(), 1) # force won't delete subtasks
self.assertEquals(self.output, " 2 Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.output, "| 2| Bar p:1\nRemoved: Foo id:1\n")
self.assertEquals(self.errors, "")
def test_del5(self):
......
......@@ -165,7 +165,7 @@ class DepCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 Bar p:1\n 3 Baz p:1\n")
self.assertEquals(self.output, "| 2| Bar p:1\n| 3| Baz p:1\n")
self.assertEquals(self.errors, "")
def test_ls2(self):
......@@ -181,7 +181,7 @@ class DepCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1 Foo id:1\n")
self.assertEquals(self.output, "| 1| Foo id:1\n")
self.assertEquals(self.errors, "")
def test_ls4(self):
......
......@@ -58,7 +58,7 @@ class DoCommandTest(CommandTest.CommandTest):
command = DoCommand.DoCommand(["1"], self.todolist, self.out, self.error, _yes_prompt)
command.execute()
result = " 2 Bar p:1\n 3 Baz p:1\nCompleted: x %s Bar p:1\nCompleted: x %s Baz p:1\nCompleted: x %s Foo id:1\n" % (self.today, self.today, self.today)
result = "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x %s Bar p:1\nCompleted: x %s Baz p:1\nCompleted: x %s Foo id:1\n" % (self.today, self.today, self.today)
for number in [1, 2, 3]:
self.assertTrue(self.todolist.todo(number).is_completed())
......@@ -72,7 +72,7 @@ class DoCommandTest(CommandTest.CommandTest):
command = DoCommand.DoCommand(["1"], self.todolist, self.out, self.error, _no_prompt)
command.execute()
result = " 2 Bar p:1\n 3 Baz p:1\nCompleted: x %s Foo id:1\n" % self.today
result = "| 2| Bar p:1\n| 3| Baz p:1\nCompleted: x %s Foo id:1\n" % self.today
self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(1).is_completed())
......@@ -121,7 +121,7 @@ class DoCommandTest(CommandTest.CommandTest):
self._recurrence_helper(["4"])
self.assertTrue(self.todolist.todo(4).is_completed())
result = " 9 %s Recurring! rec:1d due:%s\nCompleted: x %s Recurring! rec:1d\n" % (self.today, self.tomorrow, self.today)
result = "| 9| %s Recurring! rec:1d due:%s\nCompleted: x %s Recurring! rec:1d\n" % (self.today, self.tomorrow, self.today)
self.assertEquals(self.output, result)
todo = self.todolist.todo(8)
......@@ -130,13 +130,13 @@ class DoCommandTest(CommandTest.CommandTest):
def test_strict_recurrence1(self):
self._recurrence_helper(["-s", "8"])
result = " 9 2014-11-19 Strict due:2014-01-02 rec:1d\nCompleted: x 2014-11-19 Strict due:2014-01-01 rec:1d\n"
result = "| 9| 2014-11-19 Strict due:2014-01-02 rec:1d\nCompleted: x 2014-11-19 Strict due:2014-01-01 rec:1d\n"
self.assertEquals(self.output, result)
def test_strict_recurrence2(self):
self._recurrence_helper(["--strict", "8"])
result = " 9 2014-11-19 Strict due:2014-01-02 rec:1d\nCompleted: x 2014-11-19 Strict due:2014-01-01 rec:1d\n"
result = "| 9| 2014-11-19 Strict due:2014-01-02 rec:1d\nCompleted: x 2014-11-19 Strict due:2014-01-01 rec:1d\n"
self.assertEquals(self.output, result)
def test_invalid1(self):
......@@ -208,7 +208,7 @@ class DoCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_do_custom_date3(self):
......
......@@ -32,7 +32,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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 p:1\n")
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 p:1\n")
self.assertEquals(self.errors, "")
def test_list3(self):
......@@ -40,7 +40,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list4(self):
......@@ -48,7 +48,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 3 (C) Baz @Context1 +Project1 key:value id:1\n 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 3| (C) Baz @Context1 +Project1 key:value id:1\n| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list5(self):
......@@ -56,7 +56,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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 id:1\n 4 (C) Drink beer @ home\n 5 (C) 13 + 29 = 42\n 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value id:1\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list6(self):
......@@ -72,7 +72,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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.assertEquals(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, "")
def test_list8(self):
......@@ -80,7 +80,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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 p:1\n")
self.assertEquals(self.output, "| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list9(self):
......@@ -88,7 +88,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 5 (C) 13 + 29 = 42\n 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 5| (C) 13 + 29 = 42\n| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list10(self):
......@@ -96,7 +96,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list11(self):
......@@ -106,7 +106,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1 (C) Foo @Context2 Not@Context +Project1 Not+Project\n")
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n")
self.assertEquals(self.errors, "")
def test_list12(self):
......@@ -116,7 +116,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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 id:1\n 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value id:1\n| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list13(self):
......@@ -124,7 +124,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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 id:1\n 4 (C) Drink beer @ home\n 5 (C) 13 + 29 = 42\n")
self.assertEquals(self.output, "| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project\n| 3| (C) Baz @Context1 +Project1 key:value id:1\n| 4| (C) Drink beer @ home\n| 5| (C) 13 + 29 = 42\n")
self.assertEquals(self.errors, "")
def test_list14(self):
......@@ -134,7 +134,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
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 p:1\n")
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 p:1\n")
self.assertEquals(self.errors, "")
def test_list15(self):
......@@ -142,7 +142,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "| 2| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list16(self):
......@@ -152,7 +152,7 @@ class ListCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "6iu (C) Foo @Context2 Not@Context +Project1 Not+Project\ntil (C) Drink beer @ home\n c5 (C) 13 + 29 = 42\nxvb (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.output, "|6iu| (C) Foo @Context2 Not@Context +Project1 Not+Project\n|til| (C) Drink beer @ home\n| c5| (C) 13 + 29 = 42\n|xvb| (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_help(self):
......
......@@ -45,7 +45,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1 Foo due:%s\n" % due.isoformat())
self.assertEquals(self.output, "| 1| Foo due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "")
def test_postpone2(self):
......@@ -55,7 +55,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 Bar due:%s\n" % due.isoformat())
self.assertEquals(self.output, "| 2| Bar due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "")
def test_postpone3(self):
......@@ -65,7 +65,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 Bar due:%s\n" % due.isoformat())
self.assertEquals(self.output, "| 2| Bar due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "")
def test_postpone4(self):
......@@ -75,7 +75,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 3 Baz due:%s t:%s\n" % (due.isoformat(), self.start.isoformat()))
self.assertEquals(self.output, "| 3| Baz due:%s t:%s\n" % (due.isoformat(), self.start.isoformat()))
self.assertEquals(self.errors, "")
def test_postpone5(self):
......@@ -86,7 +86,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
start = self.start + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 3 Baz due:%s t:%s\n" % (due.isoformat(), start.isoformat()))
self.assertEquals(self.output, "| 3| Baz due:%s t:%s\n" % (due.isoformat(), start.isoformat()))
self.assertEquals(self.errors, "")
def test_postpone6(self):
......@@ -96,7 +96,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 4 Past due:%s\n" % due.isoformat())
self.assertEquals(self.output, "| 4| Past due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "")
def test_postpone7(self):
......@@ -106,7 +106,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.future + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 5 Future due:%s t:%s\n" % (due.isoformat(), self.future_start.isoformat()))
self.assertEquals(self.output, "| 5| Future due:%s t:%s\n" % (due.isoformat(), self.future_start.isoformat()))
self.assertEquals(self.errors, "")
def test_postpone8(self):
......@@ -117,7 +117,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
start = self.future_start + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 5 Future due:%s t:%s\n" % (due.isoformat(), start.isoformat()))
self.assertEquals(self.output, "| 5| Future due:%s t:%s\n" % (due.isoformat(), start.isoformat()))
self.assertEquals(self.errors, "")
def test_postpone9(self):
......@@ -159,7 +159,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
due = self.today + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1 Foo due:%s\n" % due.isoformat())
self.assertEquals(self.output, "| 1| Foo due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "")
def test_help(self):
......
......@@ -34,7 +34,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertEquals(self.todolist.todo(1).source(), "Foo due:2014-10-22")
self.assertEquals(self.output, " 1 Foo due:2014-10-22\n")
self.assertEquals(self.output, "| 1| Foo due:2014-10-22\n")
self.assertEquals(self.errors, "")
self.assertTrue(self.todolist.is_dirty())
......@@ -43,7 +43,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertEquals(self.todolist.todo(1).source(), "Foo due:2014-10-22")
self.assertEquals(self.output, " 1 Foo due:2014-10-22\n")
self.assertEquals(self.output, "| 1| Foo due:2014-10-22\n")
self.assertEquals(self.errors, "")
self.assertTrue(self.todolist.is_dirty())
......@@ -52,7 +52,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertEquals(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.assertEquals(self.output, "| 2| Bar due:2014-10-22 due:2014-10-19\n")
self.assertEquals(self.errors, "")
self.assertTrue(self.todolist.is_dirty())
......@@ -69,7 +69,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 3 Baz due:2014-10-20\n")
self.assertEquals(self.output, "| 3| Baz due:2014-10-20\n")
self.assertEquals(self.errors, "")
def test_set_tag5(self):
......@@ -77,7 +77,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_set_tag6(self):
......@@ -85,7 +85,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_set_tag7(self):
......@@ -93,7 +93,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_set_tag8(self):
......@@ -101,7 +101,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_set_tag9(self):
......@@ -109,7 +109,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_set_tag10(self):
......@@ -117,7 +117,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 4 Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEquals(self.output, "| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEquals(self.errors, "")
def test_rm_tag1(self):
......@@ -125,7 +125,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 1 Foo\n")
self.assertEquals(self.output, "| 1| Foo\n")
self.assertEquals(self.errors, "")
def test_rm_tag2(self):
......@@ -133,7 +133,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 Bar\n")
self.assertEquals(self.output, "| 2| Bar\n")
self.assertEquals(self.errors, "")
def test_rm_tag3(self):
......@@ -141,7 +141,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n 4 Fnord\n")
self.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord\n")
self.assertEquals(self.errors, "")
def test_rm_tag4(self):
......@@ -149,7 +149,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.assertEquals(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-22\n")
self.assertEquals(self.errors, "")
def test_rm_tag6(self):
......@@ -157,7 +157,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_rm_tag7(self):
......@@ -165,7 +165,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
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.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.assertEquals(self.errors, "")
def test_rm_tag8(self):
......@@ -189,7 +189,7 @@ class TagCommandTest(CommandTest.CommandTest):
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 4 Fnord\n")
self.assertEquals(self.output, "| 4| Fnord\n")
self.assertEquals(self.errors, "")
def test_help(self):
......
......@@ -201,9 +201,9 @@ class TodoListBase(object):
printed todo.
"""
if config().identifiers() == 'text':
return lambda p_todo_str, p_todo: "%3s %s" % (self._todo_id_map[p_todo], p_todo_str)
return lambda p_todo_str, p_todo: "|%3s| %s" % (self._todo_id_map[p_todo], p_todo_str)
else:
return lambda p_todo_str, p_todo: "%3d %s" % (self.number(p_todo), p_todo_str)
return lambda p_todo_str, p_todo: "|%3d| %s" % (self.number(p_todo), p_todo_str)
def _update_todo_ids(self):
# the idea is to have a hash that is independent of the position of the
......
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