summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2011-02-09 14:51:53 +0100
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2011-02-09 14:51:53 +0100
commit2b40437e2ca90dc95a3803d37857f254c04168da (patch)
tree423355ced5ebfc8b987af8926c795d1471e3c949 /test
parent4b0aeb275866ec489f04cf53d2dcafed3753dbe7 (diff)
downloadlogilab-common-2b40437e2ca90dc95a3803d37857f254c04168da.tar.gz
fix the ordered_nodes fix by reverting to previous order
Diffstat (limited to 'test')
-rw-r--r--test/unittest_graph.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/unittest_graph.py b/test/unittest_graph.py
index e72d8d4..bd739bf 100644
--- a/test/unittest_graph.py
+++ b/test/unittest_graph.py
@@ -54,9 +54,12 @@ class ordered_nodesTC(TestCase):
self.assertEqual(ordered, ('a',))
def test_single_dependency(self):
- graph = {'a':[], 'b':['a']}
+ graph = {'a':['b'], 'b':[]}
ordered = ordered_nodes(graph)
self.assertEqual(ordered, ('a','b'))
+ graph = {'a':[], 'b':['a']}
+ ordered = ordered_nodes(graph)
+ self.assertEqual(ordered, ('b','a'))
def test_two_items_no_dependency(self):
graph = {'a':[], 'b':[]}
@@ -69,14 +72,14 @@ class ordered_nodesTC(TestCase):
self.assertEqual(ordered, ('a', 'b', 'c'))
def test_three_items_one_dependency(self):
- graph = {'a': ['b'], 'b': [], 'c':[]}
+ graph = {'a': ['c'], 'b': [], 'c':[]}
ordered = ordered_nodes(graph)
- self.assertEqual(ordered, ('b', 'c', 'a'))
+ self.assertEqual(ordered, ('a', 'b', 'c'))
def test_three_items_two_dependencies(self):
graph = {'a': ['b'], 'b': ['c'], 'c':[]}
ordered = ordered_nodes(graph)
- self.assertEqual(ordered, ('c', 'b', 'a'))
+ self.assertEqual(ordered, ('a', 'b', 'c'))
def test_bad_graph(self):
graph = {'a':['b']}