Tests that excess load is correctly tracked by finalised load segments.
(capacity: int, exp_excess: int)
| 80 | [(10, 20), (5, 20), (0, 25)], |
| 81 | ) |
| 82 | def 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 | |
| 96 | def test_str(): |
nothing calls this directly
no test coverage detected