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:
parent
101882d9b6
commit
4866d54831
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_serialization import base64
|
||||
from webob import response
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import timeutils
|
||||
from webob import exc
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# under the License.
|
||||
|
||||
import datetime as dt
|
||||
import mock
|
||||
import time
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import timeutils
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
|
||||
import errno
|
||||
import eventlet
|
||||
import mock
|
||||
import socket
|
||||
from unittest import mock
|
||||
|
||||
import webob
|
||||
|
||||
from oslo_config import cfg
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue