'handle_cputime_metric creates multiple sample objects, each with
one value, from a single sample containing many values. It does
not create a sample object from the \'-- WALL --\' key but adds
this value to every other sample.'

def test_handle_cputime_metric_creates_multiple_samples(self):

    wallclock_key = '--    WALL    --'
    common_props = {'version': '1.10.1', 'scenario': 'default'}
    sample = {'value': {'10.0.0.1': {'process1': 3, wallclock_key: 102.123}, '10.0.0.2': {'process1': 2, 'process2': 5, wallclock_key: 124.462}}}
    expected_samples = [{'process': 'process1', 'value': 3, 'wallclock': 102.123}, {'process': 'process1', 'value': 2, 'wallclock': 124.462}, {'process': 'process2', 'value': 5, 'wallclock': 124.462}]
    for s in expected_samples:
        s.update(common_props)
    samples = handle_cputime_metric(common_props, sample)
    self.assertEqual(sorted(samples), sorted(expected_samples))
