Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library unittest.mock module instead of the third party mock lib. Change-Id: Ia6927351f591be0c57fd73515b2542a0af35f82b Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
115aa6c49a
commit
9a59610643
@ -23,9 +23,9 @@ import contextlib
|
||||
import datetime
|
||||
import eventlet
|
||||
eventlet.monkey_patch(os=False) # noqa
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
|
||||
import six
|
||||
import testtools
|
||||
|
@ -11,7 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from masakari.api.openstack.ha import extension_info
|
||||
from masakari import policy
|
||||
|
@ -15,8 +15,9 @@
|
||||
|
||||
"""Tests for the hosts api."""
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from six.moves import http_client as http
|
||||
from webob import exc
|
||||
|
@ -16,9 +16,9 @@
|
||||
"""Tests for the notifications api."""
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import timeutils
|
||||
from six.moves import http_client as http
|
||||
|
@ -15,8 +15,9 @@
|
||||
|
||||
"""Tests for the failover segment api."""
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from six.moves import http_client as http
|
||||
from webob import exc
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from six.moves import http_client as http
|
||||
import webob
|
||||
|
@ -17,8 +17,9 @@
|
||||
Test suites for 'common' code used throughout the OpenStack HTTP API.
|
||||
"""
|
||||
|
||||
import mock
|
||||
from testtools import matchers
|
||||
from unittest import mock
|
||||
|
||||
import webob
|
||||
|
||||
from masakari.api.openstack import common
|
||||
|
@ -13,7 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from six.moves import http_client as http
|
||||
import webob.exc
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import inspect
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import six
|
||||
from six.moves import http_client as http
|
||||
import testscenarios
|
||||
|
@ -13,9 +13,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import socket
|
||||
import testtools
|
||||
from unittest import mock
|
||||
|
||||
from masakari.api import utils as api_utils
|
||||
from masakari.notifications.objects import base as notification_base
|
||||
|
@ -11,7 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from masakari.cmd import api
|
||||
from masakari import config
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from six.moves import http_client as http
|
||||
|
||||
from keystoneauth1 import exceptions as keystone_exception
|
||||
|
@ -17,9 +17,9 @@
|
||||
Unit Tests for host failure TaskFlow
|
||||
"""
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from masakari.compute import nova
|
||||
from masakari import conf
|
||||
|
@ -17,7 +17,7 @@
|
||||
Unit Tests for instance failure TaskFlow
|
||||
"""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from masakari.compute import nova
|
||||
from masakari import context
|
||||
|
@ -17,7 +17,7 @@
|
||||
Unit Tests for process failure TaskFlow
|
||||
"""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from masakari.compute import nova
|
||||
from masakari import context
|
||||
|
@ -13,7 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import timeutils
|
||||
from taskflow.persistence import models
|
||||
from taskflow.persistence import path_based
|
||||
|
@ -12,7 +12,8 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
|
@ -17,8 +17,8 @@ Unit Tests for masakari.engine.rpcapi
|
||||
"""
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from masakari import context
|
||||
from masakari.engine import rpcapi as engine_rpcapi
|
||||
|
@ -13,9 +13,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import socket
|
||||
import testtools
|
||||
from unittest import mock
|
||||
|
||||
from masakari.engine import utils as engine_utils
|
||||
from masakari.notifications.objects import base as notification_base
|
||||
|
@ -16,7 +16,8 @@
|
||||
"""Tests for the failover segment api."""
|
||||
|
||||
import copy
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from masakari.api import utils as api_utils
|
||||
|
@ -14,8 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import collections
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import timeutils
|
||||
from oslo_versionedobjects import fixture
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from masakari.api import utils as api_utils
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
@ -18,8 +18,8 @@ import datetime
|
||||
import inspect
|
||||
import os
|
||||
import pprint
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_versionedobjects import exception as ovo_exc
|
||||
from oslo_versionedobjects import fixture
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from masakari.api import utils as api_utils
|
||||
|
@ -13,9 +13,9 @@
|
||||
# under the License.
|
||||
|
||||
import textwrap
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
import pep8
|
||||
|
||||
from masakari.hacking import checks
|
||||
|
@ -12,8 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
from masakari.cmd import manage
|
||||
from masakari import context
|
||||
|
@ -13,9 +13,9 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
import oslo_messaging as messaging
|
||||
from oslo_messaging.rpc import dispatcher
|
||||
from oslo_serialization import jsonutils
|
||||
|
@ -17,7 +17,8 @@
|
||||
Unit Tests for remote procedure calls using queue
|
||||
"""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
from oslo_service import service as _service
|
||||
|
@ -13,9 +13,9 @@
|
||||
# under the License.
|
||||
|
||||
import importlib
|
||||
from unittest import mock
|
||||
|
||||
import eventlet
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_context import context as common_context
|
||||
from oslo_context import fixture as context_fixture
|
||||
|
@ -19,10 +19,10 @@
|
||||
import os.path
|
||||
import socket
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
import eventlet
|
||||
import eventlet.wsgi
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import requests
|
||||
import testtools
|
||||
|
Loading…
Reference in New Issue
Block a user