Skip to content

Commit

Permalink
Add test_empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed Jul 28, 2024
1 parent 60bfce5 commit 57964e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chinese_whispers/test_chinese_whispers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def clustered_graph_custom_key(graph: nx.Graph[int]) -> nx.Graph[int]:
return chinese_whispers(graph, seed=0, label_key=CUSTOM_KEY)


def test_empty() -> None:
graph: nx.Graph[Any] = chinese_whispers(nx.Graph(), seed=0)

assert not graph.nodes()


def test_return(graph: nx.Graph[int], clustered_graph: nx.Graph[int]) -> None:
assert edges_equal(graph.edges, clustered_graph.edges) # type: ignore[no-untyped-call]

Expand Down

0 comments on commit 57964e5

Please sign in to comment.