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: I44e7b6f76e2d12f620ec602afc77ce11ba6b9d9a Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
7af0b68b79
commit
94b0876429
@ -17,9 +17,9 @@
|
||||
|
||||
import copy
|
||||
import datetime
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo_db import exception as db_exception
|
||||
from oslo_db.sqlalchemy import utils as sqlalchemyutils
|
||||
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
|
||||
|
@ -16,8 +16,8 @@ import glance.common.config
|
||||
import glance.common.wsgi
|
||||
import glance.image_cache
|
||||
from glance.tests import utils as test_utils
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import webob
|
||||
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import glance_store as store
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
from oslo_concurrency import processutils
|
||||
|
@ -13,8 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
from oslo_config import cfg
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
from oslo_concurrency import processutils
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import glance_store as store_api
|
||||
from oslo_config import cfg
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
from oslo_concurrency import processutils as putils
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
from oslo_concurrency import processutils
|
||||
|
@ -17,8 +17,8 @@ import os.path
|
||||
import shutil
|
||||
import tarfile
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
try:
|
||||
from defusedxml.cElementTree import ParseError
|
||||
except ImportError:
|
||||
|
@ -13,8 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
from glance_store._drivers import filesystem
|
||||
from glance_store import backend
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import glance.async_
|
||||
import glance.tests.utils as test_utils
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
from oslo_config import cfg
|
||||
|
@ -14,10 +14,10 @@
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import glance_store as store
|
||||
from glance_store import location
|
||||
import mock
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_config import cfg
|
||||
from oslo_db import options
|
||||
|
@ -13,7 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from six.moves import urllib
|
||||
|
||||
import glance.common.exception as exception
|
||||
|
@ -13,7 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from six.moves import urllib
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -13,7 +13,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
|
||||
import testtools
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import glance.common.scripts as scripts
|
||||
from glance.common.scripts.image_import import main as image_import
|
||||
|
@ -15,9 +15,9 @@
|
||||
|
||||
import calendar
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import iso8601
|
||||
import mock
|
||||
|
||||
from glance.common import timeutils
|
||||
from glance.tests import utils as test_utils
|
||||
|
@ -15,8 +15,8 @@
|
||||
# under the License.
|
||||
|
||||
import glance_store as store
|
||||
import mock
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
@ -19,11 +19,11 @@ import datetime
|
||||
import gettext
|
||||
import os
|
||||
import socket
|
||||
from unittest import mock
|
||||
|
||||
from babel import localedata
|
||||
import eventlet.patcher
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_serialization import jsonutils
|
||||
import routes
|
||||
|
@ -18,9 +18,9 @@ Tests for the sqlite image_cache driver.
|
||||
"""
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from glance.image_cache.drivers import sqlite
|
||||
from glance.tests import utils
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from glance.db.sqlalchemy.alembic_migrations import data_migrations
|
||||
from glance.tests import utils as test_utils
|
||||
|
@ -15,9 +15,9 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_utils import encodeutils
|
||||
|
@ -15,9 +15,9 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import oslo_utils.importutils
|
||||
|
||||
|
@ -14,8 +14,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
|
||||
from unittest import mock
|
||||
|
||||
from six.moves import range
|
||||
|
||||
from glance.domain import proxy
|
||||
|
@ -14,7 +14,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_db import exception as db_exception
|
||||
|
||||
from glance.cmd import manage
|
||||
|
@ -13,6 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from __future__ import absolute_import
|
||||
from unittest import mock
|
||||
|
||||
import copy
|
||||
import os
|
||||
@ -20,7 +21,6 @@ import sys
|
||||
import uuid
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
from six import moves
|
||||
|
@ -14,9 +14,9 @@
|
||||
# under the License.
|
||||
|
||||
from __future__ import absolute_import
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
from six.moves import StringIO
|
||||
|
||||
from glance.cmd import manage
|
||||
|
@ -15,9 +15,9 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import glance_store
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import oslo_messaging
|
||||
import webob
|
||||
|
@ -20,11 +20,11 @@ try:
|
||||
from collections.abc import Iterable
|
||||
except ImportError:
|
||||
from collections import Iterable
|
||||
from unittest import mock
|
||||
|
||||
import hashlib
|
||||
import os.path
|
||||
|
||||
import mock
|
||||
import oslo_config.cfg
|
||||
|
||||
import glance.api.policy
|
||||
|
@ -13,9 +13,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import copy
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from mock import patch
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import units
|
||||
|
@ -13,10 +13,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import glance_store
|
||||
import mock
|
||||
from mock import patch
|
||||
from oslo_config import cfg
|
||||
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
|
||||
|
@ -16,7 +16,7 @@ from cryptography import exceptions as crypto_exception
|
||||
from cursive import exception as cursive_exception
|
||||
from cursive import signature_utils
|
||||
import glance_store
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from glance.common import exception
|
||||
import glance.location
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import glance_store
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from glance.common import exception
|
||||
from glance.common import store_utils
|
||||
|
@ -16,7 +16,8 @@
|
||||
|
||||
from cryptography import exceptions as crypto_exception
|
||||
import glance_store as store
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from six.moves import urllib
|
||||
|
||||
|
@ -12,12 +12,12 @@
|
||||
# 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 unittest import mock
|
||||
import uuid
|
||||
|
||||
from cursive import exception as cursive_exception
|
||||
import glance_store
|
||||
from glance_store._drivers import filesystem
|
||||
import mock
|
||||
import six
|
||||
from six.moves import http_client as http
|
||||
import webob
|
||||
|
@ -17,11 +17,11 @@ import datetime
|
||||
import eventlet
|
||||
import hashlib
|
||||
import os
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
from castellan.common import exception as castellan_exception
|
||||
import glance_store as store
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
import webob
|
||||
|
@ -15,9 +15,9 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from six.moves import http_client as http
|
||||
|
@ -24,10 +24,10 @@ import socket
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
from unittest import mock
|
||||
|
||||
from alembic import command as alembic_command
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_config import fixture as cfg_fixture
|
||||
from oslo_log.fixture import logging_error as log_fixture
|
||||
|
@ -12,7 +12,6 @@ Babel!=2.4.0,>=2.3.4 # BSD
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
ddt>=1.0.1 # MIT
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
mock>=2.0.0 # BSD
|
||||
requests>=2.14.2 # Apache-2.0
|
||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||
testresources>=2.0.0 # Apache-2.0/BSD
|
||||
|
Loading…
Reference in New Issue
Block a user