예제 #1
0
    def test_durationToStr(self):
        m = Media(self.url, self.size, self.type, timedelta(hours=1))
        self.assertEqual(m.duration_str, "01:00:00")

        m.duration = timedelta(days=1)
        self.assertEqual(m.duration_str, "24:00:00")

        m.duration = timedelta(minutes=1)
        self.assertEqual(m.duration_str, "01:00")

        m.duration = timedelta(seconds=1)
        self.assertEqual(m.duration_str, "00:01")

        m.duration = timedelta(days=1, hours=2)
        self.assertEqual(m.duration_str, "26:00:00")

        m.duration = timedelta(hours=1, minutes=32, seconds=13)
        self.assertEqual(m.duration_str, "01:32:13")

        m.duration = timedelta(hours=1, minutes=9, seconds=3)
        self.assertEqual(m.duration_str, "01:09:03")
예제 #2
0
    def test_durationToStr(self):
        m = Media(self.url, self.size, self.type, timedelta(hours=1))
        self.assertEqual(m.duration_str, "01:00:00")

        m.duration = timedelta(days=1)
        self.assertEqual(m.duration_str, "24:00:00")

        m.duration = timedelta(minutes=1)
        self.assertEqual(m.duration_str, "01:00")

        m.duration = timedelta(seconds=1)
        self.assertEqual(m.duration_str, "00:01")

        m.duration = timedelta(days=1, hours=2)
        self.assertEqual(m.duration_str, "26:00:00")

        m.duration = timedelta(hours=1, minutes=32, seconds=13)
        self.assertEqual(m.duration_str, "01:32:13")

        m.duration = timedelta(hours=1, minutes=9, seconds=3)
        self.assertEqual(m.duration_str, "01:09:03")
예제 #3
0
 def test_assigningDuration(self):
     m = Media(self.url, self.size, self.type, self.duration)
     another_duration = timedelta(hours=0, minutes=32, seconds=23)
     m.duration = another_duration
     self.assertEqual(m.duration, another_duration)
예제 #4
0
 def test_assigningDuration(self):
     m = Media(self.url, self.size, self.type, self.duration)
     another_duration = timedelta(hours=0, minutes=32, seconds=23)
     m.duration = another_duration
     self.assertEqual(m.duration, another_duration)