tests: Fix test broken by refactoring

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent 69d42ffb36
commit 3de7816fd2
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -4,7 +4,7 @@ import unittest
from collections import OrderedDict from collections import OrderedDict
from . import new_pkg_universe_builder from . import new_pkg_universe_builder
from britney2.installability.solver import compute_scc, InstallabilitySolver from britney2.installability.solver import compute_scc, InstallabilitySolver, OrderNode
class TestInstTester(unittest.TestCase): class TestInstTester(unittest.TestCase):
@ -513,34 +513,40 @@ class TestInstTester(unittest.TestCase):
graph = OrderedDict() graph = OrderedDict()
graph['A'] = { def _order_node(**args):
'before': ['C', 'B'], node = OrderNode()
'after': ['A0'], node.before = args['before']
} node.after = args['after']
graph['B'] = { return node
'before': ['F'],
'after': ['A'], graph['A'] = _order_node(
} before=['C', 'B'],
graph['C'] = { after=['A0'],
'before': ['E', 'D'], )
'after': ['A'], graph['B'] = _order_node(
} before=['F'],
graph['D'] = { after=['A'],
'before': [], )
'after': ['C'] graph['C'] = _order_node(
} before=['E', 'D'],
graph['E'] = { after=['A'],
'before': ['B'], )
'after': ['C'] graph['D'] = _order_node(
} before=[],
graph['F'] = { after=['C'],
'before': [], )
'after': ['B'] graph['E'] = _order_node(
} before=['B'],
graph['A0'] = { after=['C']
'before': ['A0'], )
'after': [] graph['F'] = _order_node(
} before=[],
after=['B'],
)
graph['A0'] = _order_node(
before=['A0'],
after=[],
)
# We also assert that the order is correct to ensure that # We also assert that the order is correct to ensure that
# nodes were visited in the order we expected (the bug is # nodes were visited in the order we expected (the bug is

Loading…
Cancel
Save