Commit b76b1dbd authored by Bram Schoenmakers's avatar Bram Schoenmakers

Merge pull request #74 from mruwek/importance-test

Update tests for Importance
parents f690dcdc 10b3b4c3
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from datetime import date from datetime import date, timedelta
from test.topydo_testcase import TopydoTest from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config from topydo.lib.Config import config
...@@ -41,5 +41,17 @@ class ImportanceTest(TopydoTest): ...@@ -41,5 +41,17 @@ class ImportanceTest(TopydoTest):
todo = Todo("(C) Foo " + config().tag_due() + ":" + today_str) todo = Todo("(C) Foo " + config().tag_due() + ":" + today_str)
self.assertEqual(importance(todo), 8) self.assertEqual(importance(todo), 8)
def test_importance5(self):
due = date.today() + timedelta(8)
due_str = due.isoformat()
todo = Todo("(C) Foo " + config().tag_due() + ":" + due_str)
self.assertEqual(importance(todo), 4)
def test_importance6(self):
due = date.today() + timedelta(4)
due_str = due.isoformat()
todo = Todo("(C) Foo " + config().tag_due() + ":" + due_str)
self.assertEqual(importance(todo), 5)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
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