Tests the bug of #681. Because empty client groups compare equal, the group to index implementation returned the first object that compared equal, in this case resulting in both clients being inserted into the first client group rather than the each into one.
()
| 975 | |
| 976 | |
| 977 | def test_bug_client_group_indices(): |
| 978 | """ |
| 979 | Tests the bug of #681. Because empty client groups compare equal, the |
| 980 | group to index implementation returned the first object that compared |
| 981 | equal, in this case resulting in both clients being inserted into the |
| 982 | first client group rather than the each into one. |
| 983 | """ |
| 984 | m = Model() |
| 985 | m.add_depot(x=0, y=0) |
| 986 | |
| 987 | group1 = m.add_client_group() |
| 988 | group2 = m.add_client_group() |
| 989 | |
| 990 | client1 = m.add_client(x=0, y=0, required=False, group=group2) |
| 991 | assert_equal(client1.group, 1) |
| 992 | |
| 993 | client2 = m.add_client(x=0, y=0, required=False, group=group1) |
| 994 | assert_equal(client2.group, 0) |
| 995 | |
| 996 | assert_equal(len(group1), 1) |
| 997 | assert_equal(len(group2), 1) |
| 998 | |
| 999 | |
| 1000 | def test_integer_vehicle_capacity_and_load_arguments_are_promoted_to_lists(): |
nothing calls this directly
no test coverage detected