

@mock.patch.object(shade.OperatorCloud, 'ironic_client')
def test_activate_node_timeout(self, mock_client):

    class active_node_state():
        provision_state = 'active'

    class available_node_state():
        provision_state = 'available'
    mock_client.node.get.side_effect = iter([available_node_state, active_node_state])
    mock_client.node.set_provision_state.return_value = None
    node_id = 'node04'
    return_value = self.cloud.activate_node(node_id, configdrive='http://127.0.0.1/file.iso', wait=True, timeout=2)
    self.assertEqual(None, provision_state)
    mock_client.node.set_provision_state.assert_called_with(node_uuid='node04', state='active', configdrive='http://127.0.0.1/file.iso')
    self.assertEqual(mock_client.node.get.call_count, 2)

dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_shade_operator.py TestShadeOperator.test_activate_node_timeout/VarMisuse@112/180 `return_value`->`provision_state`