Tests that setting the clients in a mutually exclusive group to values that are not valid indices raises, and that setting a group index on a client to a value that's out of range likewise raises.
(
groups: list[ClientGroup], index: int
)
| 846 | ], |
| 847 | ) |
| 848 | def test_raises_invalid_client_group_indices( |
| 849 | groups: list[ClientGroup], index: int |
| 850 | ): |
| 851 | """ |
| 852 | Tests that setting the clients in a mutually exclusive group to values that |
| 853 | are not valid indices raises, and that setting a group index on a client to |
| 854 | a value that's out of range likewise raises. |
| 855 | """ |
| 856 | with assert_raises(IndexError): |
| 857 | ProblemData( |
| 858 | clients=[Client(1, 1, required=False, group=index)], |
| 859 | depots=[Depot(1, 1)], |
| 860 | vehicle_types=[VehicleType()], |
| 861 | distance_matrices=[np.zeros((2, 2))], |
| 862 | duration_matrices=[np.zeros((2, 2))], |
| 863 | groups=groups, |
| 864 | ) |
| 865 | |
| 866 | |
| 867 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected