def test_segment_precision_mode(): Segment.set_precision(None) assert not Segment(90 / 1000, 90 / 1000 + 240 / 1000) == Segment( 90 / 1000, 330 / 1000) Segment.set_precision(4) assert Segment(90 / 1000, 90 / 1000 + 240 / 1000) == Segment(90 / 1000, 330 / 1000)
def test_empty_gaps(): empty_timeline = Timeline(uri='MyEmptyGaps') assert list(empty_timeline.gaps()) == [] Segment.set_precision(3) assert list(empty_timeline.gaps()) == []