Switch to unittest mock

Python3 have a standard library for mock in the unittest module,
let's drop the mock requirement and switch tests to unittest mock.

Change-Id: I4f1b3e25c8adbc24cdda51c73da3b66967f7ef23
This commit is contained in:
Iury Gregory Melo Ferreira 2020-04-07 10:33:11 +02:00
parent 2ffbfb4b46
commit d6e7552457
130 changed files with 179 additions and 135 deletions

View File

@ -20,9 +20,9 @@
# ceilometer/tests/api/__init__.py). This should be oslo'ified: # ceilometer/tests/api/__init__.py). This should be oslo'ified:
# https://bugs.launchpad.net/ironic/+bug/1255115. # https://bugs.launchpad.net/ironic/+bug/1255115.
from unittest import mock
from urllib import parse as urlparse from urllib import parse as urlparse
import mock
from oslo_config import cfg from oslo_config import cfg
import pecan import pecan
import pecan.testing import pecan.testing

View File

@ -17,8 +17,8 @@ are blocked or allowed to be processed.
""" """
from http import client as http_client from http import client as http_client
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from ironic.tests.unit.api import base from ironic.tests.unit.api import base

View File

@ -13,8 +13,9 @@
Tests to assert that audit middleware works as expected. Tests to assert that audit middleware works as expected.
""" """
from unittest import mock
from keystonemiddleware import audit from keystonemiddleware import audit
import mock
from oslo_config import cfg from oslo_config import cfg
from ironic.common import exception from ironic.common import exception

View File

@ -13,7 +13,8 @@
Tests to assert that audit middleware works as expected. Tests to assert that audit middleware works as expected.
""" """
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_middleware import healthcheck from oslo_middleware import healthcheck

View File

@ -16,8 +16,8 @@
from http import client as http_client from http import client as http_client
import json import json
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from osprofiler import web from osprofiler import web

View File

@ -11,7 +11,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from ironic.cmd import conductor from ironic.cmd import conductor

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from ironic.cmd import dbsync from ironic.cmd import dbsync
from ironic.common import context from ironic.common import context

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_upgradecheck.upgradecheck import Code from oslo_upgradecheck.upgradecheck import Code
from ironic.cmd import dbsync from ironic.cmd import dbsync

View File

@ -14,10 +14,10 @@
import datetime import datetime
from http import client as http_client from http import client as http_client
import json import json
from unittest import mock
from cinderclient import exceptions as cinder_exceptions from cinderclient import exceptions as cinder_exceptions
import cinderclient.v3 as cinderclient import cinderclient.v3 as cinderclient
import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ironic.common import cinder from ironic.common import cinder

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_context import context as oslo_context from oslo_context import context as oslo_context
from ironic.common import context from ironic.common import context
@ -49,7 +50,7 @@ class RequestContextTestCase(tests_base.TestCase):
{'project_name': 'demo', 'is_public_api': True, {'project_name': 'demo', 'is_public_api': True,
'domain_id': 'meow'}) 'domain_id': 'meow'})
self.assertEqual('demo', test_context.project_name) self.assertEqual('demo', test_context.project_name)
self.assertEqual('meow', test_context.user_domain) self.assertEqual('meow', test_context.user_domain_id)
self.assertTrue(test_context.is_public_api) self.assertTrue(test_context.is_public_api)
def test_to_policy_values(self): def test_to_policy_values(self):

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from stevedore import named from stevedore import named

View File

@ -17,11 +17,11 @@
import datetime import datetime
import importlib import importlib
import time import time
from unittest import mock
from glanceclient import client as glance_client from glanceclient import client as glance_client
from glanceclient import exc as glance_exc from glanceclient import exc as glance_exc
from keystoneauth1 import loading as kaloading from keystoneauth1 import loading as kaloading
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils
import retrying import retrying

View File

@ -16,8 +16,8 @@ from http import client as http_client
import io import io
import os import os
import shutil import shutil
from unittest import mock
import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
import requests import requests
import sendfile import sendfile

View File

@ -19,10 +19,10 @@ import builtins
import io import io
import os import os
import shutil import shutil
from unittest import mock
from ironic_lib import disk_utils from ironic_lib import disk_utils
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg

View File

@ -10,8 +10,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
import fixtures import fixtures
import mock
import oslo_messaging import oslo_messaging
import webob import webob

View File

@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
from keystoneauth1 import loading as kaloading from keystoneauth1 import loading as kaloading
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture from oslo_config import fixture

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ironic.common import exception from ironic.common import exception

View File

@ -12,9 +12,9 @@
import copy import copy
import time import time
from unittest import mock
from keystoneauth1 import loading as kaloading from keystoneauth1 import loading as kaloading
import mock
from neutronclient.common import exceptions as neutron_client_exc from neutronclient.common import exceptions as neutron_client_exc
from neutronclient.v2_0 import client from neutronclient.v2_0 import client
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -10,13 +10,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
import ddt import ddt
from keystoneauth1 import exceptions as kaexception from keystoneauth1 import exceptions as kaexception
import mock
import requests import requests
from ironic.common import context from ironic.common import context
from ironic.common import keystone from ironic.common import keystone
from ironic.common import nova from ironic.common import nova

View File

@ -16,8 +16,8 @@
# under the License. # under the License.
import sys import sys
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_policy import policy as oslo_policy from oslo_policy import policy as oslo_policy

View File

@ -16,9 +16,9 @@
import os import os
import tempfile import tempfile
from unittest import mock
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import fileutils from oslo_utils import fileutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import versionutils from oslo_utils import versionutils
from ironic.api.controllers.v1 import versions as api_versions from ironic.api.controllers.v1 import versions as api_versions

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging import oslo_messaging
from oslo_service import service as base_service from oslo_service import service as base_service

View File

@ -15,8 +15,8 @@
import builtins import builtins
from http import client as http_client from http import client as http_client
import io import io
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from swiftclient import client as swift_client from swiftclient import client as swift_client
from swiftclient import exceptions as swift_exception from swiftclient import exceptions as swift_exception

View File

@ -19,9 +19,9 @@ import os
import os.path import os.path
import shutil import shutil
import tempfile import tempfile
from unittest import mock
import jinja2 import jinja2
import mock
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import netutils from oslo_utils import netutils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg

View File

@ -17,8 +17,9 @@
"""Test utils for Ironic Managers.""" """Test utils for Ironic Managers."""
from unittest import mock
from futurist import periodics from futurist import periodics
import mock
from oslo_utils import strutils from oslo_utils import strutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -12,7 +12,8 @@
"""Unit tests for functionality related to allocations.""" """Unit tests for functionality related to allocations."""
import mock from unittest import mock
import oslo_messaging as messaging import oslo_messaging as messaging
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -13,13 +13,13 @@
"""Test class for Ironic BaseConductorManager.""" """Test class for Ironic BaseConductorManager."""
import collections import collections
from unittest import mock
import uuid import uuid
import eventlet import eventlet
import futurist import futurist
from futurist import periodics from futurist import periodics
from ironic_lib import mdns from ironic_lib import mdns
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_db import exception as db_exception from oslo_db import exception as db_exception
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -12,7 +12,8 @@
"""Tests for cleaning bits.""" """Tests for cleaning bits."""
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -13,7 +13,8 @@
"""Tests for deployment aspects of the conductor.""" """Tests for deployment aspects of the conductor."""
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_db import exception as db_exception from oslo_db import exception as db_exception
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -22,10 +22,10 @@ from collections import namedtuple
import datetime import datetime
import queue import queue
import re import re
from unittest import mock
import eventlet import eventlet
from futurist import waiters from futurist import waiters
import mock
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -15,7 +15,8 @@
"""Test class for ironic-conductor notification utilities.""" """Test class for ironic-conductor notification utilities."""
import mock from unittest import mock
from oslo_versionedobjects.exception import VersionedObjectsException from oslo_versionedobjects.exception import VersionedObjectsException
from ironic.common import exception from ironic.common import exception

View File

@ -19,8 +19,8 @@ Unit Tests for :py:class:`ironic.conductor.rpcapi.ConductorAPI`.
""" """
import copy import copy
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging
from oslo_messaging import _utils as messaging_utils from oslo_messaging import _utils as messaging_utils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -17,8 +17,9 @@
"""Tests for :class:`ironic.conductor.task_manager`.""" """Tests for :class:`ironic.conductor.task_manager`."""
from unittest import mock
import futurist import futurist
import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ironic.common import driver_factory from ironic.common import driver_factory

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import time import time
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils from oslo_utils import timeutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -36,10 +36,10 @@ For postgres on Ubuntu this can be done with the following commands:
import collections import collections
import contextlib import contextlib
from unittest import mock
from alembic import script from alembic import script
import fixtures import fixtures
import mock
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import enginefacade from oslo_db.sqlalchemy import enginefacade
from oslo_db.sqlalchemy import test_fixtures from oslo_db.sqlalchemy import test_fixtures

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import random import random
from unittest import mock
import mock
from oslo_db.sqlalchemy import utils as db_utils from oslo_db.sqlalchemy import utils as db_utils
from oslo_utils import uuidutils from oslo_utils import uuidutils
from testtools import matchers from testtools import matchers

View File

@ -16,8 +16,8 @@
"""Tests for manipulating Conductors via the DB API""" """Tests for manipulating Conductors via the DB API"""
import datetime import datetime
from unittest import mock
import mock
import oslo_db import oslo_db
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from oslo_db import sqlalchemy from oslo_db import sqlalchemy

View File

@ -16,8 +16,8 @@
"""Tests for manipulating Nodes via the DB API""" """Tests for manipulating Nodes via the DB API"""
import datetime import datetime
from unittest import mock
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import inspect import inspect
from unittest import mock
import mock
import stevedore import stevedore
from ironic.common import dhcp_factory from ironic.common import dhcp_factory

View File

@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from neutronclient.common import exceptions as neutron_client_exc from neutronclient.common import exceptions as neutron_client_exc
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -11,9 +11,9 @@
# limitations under the License. # limitations under the License.
import json import json
from unittest import mock
from ironic_lib import utils as irlib_utils from ironic_lib import utils as irlib_utils
import mock
from oslo_concurrency import processutils from oslo_concurrency import processutils
from ironic.common import exception from ironic.common import exception

View File

@ -19,8 +19,9 @@
Test class for DRAC BIOS configuration specific methods Test class for DRAC BIOS configuration specific methods
""" """
from unittest import mock
from dracclient import exceptions as drac_exceptions from dracclient import exceptions as drac_exceptions
import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -18,7 +18,8 @@
Test class for DRAC boot interface Test class for DRAC boot interface
""" """
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices

View File

@ -15,8 +15,9 @@
Test class for common methods used by DRAC modules. Test class for common methods used by DRAC modules.
""" """
from unittest import mock
import dracclient.client import dracclient.client
import mock
from ironic.common import exception from ironic.common import exception
from ironic.drivers.modules.drac import common as drac_common from ironic.drivers.modules.drac import common as drac_common

View File

@ -15,8 +15,9 @@
Test class for DRAC inspection interface Test class for DRAC inspection interface
""" """
from unittest import mock
from dracclient import exceptions as drac_exceptions from dracclient import exceptions as drac_exceptions
import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -15,8 +15,9 @@
Test class for DRAC job specific methods Test class for DRAC job specific methods
""" """
from unittest import mock
from dracclient import exceptions as drac_exceptions from dracclient import exceptions as drac_exceptions
import mock
from ironic.common import exception from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -20,7 +20,8 @@
Test class for DRAC management interface Test class for DRAC management interface
""" """
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
import ironic.common.boot_devices import ironic.common.boot_devices

View File

@ -15,7 +15,7 @@
Test class for DRAC periodic tasks Test class for DRAC periodic tasks
""" """
import mock from unittest import mock
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.conductor import utils as manager_utils from ironic.conductor import utils as manager_utils

View File

@ -15,9 +15,10 @@
Test class for DRAC power interface Test class for DRAC power interface
""" """
from unittest import mock
from dracclient import constants as drac_constants from dracclient import constants as drac_constants
from dracclient import exceptions as drac_exceptions from dracclient import exceptions as drac_exceptions
import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -15,9 +15,10 @@
Test class for DRAC RAID interface Test class for DRAC RAID interface
""" """
from unittest import mock
from dracclient import constants from dracclient import constants
from dracclient import exceptions as drac_exceptions from dracclient import exceptions as drac_exceptions
import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -12,7 +12,7 @@
# under the License. # under the License.
"""Test base class for iBMC Driver.""" """Test base class for iBMC Driver."""
import mock from unittest import mock
from ironic.drivers.modules.ibmc import utils from ironic.drivers.modules.ibmc import utils
from ironic.tests.unit.db import base as db_base from ironic.tests.unit.db import base as db_base

View File

@ -13,8 +13,8 @@
"""Test class for iBMC Management interface.""" """Test class for iBMC Management interface."""
import itertools import itertools
from unittest import mock
import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices

View File

@ -12,7 +12,8 @@
# under the License. # under the License.
"""Test class for iBMC Power interface.""" """Test class for iBMC Power interface."""
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -14,8 +14,8 @@
import copy import copy
import os import os
from unittest import mock
import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -12,7 +12,8 @@
# under the License. # under the License.
"""Test class for iBMC vendor interface.""" """Test class for iBMC vendor interface."""
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -15,7 +15,8 @@
"""Test class for IloPower module.""" """Test class for IloPower module."""
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils

View File

@ -17,9 +17,9 @@
import io import io
import tempfile import tempfile
from unittest import mock
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg from oslo_config import cfg
from ironic.common import boot_devices from ironic.common import boot_devices

View File

@ -21,9 +21,9 @@ import io
import os import os
import shutil import shutil
import tempfile import tempfile
from unittest import mock
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -15,7 +15,7 @@
"""Test class for common methods used by iLO modules.""" """Test class for common methods used by iLO modules."""
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -16,9 +16,10 @@
import builtins import builtins
import io import io
from unittest import mock
from urllib import parse as urlparse from urllib import parse as urlparse
import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -15,7 +15,7 @@
"""Test class for Management Interface used by iLO modules.""" """Test class for Management Interface used by iLO modules."""
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -14,7 +14,8 @@
"""Test class for Management Interface used by iLO modules.""" """Test class for Management Interface used by iLO modules."""
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -15,7 +15,8 @@
"""Test class for IloPower module.""" """Test class for IloPower module."""
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -14,7 +14,8 @@
"""Test class for Raid Interface used by iLO5.""" """Test class for Raid Interface used by iLO5."""
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -15,7 +15,7 @@
"""Test class for vendor methods used by iLO modules.""" """Test class for vendor methods used by iLO modules."""
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -16,7 +16,7 @@
Test class for IRMC BIOS configuration Test class for IRMC BIOS configuration
""" """
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -20,9 +20,9 @@ import io
import os import os
import shutil import shutil
import tempfile import tempfile
from unittest import mock
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -16,7 +16,8 @@
Test class for common methods used by iRMC modules. Test class for common methods used by iRMC modules.
""" """
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -16,7 +16,7 @@
Test class for iRMC Inspection Driver Test class for iRMC Inspection Driver
""" """
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -17,10 +17,9 @@ Test class for iRMC Management Driver
""" """
import os import os
from unittest import mock
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import mock
from ironic.common import boot_devices from ironic.common import boot_devices
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -16,7 +16,8 @@
Test class for iRMC periodic tasks Test class for iRMC periodic tasks
""" """
import mock from unittest import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -16,7 +16,7 @@
Test class for iRMC Power Driver Test class for iRMC Power Driver
""" """
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states

View File

@ -16,7 +16,7 @@
Test class for IRMC RAID configuration Test class for IRMC RAID configuration
""" """
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from neutronclient.common import exceptions as neutron_exceptions from neutronclient.common import exceptions as neutron_exceptions
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from neutronclient.common import exceptions as neutron_exceptions from neutronclient.common import exceptions as neutron_exceptions
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import os import os
from unittest import mock
import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from oslo_utils import units from oslo_utils import units

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -16,8 +16,8 @@
import collections import collections
import copy import copy
import os import os
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils
import requests import requests

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ironic.common import cinder as cinder_common from ironic.common import cinder as cinder_common

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from ironic.common import exception from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager

View File

@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
import types import types
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from ironic.common import dhcp_factory from ironic.common import dhcp_factory

View File

@ -15,8 +15,8 @@
import time import time
import types import types
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from testtools import matchers from testtools import matchers

View File

@ -14,8 +14,8 @@
from http import client as http_client from http import client as http_client
import json import json
from unittest import mock
import mock
import requests import requests
import retrying import retrying

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from ironic.common import boot_modes from ironic.common import boot_modes
from ironic.drivers.modules import boot_mode_utils from ironic.drivers.modules import boot_mode_utils

View File

@ -26,9 +26,9 @@ import string
import subprocess import subprocess
import tempfile import tempfile
import time import time
from unittest import mock
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_service import loopingcall from oslo_service import loopingcall
from oslo_utils import netutils from oslo_utils import netutils

View File

@ -16,9 +16,9 @@
import os import os
import tempfile import tempfile
from unittest import mock
import fixtures import fixtures
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import fileutils from oslo_utils import fileutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -20,9 +20,9 @@ import datetime
import os import os
import tempfile import tempfile
import time import time
from unittest import mock
import uuid import uuid
import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ironic.common import exception from ironic.common import exception

View File

@ -14,7 +14,8 @@
# under the License. # under the License.
import mock from unittest import mock
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception

View File

@ -10,8 +10,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
import eventlet import eventlet
import mock
import openstack import openstack
from ironic.common import context from ironic.common import context

View File

@ -28,10 +28,10 @@ import subprocess
import tempfile import tempfile
import time import time
import types import types
from unittest import mock
import fixtures import fixtures
from ironic_lib import utils as ironic_utils from ironic_lib import utils as ironic_utils
import mock
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_utils import uuidutils from oslo_utils import uuidutils

Some files were not shown because too many files have changed in this diff Show More