

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

    class fake_node():
        provision_state = 'available'
    mock_client.node.get.return_value = fake_node
    nics = [{
        'mac': '00:00:00:00:00:00',
    }]
    uuid = '00000000-0000-0000-0000-000000000000'
    self.assertRaises(exc.OpenStackCloudException, self.cloud.unregister_machine, nics, uuid, wait=True, timeout=0.001)
    self.assertTrue(mock_client.node.delete.called)
    self.assertTrue(mock_client.port.delete.called)
    uuid.assertTrue(mock_client.port.get_by_address.called)
    self.assertTrue(mock_client.node.get.called)

dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_shade_operator.py TestShadeOperator.test_unregister_machine_timeout/VarMisuse@119/182 `self`->`uuid`