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

Function test_get_locations

tests/test_Model.py:256–268  ·  view source on GitHub ↗

Checks that the ``locations`` property returns the depot and all clients.

()

Source from the content-addressed store, hash-verified

254
255
256def test_get_locations():
257 """
258 Checks that the ``locations`` property returns the depot and all clients.
259 """
260 model = Model()
261 client1 = model.add_client(0, 1)
262 depot = model.add_depot(0, 0)
263 client2 = model.add_client(0, 2)
264
265 # Test that depot is always first and that we can get the clients by index.
266 assert_equal(model.locations[0], depot)
267 assert_equal(model.locations[1], client1)
268 assert_equal(model.locations[2], client2)
269
270
271def test_get_vehicle_types():

Callers

nothing calls this directly

Calls 3

add_clientMethod · 0.95
add_depotMethod · 0.95
ModelClass · 0.90

Tested by

no test coverage detected