def test_subtitle_can_remove_time(self): sub = SubtitleDelta(timedelta(minutes=1), timedelta(minutes=2)) sub.downtick_by(timedelta(seconds=5)) self.assertEquals(timedelta(minutes=0, seconds=55), sub.start) self.assertEquals(timedelta(minutes=1, seconds=55), sub.end)
def test_subtitle_can_add_time(self): sub = SubtitleDelta(timedelta(minutes=1), timedelta(minutes=2)) sub.uptick_by(timedelta(minutes=120)) self.assertEquals(timedelta(minutes=1, hours=2), sub.start) self.assertEquals(timedelta(minutes=2, hours=2), sub.end)
def test_get_milliseconds(self): self.assertEquals(130, SubtitleDelta.milliseconds(self.delta))
def test_get_seconds(self): self.assertEquals(15, SubtitleDelta.seconds(self.delta))
def test_get_minutes(self): self.assertEquals(10, SubtitleDelta.minutes(self.delta))
def test_get_hours(self): self.assertEquals(155, SubtitleDelta.hours(self.delta))