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:
Sean McGinnis 2020-04-18 11:54:10 -05:00
parent 115aa6c49a
commit 9a59610643
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
31 changed files with 40 additions and 31 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -13,9 +13,9 @@
# under the License.
import textwrap
from unittest import mock
import ddt
import mock
import pep8
from masakari.hacking import checks

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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