def test_parse_time_expression_metric(self): self.assertEquals(storage.time_expression_to_milliseconds("10h"), 10 * 3600 * 1000) self.assertEquals(storage.time_expression_to_milliseconds("5m"), 5 * 60 * 1000) self.assertEquals(storage.time_expression_to_milliseconds("3000s"), 3000 * 1000) self.assertEquals(storage.time_expression_to_milliseconds("5000ms"), 5000)
def test_parse_time_expression_clock_time(self): milliseconds = (((3 * 3600 ) + (20 * 60 ) + (40 )) * 1000 ) self.assertEquals(storage.time_expression_to_milliseconds("03:20:40"), milliseconds)
def test_time_expression_to_milliseconds_clock_time_fraction(self): milliseconds = (((3 * 3600 ) + (20 * 60 ) + (40 )) * 1000 ) + 200 self.assertEquals(storage.time_expression_to_milliseconds("03:20:40.200"), milliseconds)
def _convert_to_24fps(self, time_str): ms = time_expression_to_milliseconds(time_str) fps_24 = ms/1.001001001 return milliseconds_to_time_clock_exp(fps_24)
def test_parse_time_expression_clock_time(self): milliseconds = (((3 * 3600) + (20 * 60) + (40)) * 1000) self.assertEquals(storage.time_expression_to_milliseconds("03:20:40"), milliseconds)
def test_time_expression_to_milliseconds_clock_time_fraction(self): milliseconds = (((3 * 3600) + (20 * 60) + (40)) * 1000) + 200 self.assertEquals( storage.time_expression_to_milliseconds("03:20:40.200"), milliseconds)