

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

    class managable_node_state():
        provision_state = 'managable'

    class available_node_state():
        provision_state = 'available'
    node_provide_return_value = dict(provision_state='available')
    mock_client.node.get.side_effect = iter([managable_node_state, available_node_state])
    return_value = self.cloud.node_set_provision_state('test_node', 'provide', wait=True)
    self.assertEqual(mock_client.node.get.call_count, 2)
    self.assertDictEqual(node_provide_return_value, return_value)

dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_shade_operator.py TestShadeOperator.test_node_set_provision_state_wait_provide/original