diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-11 11:52:24 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-11 14:20:25 +0200 |
commit | 583e6a25b0d891a2f531a81029f2bac0c237cbf9 (patch) | |
tree | 09025a39d44fa2a28a6533a0f969316652f974bc /test/git/async/test_graph.py | |
parent | 01eac1a959c1fa5894a86bf11e6b92f96762bdd8 (diff) | |
parent | 6d1212e8c412b0b4802bc1080d38d54907db879d (diff) | |
download | gitpython-583e6a25b0d891a2f531a81029f2bac0c237cbf9.tar.gz |
Merge branch 'channel' into taskdep
Diffstat (limited to 'test/git/async/test_graph.py')
-rw-r--r-- | test/git/async/test_graph.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/git/async/test_graph.py b/test/git/async/test_graph.py index d0e36159..7630226b 100644 --- a/test/git/async/test_graph.py +++ b/test/git/async/test_graph.py @@ -3,6 +3,7 @@ from test.testlib import * from git.async.graph import * import time +import sys class TestGraph(TestBase): @@ -19,7 +20,7 @@ class TestGraph(TestBase): # delete unconnected nodes for n in g.nodes[:]: - g.del_node(n) + g.remove_node(n) # END del nodes # add a chain of connected nodes @@ -54,8 +55,8 @@ class TestGraph(TestBase): # deleting a connected node clears its neighbour connections assert n3.in_nodes[0] is n2 - assert g.del_node(n2) is g - assert g.del_node(n2) is g # multi-deletion okay + assert g.remove_node(n2) is g + assert g.remove_node(n2) is g # multi-deletion okay assert len(g.nodes) == nn - 1 assert len(n3.in_nodes) == 0 assert len(n1.out_nodes) == 0 @@ -68,3 +69,12 @@ class TestGraph(TestBase): assert dfirst_nodes[-1] == end and dfirst_nodes[-2].id == end.id-1 + # test cleanup + # its at least kept by its graph + assert sys.getrefcount(end) > 3 + del(g) + del(n1); del(n2); del(n3) + del(dfirst_nodes) + del(last) + del(n) + assert sys.getrefcount(end) == 2 |