Skip to content

Commit fc024e1

Browse files
mrcfpscmccandless
authored andcommitted
pov: update tests to v1.3.0 (exercism#1378)
Add test for paths not involving root.
1 parent 4478caf commit fc024e1

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

exercises/pov/pov_test.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pov import Tree
44

55

6-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
6+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
77

88
class PovTest(unittest.TestCase):
99

@@ -158,6 +158,17 @@ def test_can_find_path_to_cousin(self):
158158
expected = ['x', 'parent', 'grandparent', 'uncle', 'cousin-1']
159159
self.assertEqual(tree.path_to('x', 'cousin-1'), expected)
160160

161+
def test_can_find_path_not_involving_root(self):
162+
tree = Tree('grandparent', [
163+
Tree('parent', [
164+
Tree('x'),
165+
Tree('sibling-0'),
166+
Tree('sibling-1')
167+
])
168+
])
169+
expected = ['x', 'parent', 'sibling-1']
170+
self.assertEqual(tree.path_to('x', 'sibling-1'), expected)
171+
161172
def test_can_find_path_from_nodes_other_than_x(self):
162173
tree = Tree('parent', [
163174
Tree('a'),

0 commit comments

Comments
 (0)