

def test_execute_operation_process_reply(self):
    executor = mock.MagicMock()
    executor.process_reply = mock.Mock(return_value={
        'samples': [],
    })
    agent_id = 'the-agent'
    ex = quorum.ExecuteOperation({
        agent_id: executor,
    })
    message = {
        'stdout': 'foo',
        'stderr': '',
    }
    reply = ex.process_reply(agent_id, message)
    expected = {
        'status': 'ok',
        'samples': [],
    }
    executor.process_reply.assert_called_once_with(message)
    self.assertEqual(expected, reply)

dataset/ETHPy150Open openstack/shaker/shaker/tests/test_operations.py TestOperations.test_execute_operation_process_reply/original