diff --git a/lower-constraints.txt b/lower-constraints.txt index 78d4ed37cb..2a646c2945 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -56,7 +56,6 @@ lxml==3.4.1 Mako==1.0.7 MarkupSafe==1.0 mccabe==0.4.0 -mock==2.0.0 monotonic==1.4 mox3==0.25.0 msgpack==0.5.6 diff --git a/trove/tests/fakes/swift.py b/trove/tests/fakes/swift.py index 23b360fb35..379aa8ff79 100644 --- a/trove/tests/fakes/swift.py +++ b/trove/tests/fakes/swift.py @@ -14,7 +14,7 @@ # under the License. from hashlib import md5 -from mock import MagicMock, patch +from unittest.mock import MagicMock, patch import json import os import socket diff --git a/trove/tests/unittests/api/common/test_limits.py b/trove/tests/unittests/api/common/test_limits.py index 8921422f23..2cf3be08d2 100644 --- a/trove/tests/unittests/api/common/test_limits.py +++ b/trove/tests/unittests/api/common/test_limits.py @@ -18,7 +18,7 @@ Tests dealing with HTTP rate-limiting. """ -from mock import Mock, MagicMock, patch +from unittest.mock import Mock, MagicMock, patch from oslo_serialization import jsonutils import six from six.moves import http_client diff --git a/trove/tests/unittests/api/test_versions.py b/trove/tests/unittests/api/test_versions.py index ca44f79505..4c6aca3913 100644 --- a/trove/tests/unittests/api/test_versions.py +++ b/trove/tests/unittests/api/test_versions.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import Mock +from unittest.mock import Mock import webob from trove.common import cfg diff --git a/trove/tests/unittests/backup/test_backup_models.py b/trove/tests/unittests/backup/test_backup_models.py index 98d44476fb..4cc9d113b9 100644 --- a/trove/tests/unittests/backup/test_backup_models.py +++ b/trove/tests/unittests/backup/test_backup_models.py @@ -13,9 +13,9 @@ import datetime -from mock import DEFAULT -from mock import MagicMock -from mock import patch +from unittest.mock import DEFAULT +from unittest.mock import MagicMock +from unittest.mock import patch from swiftclient.client import ClientException from trove.backup import models diff --git a/trove/tests/unittests/cluster/test_cassandra_cluster.py b/trove/tests/unittests/cluster/test_cassandra_cluster.py index 2934687858..a7c439d927 100644 --- a/trove/tests/unittests/cluster/test_cassandra_cluster.py +++ b/trove/tests/unittests/cluster/test_cassandra_cluster.py @@ -13,10 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import ANY -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import ANY +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from trove.cluster import models from trove.common.strategies.cluster.experimental.cassandra.api \ diff --git a/trove/tests/unittests/cluster/test_cluster.py b/trove/tests/unittests/cluster/test_cluster.py index 29df4ee85b..eec5b3cd7e 100644 --- a/trove/tests/unittests/cluster/test_cluster.py +++ b/trove/tests/unittests/cluster/test_cluster.py @@ -15,8 +15,8 @@ import uuid -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from trove.cluster.models import Cluster from trove.cluster.models import ClusterTasks from trove.cluster.models import DBCluster diff --git a/trove/tests/unittests/cluster/test_cluster_controller.py b/trove/tests/unittests/cluster/test_cluster_controller.py index 4d512b9351..59dfc6a92c 100644 --- a/trove/tests/unittests/cluster/test_cluster_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_controller.py @@ -15,9 +15,9 @@ # import jsonschema -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from testtools.matchers import Is, Equals from trove.cluster import models from trove.cluster.models import Cluster, DBCluster diff --git a/trove/tests/unittests/cluster/test_cluster_models.py b/trove/tests/unittests/cluster/test_cluster_models.py index d03d98235c..75a0967e22 100644 --- a/trove/tests/unittests/cluster/test_cluster_models.py +++ b/trove/tests/unittests/cluster/test_cluster_models.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.cluster import models from trove.common.strategies.cluster.experimental.mongodb.api import ( diff --git a/trove/tests/unittests/cluster/test_cluster_pxc_controller.py b/trove/tests/unittests/cluster/test_cluster_pxc_controller.py index 89edc3c975..24c29cff31 100644 --- a/trove/tests/unittests/cluster/test_cluster_pxc_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_pxc_controller.py @@ -13,9 +13,9 @@ import jsonschema -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from testtools.matchers import Is, Equals from trove.cluster import models from trove.cluster.models import Cluster diff --git a/trove/tests/unittests/cluster/test_cluster_redis_controller.py b/trove/tests/unittests/cluster/test_cluster_redis_controller.py index 80159cebad..e8e931c916 100644 --- a/trove/tests/unittests/cluster/test_cluster_redis_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_redis_controller.py @@ -13,9 +13,9 @@ import jsonschema -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from testtools.matchers import Is, Equals from trove.cluster import models from trove.cluster.models import Cluster diff --git a/trove/tests/unittests/cluster/test_cluster_vertica_controller.py b/trove/tests/unittests/cluster/test_cluster_vertica_controller.py index 8929870144..9d656a7ed2 100644 --- a/trove/tests/unittests/cluster/test_cluster_vertica_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_vertica_controller.py @@ -13,9 +13,9 @@ import jsonschema -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from testtools.matchers import Is, Equals from trove.cluster import models from trove.cluster.models import Cluster diff --git a/trove/tests/unittests/cluster/test_cluster_views.py b/trove/tests/unittests/cluster/test_cluster_views.py index bf061f27fd..9833da963e 100644 --- a/trove/tests/unittests/cluster/test_cluster_views.py +++ b/trove/tests/unittests/cluster/test_cluster_views.py @@ -14,9 +14,9 @@ # under the License. # -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from trove.cluster.views import ClusterInstanceDetailView from trove.cluster.views import ClusterView diff --git a/trove/tests/unittests/cluster/test_galera_cluster.py b/trove/tests/unittests/cluster/test_galera_cluster.py index 2557c25d68..2a5cca1177 100644 --- a/trove/tests/unittests/cluster/test_galera_cluster.py +++ b/trove/tests/unittests/cluster/test_galera_cluster.py @@ -13,8 +13,8 @@ import uuid -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from novaclient import exceptions as nova_exceptions diff --git a/trove/tests/unittests/cluster/test_models.py b/trove/tests/unittests/cluster/test_models.py index 6a853e0817..13040b6a9c 100644 --- a/trove/tests/unittests/cluster/test_models.py +++ b/trove/tests/unittests/cluster/test_models.py @@ -13,13 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import ANY -from mock import call -from mock import DEFAULT -from mock import MagicMock -from mock import Mock -from mock import patch -from mock import PropertyMock +from unittest.mock import ANY +from unittest.mock import call +from unittest.mock import DEFAULT +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch +from unittest.mock import PropertyMock from neutronclient.common import exceptions as neutron_exceptions diff --git a/trove/tests/unittests/cluster/test_redis_cluster.py b/trove/tests/unittests/cluster/test_redis_cluster.py index 3893404fe5..5f4e7650ab 100644 --- a/trove/tests/unittests/cluster/test_redis_cluster.py +++ b/trove/tests/unittests/cluster/test_redis_cluster.py @@ -13,8 +13,8 @@ import uuid -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from novaclient import exceptions as nova_exceptions from trove.cluster.models import Cluster from trove.cluster.models import ClusterTasks diff --git a/trove/tests/unittests/cluster/test_vertica_cluster.py b/trove/tests/unittests/cluster/test_vertica_cluster.py index 348a1887f6..8ef2301c7e 100644 --- a/trove/tests/unittests/cluster/test_vertica_cluster.py +++ b/trove/tests/unittests/cluster/test_vertica_cluster.py @@ -13,8 +13,8 @@ import uuid -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from novaclient import exceptions as nova_exceptions from trove.cluster.models import Cluster from trove.cluster.models import ClusterTasks diff --git a/trove/tests/unittests/cmd/test_status.py b/trove/tests/unittests/cmd/test_status.py index 7a94d74ebc..86ab40bc14 100644 --- a/trove/tests/unittests/cmd/test_status.py +++ b/trove/tests/unittests/cmd/test_status.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from oslo_upgradecheck.upgradecheck import Code from trove.cmd import status diff --git a/trove/tests/unittests/common/test_context.py b/trove/tests/unittests/common/test_context.py index e566c8b274..d3f237dd95 100644 --- a/trove/tests/unittests/common/test_context.py +++ b/trove/tests/unittests/common/test_context.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. # -from mock import Mock +from unittest.mock import Mock from testtools.matchers import Equals, Is from trove.common import context diff --git a/trove/tests/unittests/common/test_notification.py b/trove/tests/unittests/common/test_notification.py index 0243740801..3f27c71ec0 100644 --- a/trove/tests/unittests/common/test_notification.py +++ b/trove/tests/unittests/common/test_notification.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. # -from mock import Mock, patch +from unittest.mock import Mock, patch from oslo_utils import timeutils diff --git a/trove/tests/unittests/common/test_pagination.py b/trove/tests/unittests/common/test_pagination.py index d27726f5ad..24dab84c39 100644 --- a/trove/tests/unittests/common/test_pagination.py +++ b/trove/tests/unittests/common/test_pagination.py @@ -16,7 +16,7 @@ # under the License. # -from mock import Mock +from unittest.mock import Mock from trove.common import pagination from trove.tests.unittests import trove_testtools diff --git a/trove/tests/unittests/common/test_policy.py b/trove/tests/unittests/common/test_policy.py index 016e9e0eb5..beb27f8652 100644 --- a/trove/tests/unittests/common/test_policy.py +++ b/trove/tests/unittests/common/test_policy.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import MagicMock -from mock import NonCallableMock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import NonCallableMock +from unittest.mock import patch from trove.common import exception as trove_exceptions from trove.common import policy as trove_policy diff --git a/trove/tests/unittests/common/test_server_group.py b/trove/tests/unittests/common/test_server_group.py index a05826fbe3..bb179dd4ff 100644 --- a/trove/tests/unittests/common/test_server_group.py +++ b/trove/tests/unittests/common/test_server_group.py @@ -15,7 +15,7 @@ # import copy -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.common import server_group as srv_grp from trove.tests.unittests import trove_testtools diff --git a/trove/tests/unittests/common/test_template.py b/trove/tests/unittests/common/test_template.py index 18f227bf9f..31c49d6fff 100644 --- a/trove/tests/unittests/common/test_template.py +++ b/trove/tests/unittests/common/test_template.py @@ -11,7 +11,7 @@ # limitations under the License. import re -from mock import Mock +from unittest.mock import Mock from trove.common import template from trove.datastore.models import DatastoreVersion diff --git a/trove/tests/unittests/common/test_utils.py b/trove/tests/unittests/common/test_utils.py index e334dec599..c81cd67927 100644 --- a/trove/tests/unittests/common/test_utils.py +++ b/trove/tests/unittests/common/test_utils.py @@ -14,8 +14,8 @@ # under the License. # -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from testtools import ExpectedException from trove.common import exception diff --git a/trove/tests/unittests/common/test_wsgi.py b/trove/tests/unittests/common/test_wsgi.py index 9a07e009bb..324078da73 100644 --- a/trove/tests/unittests/common/test_wsgi.py +++ b/trove/tests/unittests/common/test_wsgi.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. # -from mock import Mock, patch +from unittest.mock import Mock, patch from testtools.matchers import Equals, Is, Not import webob.exc diff --git a/trove/tests/unittests/conductor/test_conf.py b/trove/tests/unittests/conductor/test_conf.py index a26587e511..cdeb39da90 100644 --- a/trove/tests/unittests/conductor/test_conf.py +++ b/trove/tests/unittests/conductor/test_conf.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import MagicMock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import patch from oslo_service import service as os_service from trove.cmd import common as common_cmd diff --git a/trove/tests/unittests/conductor/test_methods.py b/trove/tests/unittests/conductor/test_methods.py index 64ba117ec0..887af4390e 100644 --- a/trove/tests/unittests/conductor/test_methods.py +++ b/trove/tests/unittests/conductor/test_methods.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import patch +from unittest.mock import patch from oslo_utils import timeutils from trove.backup import models as bkup_models diff --git a/trove/tests/unittests/configuration/test_configuration_controller.py b/trove/tests/unittests/configuration/test_configuration_controller.py index 9d1de61eae..4c23967292 100644 --- a/trove/tests/unittests/configuration/test_configuration_controller.py +++ b/trove/tests/unittests/configuration/test_configuration_controller.py @@ -14,7 +14,7 @@ # under the License. # import jsonschema -from mock import MagicMock +from unittest.mock import MagicMock from trove.common import configurations from trove.common.exception import UnprocessableEntity diff --git a/trove/tests/unittests/datastore/test_datastore.py b/trove/tests/unittests/datastore/test_datastore.py index 2555fdabb2..4812c442d1 100644 --- a/trove/tests/unittests/datastore/test_datastore.py +++ b/trove/tests/unittests/datastore/test_datastore.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from trove.common import exception from trove.datastore import models as datastore_models diff --git a/trove/tests/unittests/db/test_migration_utils.py b/trove/tests/unittests/db/test_migration_utils.py index ccc91a587c..3c694c8bcf 100644 --- a/trove/tests/unittests/db/test_migration_utils.py +++ b/trove/tests/unittests/db/test_migration_utils.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. # -from mock import call -from mock import Mock -from mock import patch +from unittest.mock import call +from unittest.mock import Mock +from unittest.mock import patch from sqlalchemy.engine import reflection from sqlalchemy.schema import Column diff --git a/trove/tests/unittests/domain-name-service/test_designate_driver.py b/trove/tests/unittests/domain-name-service/test_designate_driver.py index fd77b4680c..7a464e0b09 100644 --- a/trove/tests/unittests/domain-name-service/test_designate_driver.py +++ b/trove/tests/unittests/domain-name-service/test_designate_driver.py @@ -14,8 +14,8 @@ import base64 import hashlib -from mock import MagicMock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import patch import six from trove.common import exception diff --git a/trove/tests/unittests/extensions/common/test_service.py b/trove/tests/unittests/extensions/common/test_service.py index c934133744..ecb61f2157 100644 --- a/trove/tests/unittests/extensions/common/test_service.py +++ b/trove/tests/unittests/extensions/common/test_service.py @@ -14,8 +14,8 @@ # under the License. # -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from oslo_config.cfg import NoSuchOptError from trove.common import exception diff --git a/trove/tests/unittests/extensions/redis/test_service.py b/trove/tests/unittests/extensions/redis/test_service.py index ad98b30f8c..0b8b60aa12 100644 --- a/trove/tests/unittests/extensions/redis/test_service.py +++ b/trove/tests/unittests/extensions/redis/test_service.py @@ -15,7 +15,7 @@ # import uuid -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.common import exception from trove.datastore import models as datastore_models diff --git a/trove/tests/unittests/flavor/test_flavor_views.py b/trove/tests/unittests/flavor/test_flavor_views.py index 21b8635106..87c6898138 100644 --- a/trove/tests/unittests/flavor/test_flavor_views.py +++ b/trove/tests/unittests/flavor/test_flavor_views.py @@ -14,7 +14,7 @@ # under the License. # -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.flavor.views import FlavorView from trove.tests.unittests import trove_testtools diff --git a/trove/tests/unittests/instance/test_instance_controller.py b/trove/tests/unittests/instance/test_instance_controller.py index fe00830691..f222ddac82 100644 --- a/trove/tests/unittests/instance/test_instance_controller.py +++ b/trove/tests/unittests/instance/test_instance_controller.py @@ -14,10 +14,10 @@ # under the License. # import copy +from unittest.mock import Mock import uuid import jsonschema -from mock import Mock from testtools.matchers import Equals from testtools.matchers import Is from testtools.testcase import skip diff --git a/trove/tests/unittests/instance/test_instance_models.py b/trove/tests/unittests/instance/test_instance_models.py index eab5901bfb..f63314b507 100644 --- a/trove/tests/unittests/instance/test_instance_models.py +++ b/trove/tests/unittests/instance/test_instance_models.py @@ -11,8 +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. -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch import uuid from trove.backup import models as backup_models diff --git a/trove/tests/unittests/instance/test_instance_views.py b/trove/tests/unittests/instance/test_instance_views.py index 2b3f21461b..43b6a2c291 100644 --- a/trove/tests/unittests/instance/test_instance_views.py +++ b/trove/tests/unittests/instance/test_instance_views.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. # -from mock import Mock +from unittest.mock import Mock from trove.common import cfg from trove.instance.views import InstanceDetailView from trove.instance.views import InstanceView diff --git a/trove/tests/unittests/mgmt/test_clusters.py b/trove/tests/unittests/mgmt/test_clusters.py index 019787456d..fba3dc7b64 100644 --- a/trove/tests/unittests/mgmt/test_clusters.py +++ b/trove/tests/unittests/mgmt/test_clusters.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.common import exception from trove.extensions.mgmt.clusters.models import MgmtCluster diff --git a/trove/tests/unittests/mgmt/test_datastore_controller.py b/trove/tests/unittests/mgmt/test_datastore_controller.py index a465692bc0..7e5b01c4cb 100644 --- a/trove/tests/unittests/mgmt/test_datastore_controller.py +++ b/trove/tests/unittests/mgmt/test_datastore_controller.py @@ -14,7 +14,7 @@ import jsonschema -from mock import Mock, patch, MagicMock, PropertyMock +from unittest.mock import Mock, patch, MagicMock, PropertyMock from testtools.matchers import Is, Equals from trove.common import clients diff --git a/trove/tests/unittests/mgmt/test_datastores.py b/trove/tests/unittests/mgmt/test_datastores.py index 2d1405a6ad..c3b5ad720a 100644 --- a/trove/tests/unittests/mgmt/test_datastores.py +++ b/trove/tests/unittests/mgmt/test_datastores.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from mock import Mock, patch +from unittest.mock import Mock, patch from glanceclient import exc as glance_exceptions from trove.common import clients diff --git a/trove/tests/unittests/mgmt/test_models.py b/trove/tests/unittests/mgmt/test_models.py index e51e7d704b..6c0883c29d 100644 --- a/trove/tests/unittests/mgmt/test_models.py +++ b/trove/tests/unittests/mgmt/test_models.py @@ -18,9 +18,9 @@ from testtools.matchers import Is from testtools.matchers import Not import uuid -from mock import ANY -from mock import MagicMock -from mock import patch +from unittest.mock import ANY +from unittest.mock import MagicMock +from unittest.mock import patch from novaclient.client import Client from novaclient.v2.flavors import Flavor from novaclient.v2.flavors import FlavorManager diff --git a/trove/tests/unittests/module/test_module_models.py b/trove/tests/unittests/module/test_module_models.py index 330694e0b7..1aeb2e5ce4 100644 --- a/trove/tests/unittests/module/test_module_models.py +++ b/trove/tests/unittests/module/test_module_models.py @@ -15,7 +15,7 @@ # import copy -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.common import crypto_utils from trove.common import exception diff --git a/trove/tests/unittests/module/test_module_views.py b/trove/tests/unittests/module/test_module_views.py index b976b9cd63..5691d1a509 100644 --- a/trove/tests/unittests/module/test_module_views.py +++ b/trove/tests/unittests/module/test_module_views.py @@ -14,7 +14,7 @@ # under the License. # -from mock import Mock, patch +from unittest.mock import Mock, patch from trove.datastore import models from trove.module.views import DetailedModuleView from trove.tests.unittests import trove_testtools diff --git a/trove/tests/unittests/quota/test_quota.py b/trove/tests/unittests/quota/test_quota.py index 9d33e31d19..7533a59cbb 100644 --- a/trove/tests/unittests/quota/test_quota.py +++ b/trove/tests/unittests/quota/test_quota.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import Mock, MagicMock, patch +from unittest.mock import Mock, MagicMock, patch from testtools import skipIf from trove.common import cfg diff --git a/trove/tests/unittests/taskmanager/test_api.py b/trove/tests/unittests/taskmanager/test_api.py index bf265f40c2..d14f64fd13 100644 --- a/trove/tests/unittests/taskmanager/test_api.py +++ b/trove/tests/unittests/taskmanager/test_api.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from unittest import mock from trove.common import context diff --git a/trove/tests/unittests/taskmanager/test_clusters.py b/trove/tests/unittests/taskmanager/test_clusters.py index 9fa9e0cdd9..d57afac19b 100644 --- a/trove/tests/unittests/taskmanager/test_clusters.py +++ b/trove/tests/unittests/taskmanager/test_clusters.py @@ -15,9 +15,9 @@ import datetime -from mock import MagicMock -from mock import Mock -from mock import patch +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch from trove.cluster.models import ClusterTasks as ClusterTaskStatus from trove.cluster.models import DBCluster diff --git a/trove/tests/unittests/taskmanager/test_galera_clusters.py b/trove/tests/unittests/taskmanager/test_galera_clusters.py index 5d32ce9e94..9afec172d7 100644 --- a/trove/tests/unittests/taskmanager/test_galera_clusters.py +++ b/trove/tests/unittests/taskmanager/test_galera_clusters.py @@ -13,8 +13,8 @@ import datetime -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from trove.cluster.models import ClusterTasks as ClusterTaskStatus from trove.cluster.models import DBCluster diff --git a/trove/tests/unittests/taskmanager/test_manager.py b/trove/tests/unittests/taskmanager/test_manager.py index 610f79f35d..1be021358a 100644 --- a/trove/tests/unittests/taskmanager/test_manager.py +++ b/trove/tests/unittests/taskmanager/test_manager.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import MagicMock, Mock, patch, PropertyMock +from unittest.mock import MagicMock, Mock, patch, PropertyMock from proboscis.asserts import assert_equal from trove.backup.models import Backup diff --git a/trove/tests/unittests/taskmanager/test_models.py b/trove/tests/unittests/taskmanager/test_models.py index 00338150f9..0753087487 100644 --- a/trove/tests/unittests/taskmanager/test_models.py +++ b/trove/tests/unittests/taskmanager/test_models.py @@ -18,11 +18,11 @@ from unittest import mock from cinderclient import exceptions as cinder_exceptions from cinderclient.v2 import volumes as cinderclient_volumes import cinderclient.v2.client as cinderclient -from mock import call -from mock import MagicMock -from mock import Mock -from mock import patch -from mock import PropertyMock +from unittest.mock import call +from unittest.mock import MagicMock +from unittest.mock import Mock +from unittest.mock import patch +from unittest.mock import PropertyMock import neutronclient.v2_0.client as neutronclient from novaclient import exceptions as nova_exceptions import novaclient.v2.flavors diff --git a/trove/tests/unittests/taskmanager/test_vertica_clusters.py b/trove/tests/unittests/taskmanager/test_vertica_clusters.py index d066f36e02..19d6db353b 100644 --- a/trove/tests/unittests/taskmanager/test_vertica_clusters.py +++ b/trove/tests/unittests/taskmanager/test_vertica_clusters.py @@ -13,8 +13,8 @@ import datetime -from mock import Mock -from mock import patch +from unittest.mock import Mock +from unittest.mock import patch from trove import rpc from trove.cluster.models import ClusterTasks as ClusterTaskStatus diff --git a/trove/tests/unittests/upgrade/test_controller.py b/trove/tests/unittests/upgrade/test_controller.py index 93d43d2f13..da4f07c463 100644 --- a/trove/tests/unittests/upgrade/test_controller.py +++ b/trove/tests/unittests/upgrade/test_controller.py @@ -14,7 +14,7 @@ # under the License. # import jsonschema -from mock import Mock, MagicMock, patch +from unittest.mock import Mock, MagicMock, patch from trove.extensions.mgmt.upgrade.models import UpgradeMessageSender from trove.extensions.mgmt.upgrade.service import UpgradeController diff --git a/trove/tests/unittests/upgrade/test_models.py b/trove/tests/unittests/upgrade/test_models.py index 9a859de6a5..ff3f2133d5 100644 --- a/trove/tests/unittests/upgrade/test_models.py +++ b/trove/tests/unittests/upgrade/test_models.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. # -from mock import patch +from unittest.mock import patch from trove.extensions.mgmt.upgrade.models import UpgradeMessageSender from trove import rpc from trove.tests.unittests import trove_testtools