Skip to content

Commit 60bfce5

Browse files
committed
Add test_aggregation_empty
1 parent c3b78c1 commit 60bfce5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

chinese_whispers/test_chinese_whispers.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from random import Random
6-
from typing import TYPE_CHECKING, cast
6+
from typing import TYPE_CHECKING, Any, cast
77

88
import networkx as nx
99
import pytest
@@ -98,6 +98,12 @@ def test_ignore_one(graph: nx.Graph[int]) -> None:
9898
assert set(graph) - nodes == ignore
9999

100100

101+
def test_aggregation_empty() -> None:
102+
clusters: dict[int, set[Any]] = aggregate_clusters(nx.Graph())
103+
104+
assert not clusters
105+
106+
101107
def test_aggregation(clustered_graph: nx.Graph[int]) -> None:
102108
clusters = aggregate_clusters(clustered_graph)
103109

0 commit comments

Comments
 (0)