From 9d2b4fde78afbe38844f2bf7fd0ac849a6f58ddb Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 6 Jul 2016 17:47:30 -0300 Subject: [PATCH] avocado/core/tree.py: replace get_ascii() for tree_view() Commit 19cb82c removed the `get_ascii()` method and added the utility function `tree_view()`. But there is a leftover using the old method. Let's replace them. Signed-off-by: Cleber Rosa --- avocado/core/tree.py | 2 +- selftests/unit/test_tree.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/avocado/core/tree.py b/avocado/core/tree.py index c39ea071..708ecbd7 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 ca783c84..04d25ab2 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): -- GitLab