From 6d5b75a471ee3af53a8897a867f6e97015dff683 Mon Sep 17 00:00:00 2001 From: Aycsi <207523432+aycsi@users.noreply.github.com> Date: Thu, 14 May 2026 18:21:47 +0200 Subject: [PATCH] test routing null matrix validation Signed-off-by: Aycsi <207523432+aycsi@users.noreply.github.com> --- .../tests/routing/test_warnings_exceptions.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/python/cuopt/cuopt/tests/routing/test_warnings_exceptions.py b/python/cuopt/cuopt/tests/routing/test_warnings_exceptions.py index aafcb45a6a..2f02d66bf2 100644 --- a/python/cuopt/cuopt/tests/routing/test_warnings_exceptions.py +++ b/python/cuopt/cuopt/tests/routing/test_warnings_exceptions.py @@ -70,6 +70,21 @@ def test_dist_mat(): ) +def test_dist_mat_null(): + cost_matrix = cudf.DataFrame( + [ + [0, 5.0, 5.0, 5.0], + [5.0, 0, 5.0, 5.0], + [5.0, 5.0, 0, 5.0], + [5.0, None, 5.0, 0], + ] + ) + with pytest.raises(Exception) as exc_info: + dm = routing.DataModel(cost_matrix.shape[0], 3) + dm.add_cost_matrix(cost_matrix) + assert str(exc_info.value) == "cost matrix cannot have NULL values" + + def test_time_windows(): cost_matrix = cudf.DataFrame( [