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: Ia561a40708efb4346146ab0456adc1a1f1565b47
This commit is contained in:
jacky06 2020-04-06 12:47:42 +08:00
parent 0d9a003060
commit cddffe6af3
35 changed files with 36 additions and 36 deletions

View File

@ -5,7 +5,6 @@ eventlet==0.18.2
fixtures==3.0.0
greenlet==0.4.10
keystonemiddleware==4.17.0
mock==2.0.0
openstackdocstheme==1.18.1
os-api-ref==1.4.0
oslo.concurrency==3.26.0

View File

@ -14,7 +14,7 @@
# under the License.
import copy
import mock
from unittest import mock
from searchlight.elasticsearch.plugins import base

View File

@ -26,7 +26,6 @@ import datetime
import elasticsearch
import importlib
import logging as std_logging
import mock
import os
import platform
import requests
@ -37,6 +36,7 @@ import socket
import sys
import tempfile
import time
from unittest import mock
import fixtures
from oslo_log import log as logging

View File

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import os
import six
import time
from unittest import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils

View File

@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from searchlight.listener import NotificationEndpoint
from searchlight.pipeline import PipelineManager

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 searchlight.listener import NotificationEndpoint
from searchlight.pipeline import PipelineManager

View File

@ -14,7 +14,7 @@
# limitations under the License.
import copy
import mock
from unittest import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils

View File

@ -14,7 +14,7 @@
# limitations under the License.
import datetime
import mock
from unittest import mock
from oslo_config import cfg
import oslo_utils

View File

@ -14,7 +14,7 @@
# limitations under the License.
import copy
import mock
from unittest import mock
from oslo_utils import uuidutils

View File

@ -11,7 +11,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 searchlight.listener import NotificationEndpoint
from searchlight.pipeline import PipelineManager

View File

@ -14,7 +14,7 @@
# under the License.
import datetime
import mock
from unittest import mock
from searchlight.elasticsearch.plugins.cinder import serialize_cinder_snapshot
from searchlight.elasticsearch.plugins.cinder \

View File

@ -14,7 +14,7 @@
# under the License.
import datetime
import mock
from unittest import mock
from oslo_utils import uuidutils

View File

@ -14,7 +14,7 @@
# under the License.
import datetime
import mock
from unittest import mock
from searchlight.elasticsearch.plugins.designate import \
recordsets as recordsets_plugin

View File

@ -14,7 +14,7 @@
# under the License.
import datetime
import mock
from unittest import mock
from searchlight.elasticsearch.plugins import designate
from searchlight.elasticsearch import ROLE_USER_FIELD

View File

@ -15,7 +15,7 @@
import copy
import datetime
import mock
from unittest import mock
import glanceclient.exc

View File

@ -15,7 +15,7 @@
import copy
import datetime
import mock
from unittest import mock
from searchlight.elasticsearch.plugins.base import NotificationBase
from searchlight.elasticsearch.plugins.glance import metadefs as md_plugin

View File

@ -15,9 +15,9 @@
import copy
from elasticsearch import exceptions as es_exceptions
import mock
from oslo_config import cfg
import six
from unittest import mock
from searchlight.elasticsearch.plugins import helper
from searchlight.elasticsearch import ROLE_USER_FIELD

View File

@ -10,7 +10,8 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from ironicclient import exceptions as ironic_exc
from keystoneclient import exceptions as keystone_exc

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 searchlight.elasticsearch.plugins import base
from searchlight import listener

View File

@ -14,7 +14,7 @@
# limitations under the License.
import datetime
import mock
from unittest import mock
from oslo_utils import uuidutils

View File

@ -14,8 +14,8 @@
# limitations under the License.
import datetime
import mock
from oslo_utils import uuidutils
from unittest import mock
from searchlight.common import utils
from searchlight.elasticsearch.plugins.neutron import\

View File

@ -14,7 +14,7 @@
# limitations under the License.
import datetime
import mock
from unittest import mock
from oslo_utils import uuidutils

View File

@ -11,7 +11,7 @@
# under the License.
import datetime
import mock
from unittest import mock
import novaclient.v2.flavors as novaclient_flavors

View File

@ -13,7 +13,7 @@
# under the License.
import datetime
import mock
from unittest import mock
import novaclient.v2.hypervisors as novaclient_hypervisors

View File

@ -14,9 +14,9 @@
# under the License.
import datetime
import mock
import novaclient.exceptions
import novaclient.v2.servers as novaclient_servers
from unittest import mock
from searchlight.elasticsearch.plugins.nova import\
servers as servers_plugin

View File

@ -13,7 +13,7 @@
# under the License.
import datetime
import mock
from unittest import mock
import novaclient.v2.server_groups as novaclient_server_groups

View File

@ -15,10 +15,10 @@
import collections
import copy
import mock
import operator
import six
import types
from unittest import mock
from oslo_config import cfg

View File

@ -12,8 +12,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from elasticsearch import exceptions as es_exc
import mock
from unittest import mock
from oslo_config import cfg
import oslo_utils

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 elasticsearch import exceptions as es_exc
from searchlight.common import utils as common_utils

View File

@ -13,8 +13,8 @@
# See the 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 searchlight import service_policies

View File

@ -14,7 +14,7 @@
# under the License.
import fixtures
import mock
from unittest import mock
import webob
from searchlight.common import wsgi

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
import webob
from searchlight.api.v1 import search

View File

@ -14,10 +14,10 @@
# under the License.
from elasticsearch import exceptions as es_exc
import mock
import operator
from oslo_serialization import jsonutils
import six
from unittest import mock
import webob.exc
from searchlight.api.v1 import search

View File

@ -23,9 +23,9 @@ import shlex
import shutil
import socket
import subprocess
from unittest import mock
import fixtures
import mock
from oslo_config import cfg
import six
from six.moves import BaseHTTPServer

View File

@ -11,7 +11,6 @@ Babel!=2.4.0,>=2.3.4 # BSD
# Needed for testing
coverage>=4.5.2 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0
requests>=2.21.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0