Esempio n. 1
0
    def test_list8(self):
        command = ListCommand(["--", "-project1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        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, "")
Esempio n. 2
0
    def test_list_format47(self):
        command = ListCommand(["-x", "-F", "%(r)"], self.todolist, self.out, self.error)
        command.execute()

        error = 'Error while parsing format string (list_format config option or -F)\n'
        self.assertEqual(self.output, '')
        self.assertEqual(self.errors, error)
Esempio n. 3
0
    def test_list7(self):
        command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        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, "")
Esempio n. 4
0
    def test_list41(self):
        command = ListCommand(["-z", "Zzz"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "option -z not recognized\n")
Esempio n. 5
0
    def test_list05(self):
        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  1| (C) 2015-11-05 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, "")
Esempio n. 6
0
    def test_list15(self):
        command = ListCommand(["p:<10"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 7
0
    def test_list35(self):
        """ -x flag takes precedence over -n """
        command = ListCommand(["-x", "-n", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|1| (C) 2015-11-05 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|7| hidden item h:1\n|6| x 2014-12-12 Completed but with date:2014-12-12\n")
        self.assertEqual(self.errors, "")
Esempio n. 8
0
    def test_list33(self):
        """ Negative values result in showing all relevent todos. """
        command = ListCommand(["-n", "-1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 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, "")
Esempio n. 9
0
    def test_list4(self):
        command = ListCommand(["-x", "Context1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  3| (C) Baz @Context1 +Project1 key:value\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 10
0
    def test_list18(self):
        command = ListCommand(["-x", "date:2014-12-12"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
Esempio n. 11
0
    def test_list31(self):
        """ Don't show any todos with -n 0 """
        command = ListCommand(["-n", "0"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
Esempio n. 12
0
    def test_list06(self):
        command = ListCommand(["Project3"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
Esempio n. 13
0
    def test_list15(self):
        command = ListCommand(["p:<10"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 14
0
    def test_list17(self):
        command = ListCommand(["-x", "id:"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  3| (C) Baz @Context1 +Project1 key:value\n")
        self.assertEqual(self.errors, "")
Esempio n. 15
0
    def test_group8(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g", "project,desc:context", "test_group8"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A, Context: B
======================
|15| Inner sort 2 +A @B test:test_group8

Project: A, Context: A
======================
|14| Inner sort 1 +A @A test:test_group8

Project: B, Context: B
======================
|17| Inner sort 4 +B @B test:test_group8

Project: B, Context: A
======================
|16| Inner sort 3 +B @A test:test_group8
""")
Esempio n. 16
0
    def test_list10(self):
        command = ListCommand(["text1", "2"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 17
0
    def test_list09(self):
        command = ListCommand(["--", "-project1", "-Drink"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 18
0
    def test_list_format47(self):
        command = ListCommand(["-x", "-F", "%(r)"], self.todolist, self.out, self.error)
        command.execute()

        error = 'Error while parsing format string (list_format config option or -F)\n'
        self.assertEqual(self.output, '')
        self.assertEqual(self.errors, error)
Esempio n. 19
0
    def test_group1(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-g", "project", "test:test_group1"], todolist,
                              self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(
            self.output, """\
Project: A
==========
| 1| +A only test:test_group1
| 3| +A and +B test:test_group1

Project: B
==========
| 3| +A and +B test:test_group1
| 2| +B only test:test_group1

Project: None
=============
| 4| No project test:test_group1
""")
Esempio n. 20
0
    def test_list05(self):
        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|1| (C) 2015-11-05 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|7| hidden item h:1\n|6| x 2014-12-12 Completed but with date:2014-12-12\n")
        self.assertEqual(self.errors, "")
Esempio n. 21
0
    def test_group11(self):
        config(p_overrides={('sort', 'group_string'): 'project'})
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["test:test_group1"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A
==========
| 1| +A only test:test_group1
| 3| +A and +B test:test_group1

Project: B
==========
| 3| +A and +B test:test_group1
| 2| +B only test:test_group1

Project: None
=============
| 4| No project test:test_group1
""")
        self.assertEqual(self.errors, "")
Esempio n. 22
0
    def test_group8(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g", "project,desc:context", "test_group8"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A, Context: B
======================
|15| Inner sort 2 +A @B test:test_group8

Project: A, Context: A
======================
|14| Inner sort 1 +A @A test:test_group8

Project: B, Context: B
======================
|17| Inner sort 4 +B @B test:test_group8

Project: B, Context: A
======================
|16| Inner sort 3 +B @A test:test_group8
""")
Esempio n. 23
0
    def test_list32(self):
        """ Only show the top todo. """
        command = ListCommand(["-n", "1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 24
0
    def test_list01(self):
        command = ListCommand([""], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|1| (C) 2015-11-05 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, "")
Esempio n. 25
0
    def test_list31(self):
        """ Don't show any todos with -n 0 """
        command = ListCommand(["-n", "0"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
Esempio n. 26
0
    def test_group11(self):
        config(p_overrides={('sort', 'group_string'): 'project'})
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["test:test_group1"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A
==========
| 1| +A only test:test_group1
| 3| +A and +B test:test_group1

Project: B
==========
| 3| +A and +B test:test_group1
| 2| +B only test:test_group1

Project: None
=============
| 4| No project test:test_group1
""")
        self.assertEqual(self.errors, "")
Esempio n. 27
0
    def test_list32(self):
        """ Only show the top todo. """
        command = ListCommand(["-n", "1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 28
0
    def test_list42(self):
        command = ListCommand(["-x", "+Project1", "-id:1"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 29
0
    def test_list18(self):
        command = ListCommand(["-x", "date:2014-12-12"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|6| x 2014-12-12 Completed but with date:2014-12-12\n")
Esempio n. 30
0
    def test_list33(self):
        """ Negative values result in showing all relevent todos. """
        command = ListCommand(["-n", "-1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|1| (C) 2015-11-05 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, "")
Esempio n. 31
0
    def test_list35(self):
        """ -x flag takes precedence over -n """
        command = ListCommand(["-x", "-n", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 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, "")
Esempio n. 32
0
    def test_list01(self):
        command = ListCommand([""], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  1| (C) 2015-11-05 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, "")
Esempio n. 33
0
    def test_help(self):
        command = ListCommand(["help"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors,
                         command.usage() + "\n\n" + command.help() + "\n")
Esempio n. 34
0
    def test_list43(self):
        """Test basic 'N' parameter."""
        command = ListCommand(["-N"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 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, "")
Esempio n. 35
0
    def test_list42(self):
        command = ListCommand(["-x", "+Project1", "-id:1"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 36
0
    def test_list10(self):
        command = ListCommand(["text1", "2"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 37
0
    def test_list39(self):
        config("test/data/todolist-uid.conf")

        command = ListCommand(["-i", "t5c,foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|t5c| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 38
0
    def test_list08(self):
        command = ListCommand(["--", "-project1"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        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, "")
Esempio n. 39
0
    def test_list04(self):
        command = ListCommand(["-x", "Context1"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|3| (C) Baz @Context1 +Project1 key:value\n|2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
Esempio n. 40
0
    def test_list06(self):
        command = ListCommand(["Project3"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
Esempio n. 41
0
    def test_list07(self):
        command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|3| (C) Baz @Context1 +Project1 key:value\n|1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 42
0
    def test_list39(self):
        config("test/data/todolist-uid.conf")

        command = ListCommand(["-i", "t5c,foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|t5c| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 43
0
    def test_list34(self):
        """ Test non-integer value for -n """
        config(p_overrides={('ls', 'list_limit'): '2'})

        command = ListCommand(["-n", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n|4| (C) Drink beer @ home\n")
        self.assertEqual(self.errors, "")
Esempio n. 44
0
    def test_list11(self):
        config("test/data/listcommand.conf")

        command = ListCommand(["project"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 45
0
    def test_list16(self):
        config("test/data/todolist-uid.conf")

        command = ListCommand([], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|t5c| (C) 2015-11-05 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.errors, "")
Esempio n. 46
0
    def test_list34(self):
        """ Test non-integer value for -n """
        config(p_overrides={('ls', 'list_limit'): '2'})

        command = ListCommand(["-n", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n|  4| (C) Drink beer @ home\n")
        self.assertEqual(self.errors, "")
Esempio n. 47
0
    def test_list16(self):
        config("test/data/todolist-uid.conf")

        command = ListCommand([], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|t5c| (C) 2015-11-05 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.errors, "")
Esempio n. 48
0
    def test_list17(self):
        command = ListCommand(["-x", "id:"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output,
                         "|  3| (C) Baz @Context1 +Project1 key:value\n")
        self.assertEqual(self.errors, "")
Esempio n. 49
0
    def test_list12(self):
        config("test/data/listcommand.conf")

        command = ListCommand(["-x", "project"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        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.assertEqual(self.errors, "")
Esempio n. 50
0
    def test_list14(self):
        config("test/data/listcommand2.conf")

        command = ListCommand([], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, " |1| (C) 2015-11-05 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, "")
Esempio n. 51
0
    def test_list37(self):
        command = ListCommand(["-i", "1,foo,3"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(
            self.output,
            "|  1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n|  3| (C) Baz @Context1 +Project1 key:value\n",
        )
        self.assertEqual(self.errors, "")
Esempio n. 52
0
    def test_list43(self, mock_terminal_size):
        """Test basic 'N' parameter."""
        mock_terminal_size.return_value = self.terminal_size(81, 100)

        command = ListCommand(["-N"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|1| (C) 2015-11-05 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, "")
Esempio n. 53
0
    def test_list11(self):
        config("test/data/listcommand.conf")

        command = ListCommand(["project"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
Esempio n. 54
0
    def test_list22(self):
        """ Handle tag lists with spaces and punctuation."""
        config(p_overrides={('ls', 'hide_tags'): 'p, id'})
        self.todolist = load_file_to_todolist('test/data/ListCommandTagTest.txt')

        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, '|1| Foo.\n')
Esempio n. 55
0
    def test_group10(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "option -g requires argument\n")
Esempio n. 56
0
    def test_list22(self):
        """ Handle tag lists with spaces and punctuation."""
        config(p_overrides={('ls', 'hide_tags'): 'p, id'})
        self.todolist = load_file_to_todolist('test/data/ListCommandTagTest.txt')

        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, '|  1| Foo.\n')
Esempio n. 57
0
    def test_group10(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "option -g requires argument\n")
Esempio n. 58
0
    def test_list_unicode1(self):
        """ Unicode filters."""
        command = ListCommand([u"\u25c4"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)

        expected = u"|1| (C) And some sp\u00e9cial tag:\u25c4\n"

        self.assertEqual(self.output, expected)
Esempio n. 59
0
    def test_list37(self):
        command = ListCommand(["-i", "1,foo,3"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertEqual(
            self.output,
            "|1| (C) 2015-11-05 Foo @Context2 Not@Context +Project1 Not+Project\n|3| (C) Baz @Context1 +Project1 key:value\n"
        )
        self.assertEqual(self.errors, "")
Esempio n. 60
0
    def test_list12(self):
        config("test/data/listcommand.conf")

        command = ListCommand(["-x", "project"], self.todolist, self.out,
                              self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|1| (C) 2015-11-05 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.errors, "")