

@mock.patch.object(shade.OperatorCloud, 'ironic_client')
def test_inspect_machine_wait(self, mock_client):
    machine_uuid = '00000000-0000-0000-0000-000000000000'

    class manageable_machine():
        uuid = machine_uuid
        provision_state = 'manageable'

    class inspecting_machine():
        uuid = machine_uuid
        provision_state = 'inspecting'
    expected_return_value = dict(uuid=machine_uuid, provision_state='manageable')
    mock_client.node.get.side_effect = iter([manageable_machine, inspecting_machine, inspecting_machine, manageable_machine, manageable_machine])
    return_value = self.cloud.inspect_machine(machine_uuid, wait=True, timeout=1)
    self.assertDictEqual(provision_state, return_value)

dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_shade_operator.py TestShadeOperator.test_inspect_machine_wait/VarMisuse@123/202 `expected_return_value`->`provision_state`