'cputime_for_process correctly calculates the CPU percentage for
a process by dividing the total cputime by the total wallclock
time across all the samples.'

def test_cpu_usage_for_process_calculates_result(self):

    process_name = 'test-process'
    results = [{'metric': {'type': 'cputime'}, 'process': process_name, 'value': 10, 'wallclock': 60}, {'metric': {'type': 'cputime'}, 'process': process_name, 'value': 30, 'wallclock': 100}]
    cputime_result = cpu_usage_for_process(results, process_name)
    self.assertEqual(cputime_result, 0.25)
