Esempio n. 1
0
    def test_append(self):
        todo.addm_todo("\n".join(self._test_lines_no_pri(self.num)))

        for i in range(1, self.num + 1):
            todo.append_todo([str(i), "testing", "append"])

        self.assertNumLines(self.num, "Test\s\d+\stesting\sappend")
Esempio n. 2
0
    def test_append(self):
        todo.addm_todo("\n".join(self._test_lines_no_pri(self.num)))

        for i in range(1, self.num + 1):
            todo.append_todo([str(i), "testing", "append"])

        self.assertNumLines(self.num, "Test\s\d+\stesting\sappend")
Esempio n. 3
0
    def test_del(self):
        todo.addm_todo("\n".join(self._test_lines_no_pri(self.num)))
        ran = random.Random()

        for i in range(self.num, 0, -1):
            j = ran.randint(1, i)
            todo.delete_todo(str(j))

        self.assertNumLines(0)
Esempio n. 4
0
    def test_deprioritize(self):
        todo.addm_todo("\n".join(self._test_lines_pri(self.num)))

        for i in range(0, self.num):
            todo.de_prioritize_todo(str(i + 1))

        self.assertNumLines(self.num, "Test\s\d+")

        for i in range(0, self.num):
            todo.de_prioritize_todo(str(i + 1))

        self.assertNumLines(self.num, "Test\s\d+")
Esempio n. 5
0
    def test_deprioritize(self):
        todo.addm_todo("\n".join(self._test_lines_pri(self.num)))

        for i in range(0, self.num):
            todo.de_prioritize_todo(str(i + 1))

        self.assertNumLines(self.num, "Test\s\d+")

        for i in range(0, self.num):
            todo.de_prioritize_todo(str(i + 1))

        self.assertNumLines(self.num, "Test\s\d+")
Esempio n. 6
0
    def test_prioritize(self):
        todo.addm_todo("\n".join(self._test_lines_no_pri(self.num)))

        n = len(todo.PRIORITIES)
        for i in range(0, self.num):
            todo.prioritize_todo([str(i + 1), todo.PRIORITIES[i % n]])

        self.assertNumLines(self.num, "\([A-X]\)\sTest\s\d+")

        for i in range(0, self.num):
            todo.prioritize_todo([str(i + 1), todo.PRIORITIES[-i % n]])

        self.assertNumLines(self.num, "\([A-X]\)\sTest\s\d+")

        for i in range(0, self.num):
            todo.de_prioritize_todo(str(i + 1))

        self.assertNumLines(0, "\([A-X]\)\sTest\s\d+")

        for i in range(0, self.num):
            todo.prioritize_todo([str(i + 1), todo.PRIORITIES[-i % n]])

        self.assertNumLines(self.num, "\([A-X]\)\sTest\s\d+")
Esempio n. 7
0
    def test_prioritize(self):
        todo.addm_todo("\n".join(self._test_lines_no_pri(self.num)))

        n = len(todo.PRIORITIES)
        for i in range(0, self.num):
            todo.prioritize_todo([str(i + 1), todo.PRIORITIES[i % n]])

        self.assertNumLines(self.num, "\([A-X]\)\sTest\s\d+")

        for i in range(0, self.num):
            todo.prioritize_todo([str(i + 1), todo.PRIORITIES[-i % n]])

        self.assertNumLines(self.num, "\([A-X]\)\sTest\s\d+")

        for i in range(0, self.num):
            todo.de_prioritize_todo(str(i + 1))

        self.assertNumLines(0, "\([A-X]\)\sTest\s\d+")

        for i in range(0, self.num):
            todo.prioritize_todo([str(i + 1), todo.PRIORITIES[-i % n]])

        self.assertNumLines(self.num, "\([A-X]\)\sTest\s\d+")
Esempio n. 8
0
 def addm_todo_with_pri(self, n):
     todo.addm_todo("\n".join(self._test_lines_pri(n)))
Esempio n. 9
0
 def test_project(self):
     todo.addm_todo("\n".join(self._test_lines_project(self.num)))
     colored, sorted = todo._list_("project", "\+(\w+)")
     self.assert_not_equal(colored, sorted)
     self.assert_labeled(colored, sorted)
Esempio n. 10
0
 def test_context(self):
     todo.addm_todo("\n".join(self._test_lines_context(self.num)))
     colored, sorted = todo._list_("context", "@(\w+)")
     self.assert_not_equal(colored, sorted)
     self.assert_labeled(colored, sorted)
Esempio n. 11
0
 def test_dated(self):
     todo.addm_todo("\n".join(self._test_lines_date(self.num)))
     colored, sorted = todo._list_("date", "#\{(\d{4})-(\d{1,2})-(\d{1,2})\}")
     self.assert_not_equal(colored, sorted)
     self.assert_dated(colored, sorted)
Esempio n. 12
0
 def addm_todo(self, n):
     todo.addm_todo("\n".join(self._test_lines_no_pri(n)))
Esempio n. 13
0
 def addm_todo_with_pri(self, n):
     todo.addm_todo("\n".join(self._test_lines_pri(n)))
Esempio n. 14
0
 def addm_todo(self, n):
     todo.addm_todo("\n".join(self._test_lines_no_pri(n)))