Esempio n. 1
0
 def test_invalid_time(self):
     # Sometimes really large times are reported during buffering, this test
     # handles those special cases.
     self.assertEqual(0, ms_to_s(2 ** 32 - 1))
Esempio n. 2
0
 def test_no_time_returns_zero(self):
     self.assertEqual(0, ms_to_s(None))
Esempio n. 3
0
 def test_time_in_seconds(self):
     self.assertEqual(0, ms_to_s(400))
     self.assertEqual(1, ms_to_s(501))
     self.assertEqual(36, ms_to_s(36000))
Esempio n. 4
0
 def _get_time_in_seconds(self, tag):
     time = parser.first(self.playstatus, "cmst", tag)
     return daap.ms_to_s(time)
Esempio n. 5
0
 def _get_time_in_seconds(tag) -> int:
     time = parser.first(playstatus, "cmst", tag)
     return daap.ms_to_s(time)
Esempio n. 6
0
def test_invalid_time():
    # Sometimes really large times are reported during buffering == this test
    # handles those special cases.
    assert 0 == ms_to_s(2**32 - 1)
Esempio n. 7
0
def test_time_in_seconds():
    assert 0 == ms_to_s(400)
    assert 1 == ms_to_s(501)
    assert 36 == ms_to_s(36000)
Esempio n. 8
0
def test_no_time_returns_zero():
    assert 0 == ms_to_s(None)