Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
feat: test edge builders
Browse files Browse the repository at this point in the history
  • Loading branch information
JPXKQX committed Jun 27, 2024
1 parent 384adc7 commit 0bc176c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/edges/test_cutoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ def test_fail_init(cutoff_factor: str):
"""Test CutOffEdgeBuilder initialization with invalid cutoff."""
with pytest.raises(AssertionError):
CutOffEdgeBuilder("test_nodes1", "test_nodes2", cutoff_factor)


def test_cutoff(graph_with_nodes):
"""Test CutOffEdgeBuilder."""
builder = CutOffEdgeBuilder("test_nodes", "test_nodes", 0.5)
graph = builder.transform(graph_with_nodes)
assert ("test_nodes", "to", "test_nodes") in graph.edge_types
7 changes: 7 additions & 0 deletions tests/edges/test_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ def test_fail_init(num_nearest_neighbours: str):
"""Test KNNEdgeBuilder initialization with invalid number of nearest neighbours."""
with pytest.raises(AssertionError):
KNNEdgeBuilder("test_nodes1", "test_nodes2", num_nearest_neighbours)


def test_knn(graph_with_nodes):
"""Test KNNEdgeBuilder."""
builder = KNNEdgeBuilder("test_nodes", "test_nodes", 3)
graph = builder.transform(graph_with_nodes)
assert ("test_nodes", "to", "test_nodes") in graph.edge_types

0 comments on commit 0bc176c

Please sign in to comment.