Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 def test_get_milliseconds(self):
     self.assertEquals(130,
                       SubtitleDelta.milliseconds(self.delta))
Пример #4
0
 def test_get_seconds(self):
     self.assertEquals(15,
                       SubtitleDelta.seconds(self.delta))
Пример #5
0
 def test_get_minutes(self):
     self.assertEquals(10,
                       SubtitleDelta.minutes(self.delta))
Пример #6
0
 def test_get_hours(self):
     self.assertEquals(155,
                       SubtitleDelta.hours(self.delta))