Skip to content

Commit 57964e5

Browse files
committed
Add test_empty
1 parent 60bfce5 commit 57964e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

chinese_whispers/test_chinese_whispers.py

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def clustered_graph_custom_key(graph: nx.Graph[int]) -> nx.Graph[int]:
5858
return chinese_whispers(graph, seed=0, label_key=CUSTOM_KEY)
5959

6060

61+
def test_empty() -> None:
62+
graph: nx.Graph[Any] = chinese_whispers(nx.Graph(), seed=0)
63+
64+
assert not graph.nodes()
65+
66+
6167
def test_return(graph: nx.Graph[int], clustered_graph: nx.Graph[int]) -> None:
6268
assert edges_equal(graph.edges, clustered_graph.edges) # type: ignore[no-untyped-call]
6369

0 commit comments

Comments
 (0)