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

Function test_finalise

tests/test_LoadSegment.py:82–93  ·  view source on GitHub ↗

Tests that excess load is correctly tracked by finalised load segments.

(capacity: int, exp_excess: int)

Source from the content-addressed store, hash-verified

80 [(10, 20), (5, 20), (0, 25)],
81)
82def test_finalise(capacity: int, exp_excess: int):
83 """
84 Tests that excess load is correctly tracked by finalised load segments.
85 """
86 segment = LoadSegment(5, 5, 5, 20) # 20 excess load, and 5 segment load
87 finalised = segment.finalise(capacity)
88
89 # Finalised segments track cumulative excess load - the rest resets.
90 assert_equal(finalised.delivery(), 0)
91 assert_equal(finalised.pickup(), 0)
92 assert_equal(finalised.load(), 0)
93 assert_equal(finalised.excess_load(capacity), exp_excess)
94
95
96def test_str():

Callers

nothing calls this directly

Calls 5

finaliseMethod · 0.95
LoadSegmentClass · 0.85
deliveryMethod · 0.80
pickupMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected