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

Function test_finalise_front

tests/test_DurationSegment.py:264–284  ·  view source on GitHub ↗

Tests that finalise_front() correctly finalises the segment.

()

Source from the content-addressed store, hash-verified

262
263
264def test_finalise_front():
265 """
266 Tests that finalise_front() correctly finalises the segment.
267 """
268 segment = DurationSegment(5, 5, 40, 50, 50)
269 assert_equal(segment.duration(), 5)
270 assert_equal(segment.time_warp(), 5)
271
272 assert_equal(segment.start_early(), 50)
273 assert_equal(segment.start_late(), 50)
274 assert_equal(segment.release_time(), 50)
275
276 # Test that finalising does not affect duration and time warp.
277 finalised = segment.finalise_front()
278 assert_equal(finalised.duration(), 5)
279 assert_equal(finalised.time_warp(), 5)
280
281 # Same start_early and start_late as segment, but no release time.
282 assert_equal(finalised.start_early(), 50)
283 assert_equal(finalised.start_late(), 50)
284 assert_equal(finalised.release_time(), 0)
285
286
287def test_repeated_merge_and_finalise_back():

Callers

nothing calls this directly

Calls 3

durationMethod · 0.95
DurationSegmentClass · 0.85
durationMethod · 0.45

Tested by

no test coverage detected