Skip to content

Commit ee8f661

Browse files
Merge pull request #20 from AlexanderWillner/main
added more tests and showing html result
2 parents 856d560 + b417618 commit ee8f661

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ test: ## Test the code
3030
@coverage erase
3131
@coverage run -a -m $(SRC_TEST).test_things
3232
@coverage report
33+
@coverage html
3334

3435
.PHONY: doc
3536
doc: ## Document the code

tests/test_things.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,21 @@ def test_upcoming(self):
2323
tasks = api.upcoming(filepath=DEMO_FILEPATH)
2424
self.assertEqual(2, len(tasks))
2525

26+
def test_due(self):
27+
"""Test due."""
28+
tasks = api.due(filepath=DEMO_FILEPATH)
29+
self.assertEqual(1, len(tasks))
30+
2631
def test_today(self):
2732
"""Test today."""
2833
tasks = api.today(filepath=DEMO_FILEPATH)
2934
self.assertEqual(1, len(tasks))
3035

36+
def test_get(self):
37+
"""Test get."""
38+
tasks = api.get('wrong_uuid', filepath=DEMO_FILEPATH)
39+
self.assertEqual(None, tasks)
40+
3141
def test_todos(self):
3242
"""Test all tasks."""
3343
tasks = api.todos(start="Anytime", filepath=DEMO_FILEPATH)
@@ -36,8 +46,12 @@ def test_todos(self):
3646
self.assertEqual(6, len(tasks))
3747
tasks = api.todos(status="completed", filepath=DEMO_FILEPATH)
3848
self.assertEqual(10, len(tasks))
49+
tasks = api.todos(include_items=True, filepath=DEMO_FILEPATH)
50+
self.assertEqual(9, len(tasks))
3951
with self.assertRaises(ValueError):
4052
api.todos(status="wrong_value", filepath=DEMO_FILEPATH)
53+
tasks = api.tasks('A2oPvtt4dXoypeoLc8uYzY', filepath=DEMO_FILEPATH)
54+
self.assertEqual(13, len(tasks))
4155

4256
def test_tags(self):
4357
"""Test all tags."""

0 commit comments

Comments
 (0)