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: Id266a937b37507a1cef05ac34e33a80265581ad1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 11:55:10 -05:00 committed by zhurong
parent 101882d9b6
commit 4866d54831
56 changed files with 73 additions and 56 deletions

View File

@ -14,9 +14,9 @@
# limitations under the License.
import logging
from unittest import mock
import fixtures
import mock
from oslo_utils import timeutils
import routes
import urllib

View File

@ -13,9 +13,9 @@
from io import StringIO
import os
import sys
from unittest import mock
import fixtures
import mock
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import webob
from keystoneauth1 import exceptions

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from murano.api.middleware import fault
from murano.common import wsgi

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import webob
from murano.api.middleware import version_negotiation

View File

@ -14,7 +14,8 @@
# under the License.
import json
import mock
from unittest import mock
from oslo_serialization import base64
from webob import response

View File

@ -15,7 +15,8 @@
# limitations under the License.
import mock
from unittest import mock
from oslo_utils import timeutils
from webob import exc

View File

@ -19,9 +19,9 @@ import imghdr
from io import StringIO
import os
import tempfile
from unittest import mock
import uuid
import mock
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_utils import timeutils

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import murano.tests.unit.api.base as tb
from unittest import mock
from oslo_config import fixture as config_fixture
from oslo_serialization import jsonutils

View File

@ -15,7 +15,7 @@
# limitations under the License.
from datetime import datetime
import mock
from unittest import mock
from oslo_config import fixture as config_fixture
from oslo_db import exception as db_exc

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import client
from webob import exc

View File

@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_config import fixture as config_fixture
from oslo_serialization import jsonutils
from webob import exc

View File

@ -15,7 +15,8 @@
# limitations under the License.
import mock
from unittest import mock
from oslo_messaging.rpc import client
from oslo_serialization import jsonutils
from webob import exc

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import sys
from unittest import mock
from oslo_concurrency import processutils
from oslo_log import log as logging

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_concurrency import processutils
from oslo_log import log as logging

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
try:

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 oslo_serialization import jsonutils
import ssl as ssl_module

View File

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

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from keystoneauth1 import loading as ka_loading

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_service import service

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 murano.common.plugins import extensions_loader

View File

@ -14,7 +14,7 @@
# under the License.
from datetime import datetime
import mock
from unittest import mock
from murano.common import server
from murano.services import states

View File

@ -14,8 +14,8 @@
# under the License.
import datetime as dt
import mock
import time
from unittest import mock
from oslo_utils import timeutils

View File

@ -15,8 +15,9 @@
import errno
import eventlet
import mock
import socket
from unittest import mock
import webob
from oslo_config import cfg

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from webob import exc
from murano.db.services import core_services

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import datetime as dt
import mock
from unittest import mock
import uuid
from oslo_utils import timeutils

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_db import exception
from oslo_utils import timeutils

View File

@ -13,8 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from unittest import mock
import fixtures
import mock
from murano.db.services import environment_templates as env_temp
from murano.tests.unit import base

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from murano.common import exceptions as exc
from murano.dsl import constants

View File

@ -9,7 +9,7 @@
# 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 murano.dsl import attribute_store
from murano.dsl import dsl

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 murano.dsl import context_manager
from murano.dsl import yaql_integration

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from testtools import matchers
from unittest import mock
from yaql.language import exceptions as yaql_exceptions
from murano.tests.unit.dsl.foundation import object_model as om

View File

@ -12,8 +12,8 @@
# limitations under the License.
import copy
import mock
import semantic_version
from unittest import mock
import weakref
from oslo_utils.uuidutils import generate_uuid

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from murano.dsl import helpers
from murano.engine.system import logger

View File

@ -9,7 +9,7 @@
# 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 murano.dsl import helpers
from murano.dsl import session_local_storage

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import semantic_version
from unittest import mock
from murano.tests.unit.dsl.foundation import object_model as om
from murano.tests.unit.dsl.foundation import test_case

View File

@ -18,8 +18,8 @@ import datetime
import json
import os
import tempfile
from unittest import mock
import mock
from oslo_serialization import base64
import yaml as yamllib

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from murano.engine.system import agent_listener
from murano.tests.unit import base

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import weakref
import mock
from testtools import matchers
from murano.dsl import exceptions

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from murano.db import models
from murano.engine.system import instance_reporter

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from murano.dsl import murano_object
from murano.engine.system import metadef_browser

View File

@ -13,7 +13,7 @@
# 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

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import testtools
from unittest import mock
from murano.dsl import murano_method
from murano.dsl import murano_type

View File

@ -15,13 +15,13 @@
# limitations under the License.
import random
from unittest import mock
try:
from mistralclient.api import client as mistralcli
except ImportError:
mistralcli = None
import mock
from oslo_config import cfg
from murano.dsl import murano_method

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 yaql import contexts
from yaql import specs

View File

@ -18,8 +18,8 @@ from muranoclient.common import exceptions as muranoclient_exc
import os
import shutil
import tempfile
from unittest import mock
import mock
import semantic_version
import testtools

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import os
import random
import shutil
import string
import tempfile
from unittest import mock
import yaml
import zipfile

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import os
import random
import semantic_version
import shutil
import string
import tempfile
from unittest import mock
from murano.packages import exceptions
from murano.packages import package_base

View File

@ -12,7 +12,7 @@
# 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
import murano.policy.modify.actions.action_manager as am
from murano.policy.modify.actions import default_actions as da

View File

@ -14,7 +14,8 @@
# under the License.
import congressclient
import mock
from unittest import mock
from oslo_config import cfg
from murano.common import engine

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from murano.services import actions
from murano.services import states

View File

@ -14,8 +14,8 @@
# limitations under the License.
import re
from unittest import mock
import mock
import semantic_version
import yaql
from yaql.language import exceptions

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import pycodestyle
import textwrap
from unittest import mock
from murano.hacking import checks
from murano.tests.unit import base

View File

@ -15,7 +15,8 @@
# limitations under the License.
from heatclient.v1 import stacks
import mock
from unittest import mock
from oslo_config import cfg
from murano.engine.system import heat_stack

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 webob import exc
from murano.services import states

View File

@ -5,7 +5,6 @@ hacking>=3.0,<4.0.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
nose>=1.3.7 # LGPL
oslotest>=3.2.0 # Apache-2.0
sqlalchemy-migrate>=0.11.0 # Apache-2.0