--- a/.hgignore Fri Jun 17 21:21:13 2016 +0800
+++ b/.hgignore Fri Jun 17 21:23:45 2016 +0800
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dev-requirements.txt Fri Jun 17 21:23:45 2016 +0800
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/run-tests.py Fri Jun 17 21:23:45 2016 +0800
+if __name__ == '__main__':
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_models.py Fri Jun 17 21:23:45 2016 +0800
+from datetime import datetime, timedelta
+from candolint.models import Check
+ check = Check(started=now)
+ check.finished = now + timedelta(seconds=10)
+ assert check.get_duration() == '10 sec'
+ check.finished = now + timedelta(minutes=5)
+ assert check.get_duration() == '5 min'
+ check.finished = now + timedelta(hours=2)
+ assert check.get_duration() == '120 min'