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: I1cffb9710f9e6b9b8b1f5e658d5af8668f3fca4c Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
0f90d197e1
commit
e164881bd5
|
@ -18,9 +18,10 @@ HTTP requests may be made as normal but they will not actually traverse
|
|||
a real socket.
|
||||
"""
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from keystoneauth1 import adapter
|
||||
from keystoneauth1 import session
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
import requests
|
||||
from wsgi_intercept import interceptor
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import os_resource_classes as orc
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import timeutils
|
||||
|
||||
|
|
|
@ -24,8 +24,9 @@ the tests.
|
|||
"""
|
||||
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from alembic import script
|
||||
import mock
|
||||
from oslo_db.sqlalchemy import test_fixtures
|
||||
from oslo_db.sqlalchemy import test_migrations
|
||||
from oslo_db.sqlalchemy import utils as db_utils
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import os_resource_classes as orc
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import os_resource_classes as orc
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_config import fixture as config_fixture
|
||||
from oslotest import output
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
# under the License.
|
||||
"""Unit tests for code in the aggregate handler that gabbi isn't covering."""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
import webob
|
||||
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
"""Unit tests for code in the trait handler that gabbi cannot easily cover."""
|
||||
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import microversion_parse
|
||||
import mock
|
||||
import webob
|
||||
|
||||
from placement import context
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils.fixture import uuidsentinel as uuids
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from placement import lib as placement_lib
|
||||
from placement.objects import allocation_candidate as ac_obj
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import os_resource_classes as orc
|
||||
from oslo_utils.fixture import uuidsentinel as uuids
|
||||
from oslo_utils import timeutils
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from placement.objects import trait
|
||||
from placement.tests.unit.objects import base
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from placement import context
|
||||
from placement import exception
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
import testtools
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_config import fixture as config_fixture
|
||||
import testtools
|
||||
|
||||
from placement import conf
|
||||
from placement import db_api
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# limitations under the License.
|
||||
"""Tests for the placement fault wrap middleware."""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
import testtools
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
# under the License.
|
||||
"""Unit tests for the functions used by the placement API handlers."""
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import microversion_parse
|
||||
import mock
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
import routes
|
||||
import testtools
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
import collections
|
||||
import operator
|
||||
import testtools
|
||||
import webob
|
||||
from unittest import mock
|
||||
|
||||
import microversion_parse
|
||||
import mock
|
||||
import testtools
|
||||
import webob
|
||||
|
||||
from placement import microversion
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
from oslo_config import cfg
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
# limitations under the License.
|
||||
"""Tests for the placement request log middleware."""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import testtools
|
||||
import webob
|
||||
|
||||
|
|
|
@ -14,18 +14,17 @@
|
|||
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import microversion_parse
|
||||
import mock
|
||||
from oslo_middleware import request_id
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
import testtools
|
||||
import webob
|
||||
|
||||
import six
|
||||
|
||||
from placement import context
|
||||
from placement import lib as pl
|
||||
from placement import microversion
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
hacking!=0.13.0,<0.14,>=0.12.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
|
||||
# NOTE(tetsuro): Local testing on osx may have problems to install packages,
|
||||
# psycopg2 and PYMySQL. You can workaround them using sys_platform qualifier.
|
||||
# See the https://review.opendev.org/#/c/671249/ for details. However, we
|
||||
|
|
Loading…
Reference in New Issue