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

Function test_max_duration_argument

tests/test_DurationSegment.py:90–99  ·  view source on GitHub ↗

Tests that the ``max_duration`` argument is evaluated correctly, and indeed increases the time warp if it's violated.

()

Source from the content-addressed store, hash-verified

88
89
90def test_max_duration_argument():
91 """
92 Tests that the ``max_duration`` argument is evaluated correctly, and indeed
93 increases the time warp if it's violated.
94 """
95 ds = DurationSegment(5, 0, 0, 0, 0) # five duration
96
97 assert_equal(ds.time_warp(), 0) # default not duration limited
98 assert_equal(ds.time_warp(max_duration=2), 3)
99 assert_equal(ds.time_warp(max_duration=0), 5)
100
101
102def test_OkSmall_with_time_warp(ok_small):

Callers

nothing calls this directly

Calls 1

DurationSegmentClass · 0.85

Tested by

no test coverage detected