'Fake Flocker cluster gives expected results.'

@on_linux
def test_cpu_time(self):

    clock = Clock()
    node1 = Node(uuid=uuid4(), public_address=IPAddress('10.0.0.1'))
    node2 = Node(uuid=uuid4(), public_address=IPAddress('10.0.0.2'))
    metric = CPUTime(clock, BenchmarkCluster(IPAddress('10.0.0.1'), (lambda reactor: FakeFlockerClient([node1, node2])), {}, None), _LocalRunner(), processes=[_pid_1_name])
    d = metric.measure((lambda : clock.advance(5)))
    def remove_process_times(node_cpu_times):
        for process_times in node_cpu_times.values():
            if process_times:
                for process in process_times:
                    if (process != WALLCLOCK_LABEL):
                        process_times[process] = 0
        return node_cpu_times
    d.addCallback(remove_process_times)
    def check(result):
        self.assertEqual(result, {'10.0.0.1': {_pid_1_name: 0, WALLCLOCK_LABEL: 5}, '10.0.0.2': {_pid_1_name: 0, WALLCLOCK_LABEL: 5}})
    d.addCallback(check)
    return d
