Tests that calling the ``data()`` member on the model returns a data instance representing the added data.
()
| 19 | |
| 20 | |
| 21 | def test_model_data(): |
| 22 | """ |
| 23 | Tests that calling the ``data()`` member on the model returns a data |
| 24 | instance representing the added data. |
| 25 | """ |
| 26 | model = Model() |
| 27 | |
| 28 | # Let's add some data: a single client, and edges from/to the depot. |
| 29 | depot = model.add_depot(0, 0) |
| 30 | client = model.add_client(0, 1, delivery=1) |
| 31 | model.add_edge(depot, client, 1, 1) |
| 32 | model.add_edge(client, depot, 1, 1) |
| 33 | model.add_vehicle_type(capacity=1, num_available=1) |
| 34 | |
| 35 | data = model.data() |
| 36 | assert_equal(data.num_clients, 1) |
| 37 | assert_equal(data.num_vehicle_types, 1) |
| 38 | assert_equal(data.num_vehicles, 1) |
| 39 | |
| 40 | |
| 41 | def test_add_edge_raises_negative_distance_or_duration(): |
nothing calls this directly
no test coverage detected