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: Ie841dc9738ed029ef01add3681ed76112e2cdca3
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 12:00:29 -05:00
parent 4627fbfb4a
commit 1fa7b5ed6e
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
132 changed files with 189 additions and 132 deletions

View File

@ -11,7 +11,8 @@
# under the License.
import jsonschema
import mock
from unittest import mock
from webob import exc
from senlin.api.common import util

View File

@ -11,9 +11,9 @@
# under the License.
import socket
from unittest import mock
import fixtures
import mock
from oslo_config import cfg
from oslo_utils import encodeutils
import webob

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_middleware import ssl
from senlin.api import middleware as mw

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.api.middleware import trust
from senlin.common import context

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import webob
from senlin.api.common import version_request as vr

View File

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

View File

@ -11,7 +11,8 @@
# under the License.
import http.client as http_client
import mock
from unittest import mock
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
import webob

View File

@ -11,7 +11,8 @@
# under the License.
import copy
import mock
from unittest import mock
from webob import exc
from oslo_serialization import jsonutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.api.middleware import fault
from senlin.api.openstack.v1 import build_info

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from senlin.api.common import util

View File

@ -11,8 +11,8 @@
# under the License.
import copy
from unittest import mock
import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from webob import exc

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from senlin.api.common import util

View File

@ -11,7 +11,8 @@
# under the License.
import copy
import mock
from unittest import mock
from webob import exc
from oslo_serialization import jsonutils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from oslo_serialization import jsonutils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from senlin.api.common import util

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from senlin.api.common import util

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from oslo_serialization import jsonutils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from oslo_serialization import jsonutils

View File

@ -13,7 +13,7 @@
import datetime
import iso8601
import mock
from unittest import mock
from senlin.api.openstack.v1 import services
from senlin.common import policy

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.api.common import version_request as vr
from senlin.api.common import wsgi

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from webob import exc
from oslo_serialization import jsonutils

View File

@ -9,7 +9,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_config import cfg
from senlin.cmd import conductor

View File

@ -9,7 +9,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_config import cfg
from senlin.cmd import engine

View File

@ -9,7 +9,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_config import cfg
from senlin.cmd import health_manager

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import dispatcher as rpc
from senlin.common import consts

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import dispatcher as rpc
from senlin.common import consts

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import dispatcher as rpc
from senlin.common import consts

View File

@ -10,7 +10,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 oslo_messaging.rpc import dispatcher as rpc
from oslo_utils import uuidutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.conductor import service
from senlin.objects import credential as co

View File

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

View File

@ -10,7 +10,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 oslo_messaging.rpc import dispatcher as rpc

View File

@ -11,7 +11,8 @@
# under the License.
import copy
import mock
from unittest import mock
from oslo_config import cfg
from oslo_messaging.rpc import dispatcher as rpc
from oslo_utils import uuidutils

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import dispatcher as rpc
from senlin.common import exception as exc

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import dispatcher as rpc
from senlin.common import exception as exc

View File

@ -11,8 +11,8 @@
# under the License.
import copy
from unittest import mock
import mock
from oslo_config import cfg
from oslo_messaging.rpc import dispatcher as rpc
from oslo_utils import uuidutils

View File

@ -10,7 +10,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 oslo_messaging.rpc import dispatcher as rpc

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import dispatcher as rpc
from senlin.common import consts

View File

@ -11,9 +11,9 @@
# under the License.
import datetime
from unittest import mock
import eventlet
import mock
from oslo_config import cfg
import oslo_messaging
from oslo_utils import timeutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_db.sqlalchemy import utils as sa_utils
from oslo_utils import timeutils as tu

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_db.sqlalchemy import utils as sa_utils
from oslo_utils import timeutils as tu

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_db.sqlalchemy import utils as sa_utils
from oslo_serialization import jsonutils
from oslo_utils import timeutils as tu

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_db.sqlalchemy import utils as sa_utils
from oslo_utils import timeutils as tu

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_db.sqlalchemy import utils as sa_utils
from oslo_utils import timeutils as tu

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_db.sqlalchemy import utils as sa_utils
from oslo_utils import timeutils as tu

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.db.sqlalchemy import api as db_api
from senlin.db.sqlalchemy import utils as db_utils

View File

@ -12,7 +12,8 @@
# under the License.
import mock
from unittest import mock
from oslo_utils import timeutils
import pytz
from sqlalchemy.dialects.mysql import base as mysql_base

View File

@ -10,7 +10,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 oslo_utils import timeutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.drivers.os import cinder_v2
from senlin.drivers import sdk

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.drivers.container import docker_v1
from senlin.tests.unit.common import base

View File

@ -10,7 +10,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 senlin.drivers import base as driver_base

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.drivers.os import glance_v2
from senlin.drivers import sdk

View File

@ -10,7 +10,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 senlin.drivers.os import heat_v1

View File

@ -11,8 +11,8 @@
# under the License.
import copy
from unittest import mock
import mock
from oslo_config import cfg
from senlin.drivers.os import keystone_v3 as kv3

View File

@ -11,7 +11,7 @@
# under the License.
import eventlet
import mock
from unittest import mock
from oslo_context import context as oslo_context

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.drivers.os import mistral_v2
from senlin.drivers import sdk

View File

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

View File

@ -10,8 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from openstack import exceptions as sdk_exc
from unittest import mock
from oslo_config import cfg
from senlin.drivers.os import nova_v2

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.drivers.os import octavia_v2
from senlin.drivers import sdk

View File

@ -11,8 +11,8 @@
# under the License.
import types
from unittest import mock
import mock
from openstack import connection
from oslo_serialization import jsonutils
from requests import exceptions as req_exc

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from openstack import exceptions as sdk_exc

View File

@ -12,8 +12,8 @@
import copy
import eventlet
from unittest import mock
import mock
from oslo_config import cfg
from oslo_utils import timeutils
from oslo_utils import uuidutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.engine.actions import cluster_action as ca
from senlin.engine import cluster as cm

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.common import exception as exc

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import cluster_action as ca

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -11,7 +11,7 @@
# under the License.
import eventlet
import mock
from unittest import mock
from senlin.common import consts
from senlin.common import scaleutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.common import scaleutils as su

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.common import scaleutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.common import scaleutils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import cluster_action as ca

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import consts
from senlin.engine.actions import base as ab

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.engine.actions import cluster_action as ca
from senlin.engine import cluster as cm

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import eventlet
import mock
from unittest import mock
from senlin.engine.actions import base as ab
from senlin.engine.actions import cluster_action as ca

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import context
from senlin.engine.notifications import heat_endpoint

View File

@ -11,7 +11,7 @@
# under the License.
import mock
from unittest import mock
from oslo_config import cfg

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import context
from senlin.engine.notifications import nova_endpoint

View File

@ -11,8 +11,8 @@
# under the License.
import mock
import socket
from unittest import mock
from keystoneauth1 import loading as ks_loading
from oslo_config import cfg

View File

@ -10,7 +10,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 oslo_context import context as oslo_ctx
from oslo_utils import timeutils

View File

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

View File

@ -10,7 +10,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 senlin.common import consts

View File

@ -12,9 +12,9 @@
import io
import os
from unittest import mock
import urllib
import mock
from senlin.engine import parser
from senlin.tests.unit.common import base

View File

@ -11,7 +11,7 @@
# under the License.
import glob
import mock
from unittest import mock
from senlin.common import exception
from senlin.engine import environment

View File

@ -10,7 +10,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 oslo_log import log as logging
import testtools

View File

@ -12,8 +12,8 @@
import re
import time
from unittest import mock
import mock
from oslo_config import cfg
from oslo_utils import timeutils as tu

View File

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

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.engine import registry
from senlin.tests.unit.common import base

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from senlin.common import utils as common_utils
from senlin.engine import senlin_lock as lockm

View File

@ -11,7 +11,8 @@
# under the License.
import eventlet
import mock
from unittest import mock
from oslo_config import cfg
from oslo_context import context as oslo_context
import oslo_messaging

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import testtools
from unittest import mock
from senlin.common import consts
from senlin.events import base

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import testtools
from unittest import mock
from senlin.common import consts
from senlin.events import base

View File

@ -10,7 +10,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 oslo_log import log as logging
from oslo_utils import timeutils

View File

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

View File

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

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_versionedobjects import base as ovo_base
from oslo_versionedobjects import exception as exc

View File

@ -10,7 +10,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 oslo_utils import timeutils
from oslo_utils import uuidutils

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