Tests that finalising either the front or the back and then merging on the appropriate side results in segments with the same duration and time warp attributes.
()
| 357 | |
| 358 | |
| 359 | def test_finalise_back_front_merge_same_thing(): |
| 360 | """ |
| 361 | Tests that finalising either the front or the back and then merging on the |
| 362 | appropriate side results in segments with the same duration and time warp |
| 363 | attributes. |
| 364 | """ |
| 365 | ds1 = DurationSegment(50, 0, 70, 110, 100) |
| 366 | ds2 = DurationSegment(45, 0, 30, 50, 50) |
| 367 | |
| 368 | # Finalise the first segment at its back, then merge. Or finalise the |
| 369 | # second segment at the front and then merge. This should result in the |
| 370 | # same segment w.r.t. time warp and duration. |
| 371 | finalise_back = DurationSegment.merge(0, ds1.finalise_back(), ds2) |
| 372 | finalise_front = DurationSegment.merge(0, ds1, ds2.finalise_front()) |
| 373 | assert_equal(finalise_back.time_warp(), finalise_front.time_warp()) |
| 374 | assert_equal(finalise_back.duration(), finalise_front.duration()) |
nothing calls this directly
no test coverage detected