Skip to content

Commit

Permalink
feat: add tests for nest level
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Sep 28, 2024
1 parent ee7c301 commit 29d4d1f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_core/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ def test_sort_reverse(self):
self.assertEqual([i.description for i in w.siblings], names[::-1])
w.reverse_siblings()
self.assertEqual([i.description for i in w.siblings], names)

12 changes: 12 additions & 0 deletions tests/test_core/test_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,15 @@ def test_comparable_fields(self):
fields = Todo.comparable_fields()
expected_fields = ['description', 'due', 'effort', 'recurrence', 'urgency', 'pending']
self.assertEqual(fields, expected_fields)

def test_nest_level(self):
w = Workspace()

t = w.add_todo()
self.assertEqual(t.nest_level, 0)

t = t.add_todo()
self.assertEqual(t.nest_level, 1)

t = t.add_todo()
self.assertEqual(t.nest_level, 2)
10 changes: 10 additions & 0 deletions tests/test_core/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,13 @@ def test_comparable_fields(self):
fields = Workspace.comparable_fields()
expected_fields = ['description']
self.assertEqual(fields, expected_fields)

def test_nest_level(self):
w = Workspace()
self.assertEqual(w.nest_level, 0)

w = w.add_workspace()
self.assertEqual(w.nest_level, 1)

w = w.add_workspace()
self.assertEqual(w.nest_level, 2)

0 comments on commit 29d4d1f

Please sign in to comment.