Skip to content

Commit

Permalink
Add test_aggregation_empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed Jul 28, 2024
1 parent c3b78c1 commit 60bfce5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion chinese_whispers/test_chinese_whispers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from random import Random
from typing import TYPE_CHECKING, cast
from typing import TYPE_CHECKING, Any, cast

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


def test_aggregation_empty() -> None:
clusters: dict[int, set[Any]] = aggregate_clusters(nx.Graph())

assert not clusters


def test_aggregation(clustered_graph: nx.Graph[int]) -> None:
clusters = aggregate_clusters(clustered_graph)

Expand Down

0 comments on commit 60bfce5

Please sign in to comment.