From 3323464f85b986cba23176271da92a478b33ab9c Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 10 Jun 2010 00:24:49 +0200 Subject: messy first version of a properly working depth-first graph method, which allows the pool to work as expected. Many more tests need to be added, and there still is a problem with shutdown as sometimes it won't kill all threads, mainly because the process came up with worker threads started, which cannot be --- test/git/async/test_graph.py | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'test/git/async/test_graph.py') diff --git a/test/git/async/test_graph.py b/test/git/async/test_graph.py index 1a153e2d..d0e36159 100644 --- a/test/git/async/test_graph.py +++ b/test/git/async/test_graph.py @@ -61,31 +61,10 @@ class TestGraph(TestBase): assert len(n1.out_nodes) == 0 # check the history from the last node - last = g.nodes[-1] - class Visitor(object): - def __init__(self, origin): - self.origin_seen = False - self.origin = origin - self.num_seen = 0 - - def __call__(self, n): - if n is self.origin: - self.origin_seen = True - else: - assert not self.origin_seen, "should see origin last" - # END check origin - self.num_seen += 1 - return True - - def _assert(self, num_expected): - assert self.origin_seen - assert self.num_seen == num_expected - # END visitor helper - end = g.nodes[-1] - visitor = Visitor(end) - g.visit_input_inclusive_depth_first(end, visitor) - + dfirst_nodes = g.input_inclusive_dfirst_reversed(end) num_nodes_seen = nn - 2 # deleted second, which leaves first one disconnected - visitor._assert(num_nodes_seen) + assert len(dfirst_nodes) == num_nodes_seen + assert dfirst_nodes[-1] == end and dfirst_nodes[-2].id == end.id-1 + -- cgit v1.2.1