Replace third party mock with unittest.mock

Now that we no longer support older version of Python, there is no need
to use the third party 'mock' library for test mocking and can instead
use the standard library unittest mock module.

Change-Id: I1ea77249834e6c595c88f257226a483633be5f7a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-03-13 08:56:51 -05:00
parent 83ef3a8117
commit 59a36b7146
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
21 changed files with 26 additions and 22 deletions

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_config import fixture as fixture_config

View File

@ -19,9 +19,9 @@ import datetime
import json as jsonlib
import operator
import os
from unittest import mock
import fixtures
import mock
from oslo_utils import uuidutils
import six
from six import moves

View File

@ -16,8 +16,8 @@
"""Test basic aodh-api app
"""
import json
from unittest import mock
import mock
import six
import wsme

View File

@ -14,10 +14,10 @@
# under the License.
"""Test the methods related to complex query."""
import datetime
from unittest import mock
import fixtures
import jsonschema
import mock
from oslotest import base
import wsme

View File

@ -15,9 +15,9 @@
# under the License.
"""Test the methods related to query."""
import datetime
from unittest import mock
import fixtures
import mock
from oslo_utils import timeutils
from oslotest import base
import wsme

View File

@ -17,9 +17,9 @@
import os
import unittest
from unittest import mock
from gabbi import fixture
import mock
from oslo_config import cfg
from oslo_config import fixture as fixture_config
from oslo_policy import opts

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import abc
from unittest import mock
import mock
from oslo_db.sqlalchemy import test_migrations
import six

View File

@ -15,7 +15,8 @@
# under the License.
"""Tests for aodh/storage/
"""
import mock
from unittest import mock
from oslo_config import fixture as fixture_config
from oslotest import base

View File

@ -16,8 +16,8 @@
"""
import datetime
from unittest import mock
import mock
from oslo_utils import timeutils
from aodh import storage

View File

@ -13,7 +13,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 oslo_config import fixture
from oslotest import base

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import datetime
from unittest import mock
import mock
from oslo_utils import timeutils
from oslotest import base

View File

@ -12,9 +12,9 @@
# under the License.
"""Tests for aodh/evaluator/composite.py
"""
from unittest import mock
import fixtures
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils
import six

View File

@ -16,11 +16,11 @@
import copy
import datetime
import json
import six
from unittest import mock
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils
import six
from aodh import evaluator
from aodh.evaluator import event as event_evaluator

View File

@ -18,9 +18,9 @@ import datetime
import fixtures
import json
import unittest
from unittest import mock
from gnocchiclient import exceptions
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils
import pytz

View File

@ -13,8 +13,8 @@
# limitations under the License.
import datetime
from unittest import mock
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils

View File

@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_utils import netutils
from aodh.notifier import heat as heat_notifier

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 fixture as fixture_config
import tooz.coordination

View File

@ -16,8 +16,8 @@
"""
import fixtures
import time
from unittest import mock
import mock
from oslo_config import fixture as fixture_config
from stevedore import extension

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import time
from unittest import mock
from oslo_config import fixture as fixture_config
import oslo_messaging

View File

@ -15,8 +15,8 @@
import fixtures
import json
import time
from unittest import mock
import mock
from oslo_config import cfg
from oslo_config import fixture as fixture_config

View File

@ -49,7 +49,6 @@ test =
oslotest>=2.15.0 # Apache-2.0
coverage>=3.6
fixtures>=1.3.1
mock>=1.0
sqlalchemy-utils
testrepository>=0.0.18
testresources>=0.2.4 # Apache-2.0/BSD