From 99e7e322f1304515fe822e3db621dacf21dc76e5 Mon Sep 17 00:00:00 2001 From: Matt Snider Date: Sat, 30 Mar 2019 18:31:47 +0100 Subject: [PATCH] Add tests for priority conversions --- tests/test_priority.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/test_priority.py diff --git a/tests/test_priority.py b/tests/test_priority.py new file mode 100644 index 0000000..7414f61 --- /dev/null +++ b/tests/test_priority.py @@ -0,0 +1,20 @@ +""" Priority Tests + +Test conversions between Todoist and Taskwarrior priorities. +""" +import pytest +from todoist_taskwarrior import utils + + +def test_priorities(): + assert utils.parse_priority(1) == None + assert utils.parse_priority(2) == 'L' + assert utils.parse_priority(3) == 'M' + assert utils.parse_priority(4) == 'H' + +def test_priorities_str(): + assert utils.parse_priority('1') == None + assert utils.parse_priority('2') == 'L' + assert utils.parse_priority('3') == 'M' + assert utils.parse_priority('4') == 'H' +