Tests that creating a small model with a client group results in a correct ProblemData instance that has the appropriate group memberships set up.
()
| 704 | |
| 705 | |
| 706 | def test_to_data_client_group(): |
| 707 | """ |
| 708 | Tests that creating a small model with a client group results in a correct |
| 709 | ProblemData instance that has the appropriate group memberships set up. |
| 710 | """ |
| 711 | m = Model() |
| 712 | m.add_depot(1, 1) |
| 713 | m.add_vehicle_type() |
| 714 | |
| 715 | group = m.add_client_group() |
| 716 | m.add_client(1, 1, required=False, group=group) |
| 717 | m.add_client(2, 2, required=False, group=group) |
| 718 | |
| 719 | # Generate the data instance. There should be a single client group, and |
| 720 | # the first two clients should be members of that group. |
| 721 | data = m.data() |
| 722 | assert_equal(data.num_groups, 1) |
| 723 | |
| 724 | group = data.group(0) |
| 725 | assert_equal(group.clients, [1, 2]) |
| 726 | |
| 727 | |
| 728 | def test_raises_mutually_exclusive_client_group_required_client(): |
nothing calls this directly
no test coverage detected