MCPcopy Index your code
hub / github.com/PyVRP/PyVRP / test_problem_data_raises_matrix_diagonal_nonzero

Function test_problem_data_raises_matrix_diagonal_nonzero

tests/test_ProblemData.py:269–279  ·  view source on GitHub ↗

Tests that the ``ProblemData`` constructor raises a ``ValueError`` when the distance or duration matrix has a non-zero value on the diagonal.

(dist_mat, dur_mat)

Source from the content-addressed store, hash-verified

267 ],
268)
269def test_problem_data_raises_matrix_diagonal_nonzero(dist_mat, dur_mat):
270 """
271 Tests that the ``ProblemData`` constructor raises a ``ValueError`` when
272 the distance or duration matrix has a non-zero value on the diagonal.
273 """
274 clients = [Client(x=0, y=0)]
275 depots = [Depot(x=0, y=0)]
276 vehicle_types = [VehicleType()]
277
278 with assert_raises(ValueError):
279 ProblemData(clients, depots, vehicle_types, [dist_mat], [dur_mat])
280
281
282def test_problem_data_replace_no_changes():

Callers

nothing calls this directly

Calls 4

ClientClass · 0.90
DepotClass · 0.90
VehicleTypeClass · 0.90
ProblemDataClass · 0.90

Tested by

no test coverage detected