Tests that excess load is correctly evaluated and merged.
()
| 60 | |
| 61 | |
| 62 | def test_excess_load_capacity(): |
| 63 | """ |
| 64 | Tests that excess load is correctly evaluated and merged. |
| 65 | """ |
| 66 | before = LoadSegment(5, 5, 5, 30) |
| 67 | after = LoadSegment(2, 2, 2, 5) |
| 68 | merged = LoadSegment.merge(before, after) |
| 69 | |
| 70 | # There's seven load on this segment, but 30 excess load from some part of |
| 71 | # the route executed before the last return to the depot, and 5 excess load |
| 72 | # from part of the route executed after the next return to the depot. |
| 73 | assert_equal(merged.load(), 7) |
| 74 | assert_equal(merged.excess_load(7), 35) |
| 75 | assert_equal(merged.excess_load(0), 42) |
| 76 | |
| 77 | |
| 78 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected