def test_propagates_last_correct_shift_to_broken_events(self): events = [ FakeEvent(diff=x) for x in (0.9, 0.9, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 0.9) ] fix_near_borders(events) sf = events[2] sl = events[-3] self.assertEqual([x.linked for x in events], [sf, sf, None, None, None, None, None, sl, sl])
def test_returns_array_with_no_broken_events_unchanged(self): events = [FakeEvent(diff=x) for x in (0.9, 0.9, 0.9, 1.0, 0.9)] fix_near_borders(events) self.assertEqual([x.linked for x in events], [None, None, None, None, None])
def test_returns_array_with_no_broken_events_unchanged(self): events = [FakeEvent(diff=x) for x in (0.9, 0.9, 0.9, 1.0, 0.9)] sushi.fix_near_borders(events) self.assertEqual([x.linked for x in events], [None, None, None, None, None])
def test_propagates_last_correct_shift_to_broken_events(self): events = [FakeEvent(diff=x) for x in (0.9, 0.9, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 0.9)] sushi.fix_near_borders(events) sf = events[2] sl = events[-3] self.assertEqual([x.linked for x in events], [sf, sf, None, None, None, None, None, sl, sl])