summaryrefslogtreecommitdiff
path: root/test/test_tree.py
diff options
context:
space:
mode:
authorLaurent Peuch <cortex@worlddomination.be>2020-03-19 12:24:34 +0100
committerLaurent Peuch <cortex@worlddomination.be>2020-03-19 12:24:34 +0100
commit0509e03d3f295862ca15986c004ae6c48917b15f (patch)
treef7b45e84ba72e3347faa6c456cf1014f34f63e8e /test/test_tree.py
parenta4237c8c1a66364ef5ff522b62c3089b3a6b5724 (diff)
downloadlogilab-common-0509e03d3f295862ca15986c004ae6c48917b15f.tar.gz
Please the flake8 god
Diffstat (limited to 'test/test_tree.py')
-rw-r--r--test/test_tree.py45
1 files changed, 34 insertions, 11 deletions
diff --git a/test/test_tree.py b/test/test_tree.py
index 58a8ba9..0faf079 100644
--- a/test/test_tree.py
+++ b/test/test_tree.py
@@ -21,7 +21,14 @@ squeleton generated by /home/syt/bin/py2tests on Jan 20 at 10:43:25
"""
from logilab.common.testlib import TestCase, unittest_main
-from logilab.common.tree import *
+from logilab.common.tree import (
+ Node,
+ NodeNotFound,
+ post_order_list,
+ PostfixedDepthFirstIterator,
+ pre_order_list,
+ PrefixedDepthFirstIterator,
+)
tree = (
"root",
@@ -196,9 +203,17 @@ class post_order_list_FunctionTest(TestCase):
create a list with tree nodes for which the <filter> function returned true
in a post order foashion
"""
- L = ["child_2_1", "child_3_1", "child_2_2", "child_1_1", "child_2_3", "child_1_2", "root"]
- l = [n.id for n in post_order_list(self.o)]
- self.assertEqual(l, L, l)
+ L = [
+ "child_2_1",
+ "child_3_1",
+ "child_2_2",
+ "child_1_1",
+ "child_2_3",
+ "child_1_2",
+ "root",
+ ]
+ li = [n.id for n in post_order_list(self.o)]
+ self.assertEqual(li, L, li)
def test_known_values_post_order_list2(self):
"""
@@ -212,8 +227,8 @@ class post_order_list_FunctionTest(TestCase):
return 1
L = ["child_2_1", "child_1_1", "child_2_3", "child_1_2", "root"]
- l = [n.id for n in post_order_list(self.o, filter)]
- self.assertEqual(l, L, l)
+ li = [n.id for n in post_order_list(self.o, filter)]
+ self.assertEqual(li, L, li)
class PostfixedDepthFirstIterator_ClassTest(TestCase):
@@ -246,9 +261,17 @@ class pre_order_list_FunctionTest(TestCase):
create a list with tree nodes for which the <filter> function returned true
in a pre order fashion
"""
- L = ["root", "child_1_1", "child_2_1", "child_2_2", "child_3_1", "child_1_2", "child_2_3"]
- l = [n.id for n in pre_order_list(self.o)]
- self.assertEqual(l, L, l)
+ L = [
+ "root",
+ "child_1_1",
+ "child_2_1",
+ "child_2_2",
+ "child_3_1",
+ "child_1_2",
+ "child_2_3",
+ ]
+ li = [n.id for n in pre_order_list(self.o)]
+ self.assertEqual(li, L, li)
def test_known_values_pre_order_list2(self):
"""
@@ -262,8 +285,8 @@ class pre_order_list_FunctionTest(TestCase):
return 1
L = ["root", "child_1_1", "child_2_1", "child_1_2", "child_2_3"]
- l = [n.id for n in pre_order_list(self.o, filter)]
- self.assertEqual(l, L, l)
+ li = [n.id for n in pre_order_list(self.o, filter)]
+ self.assertEqual(li, L, li)
class PrefixedDepthFirstIterator_ClassTest(TestCase):