'This tests that the client actions are limited properly.'

def testCPULimitForFlows(self):

    result = {}
    client_mock = CPULimitClientMock(result)
    client_mock = flow_test_lib.MockClient(self.client_id, client_mock, token=self.token)
    client_mock.EnableResourceUsage(user_cpu_usage=[10], system_cpu_usage=[10], network_usage=[1000])
    worker_obj = worker.GRRWorker(token=self.token)
    flow.GRRFlow.StartFlow(client_id=self.client_id, flow_name='CPULimitFlow', cpu_limit=1000, network_bytes_limit=10000, token=self.token)
    self._Process([client_mock], worker_obj)
    self.assertEqual(result['cpulimit'], [1000, 980, 960])
    self.assertEqual(result['networklimit'], [10000, 9000, 8000])
    return result
