@mock.patch.object(cloud_config.CloudConfig, 'get_session')
    @mock.patch.object(ironicclient.client, 'Client')
    def test_ironic_noauth_selection_using_a_task(
            self, mock_client, get_session_mock):
        session_mock = mock.Mock()
        session_mock.get_endpoint.return_value = None
        session_mock.get_token.return_value = 'yankee'
        get_session_mock.return_value = session_mock

        self.cloud_noauth.patch_machine('name', {})
        self.assertTrue(get_session_mock.called)
        self.assertTrue(mock_client.called)
Convert node to dict for restoring, works only in fake mode.
dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_operator_noauth.py/TestShadeOperatorNoAuth.test_ironic_noauth_selection_using_a_task--crossover with--dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/task/task.py/DeletionTask.format_node_to_restore