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+")
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+")