def test_hole_in_thread_numbers(self): parsed = test_lib.parse_string(""" Clocks SystemTime,1 MetricsTime,2 Timers 12,A.0.o,50 13,A.3.o,50 """) actual = perf_json.translate(parsed.timers()) self.assertEqual( actual, { 'results': [{ 'end': 0.00012, 'name': 'A.o', 'results': { 2: { 'ops_per_sec': 50.0, 'ops_per_sec_values': [50.0] } }, 'start': -0.00039, 'workload': 'A.o' }], })
def test_csv_no_sections_have_data(self): self.assertEqual( test_lib.parse_string(""" Clocks Gauges Counters Timers """).timers(), {})
def test_empty_input(self): self.assertEqual(test_lib.parse_string("").timers(), {})
def raises_parse_error(self, input_str): with self.assertRaises(parser.ParseError): test_lib.parse_string(input_str)