mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-11 01:40:28 +08:00
added merge_nodes test
This commit is contained in:
@@ -3,6 +3,7 @@ from skimage import graph
|
||||
import random
|
||||
|
||||
|
||||
|
||||
def test_rag_merge():
|
||||
g = graph.rag.RAG()
|
||||
for i in range(10):
|
||||
@@ -14,6 +15,8 @@ def test_rag_merge():
|
||||
y = random.choice(g.neighbors(x))
|
||||
g.merge_nodes(x, y)
|
||||
|
||||
np.testing.assert_raises(ValueError,g.merge_nodes,7,9)
|
||||
|
||||
idx = g.nodes()[0]
|
||||
sorted(g.node[idx]['labels']) == range(10)
|
||||
assert g.edges() == []
|
||||
|
||||
Reference in New Issue
Block a user