MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_raises_invalid_group_client_indices

Function test_raises_invalid_group_client_indices

tests/test_ProblemData.py:870–883  ·  view source on GitHub ↗

Tests that groups with client indices that are either depots or outside the range of client locations results in an IndexError.

(groups: list[ClientGroup])

Source from the content-addressed store, hash-verified

868 "groups", [[ClientGroup([0, 1])], [ClientGroup([1, 2])]]
869)
870def test_raises_invalid_group_client_indices(groups: list[ClientGroup]):
871 """
872 Tests that groups with client indices that are either depots or outside the
873 range of client locations results in an IndexError.
874 """
875 with assert_raises(IndexError):
876 ProblemData(
877 clients=[Client(1, 1, required=False, group=0)],
878 depots=[Depot(1, 1)],
879 vehicle_types=[VehicleType()],
880 distance_matrices=[np.zeros((2, 2))],
881 duration_matrices=[np.zeros((2, 2))],
882 groups=groups,
883 )
884
885
886def test_raises_wrong_mutual_group_referencing():

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected