Skip to content

Commit 6d5b75a

Browse files
committed
test routing null matrix validation
Signed-off-by: Aycsi <207523432+aycsi@users.noreply.github.com>
1 parent 19c2060 commit 6d5b75a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

python/cuopt/cuopt/tests/routing/test_warnings_exceptions.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ def test_dist_mat():
7070
)
7171

7272

73+
def test_dist_mat_null():
74+
cost_matrix = cudf.DataFrame(
75+
[
76+
[0, 5.0, 5.0, 5.0],
77+
[5.0, 0, 5.0, 5.0],
78+
[5.0, 5.0, 0, 5.0],
79+
[5.0, None, 5.0, 0],
80+
]
81+
)
82+
with pytest.raises(Exception) as exc_info:
83+
dm = routing.DataModel(cost_matrix.shape[0], 3)
84+
dm.add_cost_matrix(cost_matrix)
85+
assert str(exc_info.value) == "cost matrix cannot have NULL values"
86+
87+
7388
def test_time_windows():
7489
cost_matrix = cudf.DataFrame(
7590
[

0 commit comments

Comments
 (0)