def test_parse_decomposed_duration_us(self): # Given decomposition: List[Tuple[int, str]] = [(23, 'μs'), (456, 'ns')] # When parsed_duration: str = parse_decomposed_duration(decomposition) # Then expected_parsed_duration: str = '23.456 μs' self.assertEqual(expected_parsed_duration, parsed_duration)
def test_parse_decomposed_duration_h(self): # Given decomposition: List[Tuple[int, str]] = [(2, 'h'), (13, 'min'), (15, 's'), (125, 'ms'), (885, 'μs'), (88, 'ns')] # When parsed_duration: str = parse_decomposed_duration(decomposition) # Then expected_parsed_duration: str = '2 h 13 min' self.assertEqual(expected_parsed_duration, parsed_duration)
def test_parse_decomposed_duration_min(self): # Given decomposition: List[Tuple[int, str]] = [(1, 'min'), (5, 's'), (1, 'ms'), (23, 'μs'), (456, 'ns')] # When parsed_duration: str = parse_decomposed_duration(decomposition) # Then expected_parsed_duration: str = '1 min 5 s' self.assertEqual(expected_parsed_duration, parsed_duration)