diff --git a/avocado/core/tree.py b/avocado/core/tree.py index c39ea0710390fc1dbfaac3c15470a7e08d612308..708ecbd764ec3f7fe67932da20b9a0bee2f75ff8 100644 --- a/avocado/core/tree.py +++ b/avocado/core/tree.py @@ -271,7 +271,7 @@ class TreeNode(object): node = child else: raise ValueError("Path %s does not exists in this tree\n%s" - % (path, self.get_ascii())) + % (path, tree_view(self.root))) return node def iter_children_preorder(self): diff --git a/selftests/unit/test_tree.py b/selftests/unit/test_tree.py index ca783c842047413c5323ef0b7cec52fceb6c257b..04d25ab20c1f5d2d7c783451218aa821ea5abb85 100644 --- a/selftests/unit/test_tree.py +++ b/selftests/unit/test_tree.py @@ -192,6 +192,10 @@ class TestTree(unittest.TestCase): self.assertEqual(tree2.children[0].children[1].children[0].multiplex, None) + def test_get_node(self): + self.assertRaises(ValueError, + self.tree.get_node, '/non-existing-node') + class TestPathParent(unittest.TestCase):