Skip to content

Commit

Permalink
check (Un)directedEdge is hashable in test_(un)directed_edge
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Oct 23, 2023
1 parent d0aa03b commit cffaa6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ def test_directed_edge() -> None:
assert edge.index == 0
assert repr(edge) == f"DirectedEdge(nodes=[0, 1], index=0, {info=})"

# test hashable
_ = {edge}


def test_undirected_edge() -> None:
info = {"image": np.array([0, 0, 0]), "distance": 1.0}
edge = UndirectedEdge([0, 1], index=0, info=info)
assert repr(edge) == f"UndirectedEdge(nodes=[0, 1], index=0, {info=})"

# test hashable
_ = {edge}

0 comments on commit cffaa6b

Please sign in to comment.