MCPcopy
hub / github.com/nvdv/vprof / testTransformStats

Method testTransformStats

vprof/tests/profiler_test.py:13–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11 self._profiler = object.__new__(profiler.Profiler)
12
13 def testTransformStats(self):
14 prof = mock.MagicMock()
15 prof.total_tt = 0.075
16 prof.stats = {
17 ('fname1', 1, 'func1'): (5, 10, 0.001, 0.01, ()),
18 ('fname1', 5, 'func2'): (10, 15, 0.002, 0.02, ()),
19 ('fname2', 11, '<func3>'): (15, 20, 0.003, 0.045, ())
20 }
21 expected_results = [
22 ('fname2', 11, '<func3>', 0.045, 60.0,
23 20, 15, 0.003, 'fname2', 727188755),
24 ('fname1', 5, 'func2', 0.02, 26.6667,
25 15, 10, 0.002, 'fname1', 591398039),
26 ('fname1', 1, 'func1', 0.01, 13.3333,
27 10, 5, 0.001, 'fname1', 590742678),
28 ]
29
30 self.assertListEqual(
31 self._profiler._transform_stats(prof), expected_results)
32
33# pylint: enable=protected-access, missing-docstring

Callers

nothing calls this directly

Calls 1

_transform_statsMethod · 0.80

Tested by

no test coverage detected