From 551f58b978f2a7d095c96bb6e1e5460d21a91c4f Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 18 Apr 2020 12:00:13 -0500 Subject: [PATCH] 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: Ic07c0f6fa0b23242eb884cc34ac9d963b3030b17 Signed-off-by: Sean McGinnis --- sahara/tests/unit/base.py | 3 ++- sahara/tests/unit/cli/image_pack/test_image_pack_api.py | 2 +- sahara/tests/unit/cli/test_sahara_cli.py | 2 +- sahara/tests/unit/conductor/manager/test_clusters.py | 2 +- sahara/tests/unit/conductor/manager/test_edp.py | 2 +- sahara/tests/unit/conductor/manager/test_templates.py | 2 +- sahara/tests/unit/db/migration/test_db_manage_cli.py | 2 +- sahara/tests/unit/db/sqlalchemy/test_types.py | 2 +- sahara/tests/unit/db/templates/test_update.py | 2 +- sahara/tests/unit/db/test_utils.py | 2 +- sahara/tests/unit/plugins/test_images.py | 3 ++- sahara/tests/unit/plugins/test_kerberos.py | 2 +- sahara/tests/unit/plugins/test_labels.py | 2 +- sahara/tests/unit/plugins/test_provide_recommendations.py | 3 ++- sahara/tests/unit/plugins/test_utils.py | 2 +- sahara/tests/unit/service/api/test_v10.py | 3 ++- sahara/tests/unit/service/api/v2/test_clusters.py | 3 ++- sahara/tests/unit/service/api/v2/test_images.py | 2 +- .../tests/unit/service/edp/binary_retrievers/test_dispatch.py | 2 +- .../unit/service/edp/binary_retrievers/test_internal_swift.py | 2 +- sahara/tests/unit/service/edp/binary_retrievers/test_manila.py | 2 +- sahara/tests/unit/service/edp/data_sources/base_test.py | 3 ++- .../tests/unit/service/edp/data_sources/hdfs/test_hdfs_type.py | 2 +- .../unit/service/edp/data_sources/manila/test_manila_type.py | 3 ++- sahara/tests/unit/service/edp/data_sources/s3/test_s3_type.py | 2 +- .../unit/service/edp/data_sources/swift/test_swift_type.py | 2 +- sahara/tests/unit/service/edp/edp_test_utils.py | 3 ++- .../edp/job_binaries/internal_db/test_internal_db_type.py | 3 ++- .../unit/service/edp/job_binaries/manila/test_manila_type.py | 3 ++- sahara/tests/unit/service/edp/job_binaries/s3/test_s3_type.py | 2 +- .../unit/service/edp/job_binaries/swift/test_swift_type.py | 2 +- sahara/tests/unit/service/edp/job_binaries/test_base.py | 2 +- sahara/tests/unit/service/edp/oozie/test_oozie.py | 2 +- sahara/tests/unit/service/edp/spark/base.py | 2 +- sahara/tests/unit/service/edp/storm/test_storm.py | 2 +- sahara/tests/unit/service/edp/test_hdfs_helper.py | 2 +- sahara/tests/unit/service/edp/test_job_manager.py | 2 +- sahara/tests/unit/service/edp/test_job_utils.py | 3 ++- sahara/tests/unit/service/edp/test_s3_common.py | 2 +- sahara/tests/unit/service/edp/utils/test_shares.py | 3 ++- sahara/tests/unit/service/health/test_verification_base.py | 3 ++- sahara/tests/unit/service/heat/test_templates.py | 2 +- sahara/tests/unit/service/test_coordinator.py | 2 +- sahara/tests/unit/service/test_engine.py | 2 +- sahara/tests/unit/service/test_networks.py | 2 +- sahara/tests/unit/service/test_ntp_service.py | 2 +- sahara/tests/unit/service/test_ops.py | 2 +- sahara/tests/unit/service/test_periodic.py | 2 +- sahara/tests/unit/service/test_quotas.py | 3 ++- sahara/tests/unit/service/test_sessions.py | 3 ++- sahara/tests/unit/service/test_trusts.py | 2 +- sahara/tests/unit/service/test_volumes.py | 3 ++- sahara/tests/unit/service/validation/edp/test_data_source.py | 3 ++- sahara/tests/unit/service/validation/edp/test_job.py | 2 +- sahara/tests/unit/service/validation/edp/test_job_binary.py | 2 +- .../unit/service/validation/edp/test_job_binary_internal.py | 2 +- sahara/tests/unit/service/validation/edp/test_job_executor.py | 2 +- sahara/tests/unit/service/validation/edp/test_job_interface.py | 2 +- .../unit/service/validation/test_cluster_create_validation.py | 3 ++- .../unit/service/validation/test_cluster_delete_validation.py | 2 +- .../unit/service/validation/test_cluster_scaling_validation.py | 3 ++- .../validation/test_cluster_template_create_validation.py | 3 ++- .../validation/test_cluster_template_update_validation.py | 2 +- .../unit/service/validation/test_cluster_update_validation.py | 2 +- .../service/validation/test_ng_template_validation_create.py | 2 +- sahara/tests/unit/service/validation/test_share_validations.py | 2 +- sahara/tests/unit/service/validation/test_validation.py | 2 +- sahara/tests/unit/service/validation/utils.py | 2 +- sahara/tests/unit/swift/test_swift_helper.py | 2 +- sahara/tests/unit/swift/test_utils.py | 2 +- sahara/tests/unit/test_context.py | 2 +- sahara/tests/unit/test_main.py | 2 +- sahara/tests/unit/topology/test_topology.py | 2 +- sahara/tests/unit/utils/notification/test_sender.py | 2 +- sahara/tests/unit/utils/openstack/test_base.py | 3 ++- sahara/tests/unit/utils/openstack/test_heat.py | 2 +- sahara/tests/unit/utils/openstack/test_images.py | 2 +- sahara/tests/unit/utils/openstack/test_swift.py | 2 +- sahara/tests/unit/utils/test_api.py | 2 +- sahara/tests/unit/utils/test_cinder.py | 3 ++- sahara/tests/unit/utils/test_cluster.py | 2 +- sahara/tests/unit/utils/test_cluster_progress_ops.py | 3 ++- sahara/tests/unit/utils/test_edp.py | 2 +- sahara/tests/unit/utils/test_general.py | 2 +- sahara/tests/unit/utils/test_heat.py | 2 +- sahara/tests/unit/utils/test_neutron.py | 2 +- sahara/tests/unit/utils/test_poll_utils.py | 3 ++- sahara/tests/unit/utils/test_proxy.py | 3 ++- sahara/tests/unit/utils/test_rpc.py | 2 +- sahara/tests/unit/utils/test_ssh_remote.py | 2 +- test-requirements.txt | 1 - 91 files changed, 115 insertions(+), 91 deletions(-) diff --git a/sahara/tests/unit/base.py b/sahara/tests/unit/base.py index 962f220afe..7954d0d271 100644 --- a/sahara/tests/unit/base.py +++ b/sahara/tests/unit/base.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + from oslotest import base from sahara import context diff --git a/sahara/tests/unit/cli/image_pack/test_image_pack_api.py b/sahara/tests/unit/cli/image_pack/test_image_pack_api.py index 68f6073b81..63f66cc6dc 100644 --- a/sahara/tests/unit/cli/image_pack/test_image_pack_api.py +++ b/sahara/tests/unit/cli/image_pack/test_image_pack_api.py @@ -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 sys guestfs = mock.Mock() diff --git a/sahara/tests/unit/cli/test_sahara_cli.py b/sahara/tests/unit/cli/test_sahara_cli.py index a5c54468b6..4add2ed318 100644 --- a/sahara/tests/unit/cli/test_sahara_cli.py +++ b/sahara/tests/unit/cli/test_sahara_cli.py @@ -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 sahara.cli import sahara_all from sahara.cli import sahara_api diff --git a/sahara/tests/unit/conductor/manager/test_clusters.py b/sahara/tests/unit/conductor/manager/test_clusters.py index 83b737e59c..5e769c8be5 100644 --- a/sahara/tests/unit/conductor/manager/test_clusters.py +++ b/sahara/tests/unit/conductor/manager/test_clusters.py @@ -14,8 +14,8 @@ # limitations under the License. import copy +from unittest import mock -import mock from sqlalchemy import exc as sa_exc import testtools diff --git a/sahara/tests/unit/conductor/manager/test_edp.py b/sahara/tests/unit/conductor/manager/test_edp.py index aefe4ac585..4b349bd626 100644 --- a/sahara/tests/unit/conductor/manager/test_edp.py +++ b/sahara/tests/unit/conductor/manager/test_edp.py @@ -15,8 +15,8 @@ import copy import datetime +from unittest import mock -import mock from sqlalchemy import exc as sa_exc import testtools diff --git a/sahara/tests/unit/conductor/manager/test_templates.py b/sahara/tests/unit/conductor/manager/test_templates.py index c776bd3f25..8097bd43e5 100644 --- a/sahara/tests/unit/conductor/manager/test_templates.py +++ b/sahara/tests/unit/conductor/manager/test_templates.py @@ -14,8 +14,8 @@ # limitations under the License. import copy +from unittest import mock -import mock from oslo_utils import uuidutils import six from sqlalchemy import exc as sa_ex diff --git a/sahara/tests/unit/db/migration/test_db_manage_cli.py b/sahara/tests/unit/db/migration/test_db_manage_cli.py index 01008d4fd1..45d6325999 100644 --- a/sahara/tests/unit/db/migration/test_db_manage_cli.py +++ b/sahara/tests/unit/db/migration/test_db_manage_cli.py @@ -14,8 +14,8 @@ # under the License. import sys +from unittest import mock -import mock import testscenarios import testtools diff --git a/sahara/tests/unit/db/sqlalchemy/test_types.py b/sahara/tests/unit/db/sqlalchemy/test_types.py index 429ffaa635..44f2dd47bd 100644 --- a/sahara/tests/unit/db/sqlalchemy/test_types.py +++ b/sahara/tests/unit/db/sqlalchemy/test_types.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import sqlalchemy as sa import testtools +from unittest import mock from sahara.db.sqlalchemy import types diff --git a/sahara/tests/unit/db/templates/test_update.py b/sahara/tests/unit/db/templates/test_update.py index 531c735f1a..92ca974b62 100644 --- a/sahara/tests/unit/db/templates/test_update.py +++ b/sahara/tests/unit/db/templates/test_update.py @@ -14,9 +14,9 @@ import copy import tempfile +from unittest import mock import jsonschema -import mock from oslo_serialization import jsonutils as json from oslo_utils import uuidutils diff --git a/sahara/tests/unit/db/test_utils.py b/sahara/tests/unit/db/test_utils.py index 6943006a24..c8bf1379a5 100644 --- a/sahara/tests/unit/db/test_utils.py +++ b/sahara/tests/unit/db/test_utils.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara import context from sahara.db.sqlalchemy import api diff --git a/sahara/tests/unit/plugins/test_images.py b/sahara/tests/unit/plugins/test_images.py index 3aeadfad8a..7f5ba895b0 100644 --- a/sahara/tests/unit/plugins/test_images.py +++ b/sahara/tests/unit/plugins/test_images.py @@ -13,7 +13,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 uuidutils import yaml diff --git a/sahara/tests/unit/plugins/test_kerberos.py b/sahara/tests/unit/plugins/test_kerberos.py index 4441e2f2d8..062c2522e9 100644 --- a/sahara/tests/unit/plugins/test_kerberos.py +++ b/sahara/tests/unit/plugins/test_kerberos.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from sahara import context from sahara.plugins import kerberos as krb diff --git a/sahara/tests/unit/plugins/test_labels.py b/sahara/tests/unit/plugins/test_labels.py index e63dbcfe9a..d11379fed4 100644 --- a/sahara/tests/unit/plugins/test_labels.py +++ b/sahara/tests/unit/plugins/test_labels.py @@ -12,8 +12,8 @@ # limitations under the License. import jsonschema.exceptions as json_exc -import mock import testtools +from unittest import mock from sahara import conductor as cond from sahara import context diff --git a/sahara/tests/unit/plugins/test_provide_recommendations.py b/sahara/tests/unit/plugins/test_provide_recommendations.py index c7979f8d5d..eaca5e2ee7 100644 --- a/sahara/tests/unit/plugins/test_provide_recommendations.py +++ b/sahara/tests/unit/plugins/test_provide_recommendations.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import six from sahara import conductor as cond diff --git a/sahara/tests/unit/plugins/test_utils.py b/sahara/tests/unit/plugins/test_utils.py index 474a5bcb3c..d0badd74ee 100644 --- a/sahara/tests/unit/plugins/test_utils.py +++ b/sahara/tests/unit/plugins/test_utils.py @@ -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 sahara.plugins import exceptions as ex from sahara.plugins import utils as pu diff --git a/sahara/tests/unit/service/api/test_v10.py b/sahara/tests/unit/service/api/test_v10.py index aecf570ceb..9a36907168 100644 --- a/sahara/tests/unit/service/api/test_v10.py +++ b/sahara/tests/unit/service/api/test_v10.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import oslo_messaging import six import testtools diff --git a/sahara/tests/unit/service/api/v2/test_clusters.py b/sahara/tests/unit/service/api/v2/test_clusters.py index b9c3a62d44..bb11575ed3 100644 --- a/sahara/tests/unit/service/api/v2/test_clusters.py +++ b/sahara/tests/unit/service/api/v2/test_clusters.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import oslo_messaging import six import testtools diff --git a/sahara/tests/unit/service/api/v2/test_images.py b/sahara/tests/unit/service/api/v2/test_images.py index b27cde2f06..02aac2a81a 100644 --- a/sahara/tests/unit/service/api/v2/test_images.py +++ b/sahara/tests/unit/service/api/v2/test_images.py @@ -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 sahara.service.api.v2 import images from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/edp/binary_retrievers/test_dispatch.py b/sahara/tests/unit/service/edp/binary_retrievers/test_dispatch.py index 3537276a2c..baf96b950d 100644 --- a/sahara/tests/unit/service/edp/binary_retrievers/test_dispatch.py +++ b/sahara/tests/unit/service/edp/binary_retrievers/test_dispatch.py @@ -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 sahara.service.edp.binary_retrievers import dispatch from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/edp/binary_retrievers/test_internal_swift.py b/sahara/tests/unit/service/edp/binary_retrievers/test_internal_swift.py index 9f0b56f107..9d74aba454 100644 --- a/sahara/tests/unit/service/edp/binary_retrievers/test_internal_swift.py +++ b/sahara/tests/unit/service/edp/binary_retrievers/test_internal_swift.py @@ -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 sahara.exceptions as ex from sahara.service.castellan import config as castellan diff --git a/sahara/tests/unit/service/edp/binary_retrievers/test_manila.py b/sahara/tests/unit/service/edp/binary_retrievers/test_manila.py index 075035b6d2..1f35f2cd6c 100644 --- a/sahara/tests/unit/service/edp/binary_retrievers/test_manila.py +++ b/sahara/tests/unit/service/edp/binary_retrievers/test_manila.py @@ -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 sahara.service.edp.binary_retrievers.manila_share as ms from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/edp/data_sources/base_test.py b/sahara/tests/unit/service/edp/data_sources/base_test.py index e75f3baa8e..6198a6fb9e 100644 --- a/sahara/tests/unit/service/edp/data_sources/base_test.py +++ b/sahara/tests/unit/service/edp/data_sources/base_test.py @@ -13,7 +13,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 uuidutils from sahara.service.edp.data_sources.base import DataSourceType diff --git a/sahara/tests/unit/service/edp/data_sources/hdfs/test_hdfs_type.py b/sahara/tests/unit/service/edp/data_sources/hdfs/test_hdfs_type.py index 0507b6a885..066752337e 100644 --- a/sahara/tests/unit/service/edp/data_sources/hdfs/test_hdfs_type.py +++ b/sahara/tests/unit/service/edp/data_sources/hdfs/test_hdfs_type.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock import sahara.exceptions as ex from sahara.service.edp.data_sources.hdfs.implementation import HDFSType diff --git a/sahara/tests/unit/service/edp/data_sources/manila/test_manila_type.py b/sahara/tests/unit/service/edp/data_sources/manila/test_manila_type.py index dfea0ce650..8c662bff98 100644 --- a/sahara/tests/unit/service/edp/data_sources/manila/test_manila_type.py +++ b/sahara/tests/unit/service/edp/data_sources/manila/test_manila_type.py @@ -13,7 +13,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 uuidutils import testtools diff --git a/sahara/tests/unit/service/edp/data_sources/s3/test_s3_type.py b/sahara/tests/unit/service/edp/data_sources/s3/test_s3_type.py index e396049023..d4bd6ecc2a 100644 --- a/sahara/tests/unit/service/edp/data_sources/s3/test_s3_type.py +++ b/sahara/tests/unit/service/edp/data_sources/s3/test_s3_type.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock import sahara.exceptions as ex from sahara.service.edp.data_sources.s3.implementation import S3Type diff --git a/sahara/tests/unit/service/edp/data_sources/swift/test_swift_type.py b/sahara/tests/unit/service/edp/data_sources/swift/test_swift_type.py index c09b1a4747..a7e5af2aa3 100644 --- a/sahara/tests/unit/service/edp/data_sources/swift/test_swift_type.py +++ b/sahara/tests/unit/service/edp/data_sources/swift/test_swift_type.py @@ -14,8 +14,8 @@ # limitations under the License. import copy +from unittest import mock -import mock from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/edp/edp_test_utils.py b/sahara/tests/unit/service/edp/edp_test_utils.py index 1b8bdb01e2..e1ff290a42 100644 --- a/sahara/tests/unit/service/edp/edp_test_utils.py +++ b/sahara/tests/unit/service/edp/edp_test_utils.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils from sahara import conductor as cond diff --git a/sahara/tests/unit/service/edp/job_binaries/internal_db/test_internal_db_type.py b/sahara/tests/unit/service/edp/job_binaries/internal_db/test_internal_db_type.py index d0eeaf434a..2bcec76006 100644 --- a/sahara/tests/unit/service/edp/job_binaries/internal_db/test_internal_db_type.py +++ b/sahara/tests/unit/service/edp/job_binaries/internal_db/test_internal_db_type.py @@ -13,7 +13,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 uuidutils import testtools diff --git a/sahara/tests/unit/service/edp/job_binaries/manila/test_manila_type.py b/sahara/tests/unit/service/edp/job_binaries/manila/test_manila_type.py index ccf22e7e19..049ebe3547 100644 --- a/sahara/tests/unit/service/edp/job_binaries/manila/test_manila_type.py +++ b/sahara/tests/unit/service/edp/job_binaries/manila/test_manila_type.py @@ -13,7 +13,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 uuidutils import testtools diff --git a/sahara/tests/unit/service/edp/job_binaries/s3/test_s3_type.py b/sahara/tests/unit/service/edp/job_binaries/s3/test_s3_type.py index 07cc4d530e..495cb6da8d 100644 --- a/sahara/tests/unit/service/edp/job_binaries/s3/test_s3_type.py +++ b/sahara/tests/unit/service/edp/job_binaries/s3/test_s3_type.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara import exceptions as ex from sahara.service.edp.job_binaries.s3.implementation import S3Type diff --git a/sahara/tests/unit/service/edp/job_binaries/swift/test_swift_type.py b/sahara/tests/unit/service/edp/job_binaries/swift/test_swift_type.py index 8b5470b860..d905c789f7 100644 --- a/sahara/tests/unit/service/edp/job_binaries/swift/test_swift_type.py +++ b/sahara/tests/unit/service/edp/job_binaries/swift/test_swift_type.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock import sahara.exceptions as ex from sahara.service.castellan import config as castellan diff --git a/sahara/tests/unit/service/edp/job_binaries/test_base.py b/sahara/tests/unit/service/edp/job_binaries/test_base.py index 87bf7e917f..c1a8a85100 100644 --- a/sahara/tests/unit/service/edp/job_binaries/test_base.py +++ b/sahara/tests/unit/service/edp/job_binaries/test_base.py @@ -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 sahara.service.edp.job_binaries import base as jb_base from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/edp/oozie/test_oozie.py b/sahara/tests/unit/service/edp/oozie/test_oozie.py index 3df67ad8c8..6d17818d92 100644 --- a/sahara/tests/unit/service/edp/oozie/test_oozie.py +++ b/sahara/tests/unit/service/edp/oozie/test_oozie.py @@ -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 sahara import context as ctx from sahara.plugins import base as pb diff --git a/sahara/tests/unit/service/edp/spark/base.py b/sahara/tests/unit/service/edp/spark/base.py index 3ab9f2ffea..dd85bf55b3 100644 --- a/sahara/tests/unit/service/edp/spark/base.py +++ b/sahara/tests/unit/service/edp/spark/base.py @@ -15,8 +15,8 @@ # limitations under the License. import os +from unittest import mock -import mock import sahara.exceptions as ex from sahara.service.edp.job_utils import ds_manager diff --git a/sahara/tests/unit/service/edp/storm/test_storm.py b/sahara/tests/unit/service/edp/storm/test_storm.py index ea48ada044..b9d2b057b5 100644 --- a/sahara/tests/unit/service/edp/storm/test_storm.py +++ b/sahara/tests/unit/service/edp/storm/test_storm.py @@ -14,8 +14,8 @@ # limitations under the License. import os +from unittest import mock -import mock import sahara.exceptions as ex from sahara.service.edp.job_utils import ds_manager diff --git a/sahara/tests/unit/service/edp/test_hdfs_helper.py b/sahara/tests/unit/service/edp/test_hdfs_helper.py index 6240f4b462..7a1a3ff5c2 100644 --- a/sahara/tests/unit/service/edp/test_hdfs_helper.py +++ b/sahara/tests/unit/service/edp/test_hdfs_helper.py @@ -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 sahara.plugins import exceptions as ex from sahara.service.edp import hdfs_helper as helper diff --git a/sahara/tests/unit/service/edp/test_job_manager.py b/sahara/tests/unit/service/edp/test_job_manager.py index 00951b8503..7f35d3cb0e 100644 --- a/sahara/tests/unit/service/edp/test_job_manager.py +++ b/sahara/tests/unit/service/edp/test_job_manager.py @@ -14,9 +14,9 @@ # limitations under the License. import copy +from unittest import mock import xml.dom.minidom as xml -import mock import testtools from sahara import conductor as cond diff --git a/sahara/tests/unit/service/edp/test_job_utils.py b/sahara/tests/unit/service/edp/test_job_utils.py index 86bddd91e0..497b611734 100644 --- a/sahara/tests/unit/service/edp/test_job_utils.py +++ b/sahara/tests/unit/service/edp/test_job_utils.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/edp/test_s3_common.py b/sahara/tests/unit/service/edp/test_s3_common.py index 002941f3ea..85ba203f08 100644 --- a/sahara/tests/unit/service/edp/test_s3_common.py +++ b/sahara/tests/unit/service/edp/test_s3_common.py @@ -14,8 +14,8 @@ # limitations under the License. -import mock import testtools +from unittest import mock from sahara import exceptions as ex from sahara.service.edp import s3_common diff --git a/sahara/tests/unit/service/edp/utils/test_shares.py b/sahara/tests/unit/service/edp/utils/test_shares.py index 017248c02f..51327e8def 100644 --- a/sahara/tests/unit/service/edp/utils/test_shares.py +++ b/sahara/tests/unit/service/edp/utils/test_shares.py @@ -18,7 +18,8 @@ try: from manilaclient.common.apiclient import exceptions as manila_ex except ImportError: from manilaclient.openstack.common.apiclient import exceptions as manila_ex -import mock +from unittest import mock + from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/health/test_verification_base.py b/sahara/tests/unit/service/health/test_verification_base.py index fac0fbd81b..f51dd20e84 100644 --- a/sahara/tests/unit/service/health/test_verification_base.py +++ b/sahara/tests/unit/service/health/test_verification_base.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import six import testtools diff --git a/sahara/tests/unit/service/heat/test_templates.py b/sahara/tests/unit/service/heat/test_templates.py index 3166702f2f..c7ccc442a4 100644 --- a/sahara/tests/unit/service/heat/test_templates.py +++ b/sahara/tests/unit/service/heat/test_templates.py @@ -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 sahara.conductor import resource as r from sahara.service.heat import templates as h diff --git a/sahara/tests/unit/service/test_coordinator.py b/sahara/tests/unit/service/test_coordinator.py index 2f7dd969bc..5b62f45354 100644 --- a/sahara/tests/unit/service/test_coordinator.py +++ b/sahara/tests/unit/service/test_coordinator.py @@ -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 sahara.service import coordinator from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/test_engine.py b/sahara/tests/unit/service/test_engine.py index 72cb4ee788..2029281e56 100644 --- a/sahara/tests/unit/service/test_engine.py +++ b/sahara/tests/unit/service/test_engine.py @@ -15,7 +15,7 @@ from heatclient import exc as heat_exc -import mock +from unittest import mock from sahara.service import engine from sahara.service.heat import heat_engine diff --git a/sahara/tests/unit/service/test_networks.py b/sahara/tests/unit/service/test_networks.py index 9b6a99dda7..99815e845b 100644 --- a/sahara/tests/unit/service/test_networks.py +++ b/sahara/tests/unit/service/test_networks.py @@ -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 sahara.service import networks from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/test_ntp_service.py b/sahara/tests/unit/service/test_ntp_service.py index 838add7fb6..5b404d9613 100644 --- a/sahara/tests/unit/service/test_ntp_service.py +++ b/sahara/tests/unit/service/test_ntp_service.py @@ -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 sahara.service import ntp_service as ntp from sahara.tests.unit import base as test_base diff --git a/sahara/tests/unit/service/test_ops.py b/sahara/tests/unit/service/test_ops.py index f8d47bc588..8b1e130938 100644 --- a/sahara/tests/unit/service/test_ops.py +++ b/sahara/tests/unit/service/test_ops.py @@ -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 sahara.plugins import base as base_plugins from sahara.service import ops diff --git a/sahara/tests/unit/service/test_periodic.py b/sahara/tests/unit/service/test_periodic.py index a645ad1c99..9bf1f8af1b 100644 --- a/sahara/tests/unit/service/test_periodic.py +++ b/sahara/tests/unit/service/test_periodic.py @@ -14,8 +14,8 @@ # limitations under the License. import datetime +from unittest import mock -import mock from oslo_utils import timeutils from sahara.conductor import manager diff --git a/sahara/tests/unit/service/test_quotas.py b/sahara/tests/unit/service/test_quotas.py index f30f0aae80..d854419612 100644 --- a/sahara/tests/unit/service/test_quotas.py +++ b/sahara/tests/unit/service/test_quotas.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/test_sessions.py b/sahara/tests/unit/service/test_sessions.py index dfe142a47b..903e5f06c7 100644 --- a/sahara/tests/unit/service/test_sessions.py +++ b/sahara/tests/unit/service/test_sessions.py @@ -13,8 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from unittest import mock + from keystoneauth1 import session as keystone -import mock from sahara import exceptions as ex from sahara.service import sessions diff --git a/sahara/tests/unit/service/test_trusts.py b/sahara/tests/unit/service/test_trusts.py index 6095cfb996..94d62e9825 100644 --- a/sahara/tests/unit/service/test_trusts.py +++ b/sahara/tests/unit/service/test_trusts.py @@ -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 sahara.service import trusts from sahara.tests.unit import base diff --git a/sahara/tests/unit/service/test_volumes.py b/sahara/tests/unit/service/test_volumes.py index 9871b2877e..433dd671ac 100644 --- a/sahara/tests/unit/service/test_volumes.py +++ b/sahara/tests/unit/service/test_volumes.py @@ -13,9 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from unittest import mock + from cinderclient.v2 import volumes as vol_v2 from cinderclient.v3 import volumes as vol_v3 -import mock from sahara import exceptions as ex from sahara.service import volumes diff --git a/sahara/tests/unit/service/validation/edp/test_data_source.py b/sahara/tests/unit/service/validation/edp/test_data_source.py index 19583136bc..81084fd391 100644 --- a/sahara/tests/unit/service/validation/edp/test_data_source.py +++ b/sahara/tests/unit/service/validation/edp/test_data_source.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/validation/edp/test_job.py b/sahara/tests/unit/service/validation/edp/test_job.py index a2e2724010..8bf7a0472d 100644 --- a/sahara/tests/unit/service/validation/edp/test_job.py +++ b/sahara/tests/unit/service/validation/edp/test_job.py @@ -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 sahara import exceptions as ex from sahara.service.validations.edp import job as j diff --git a/sahara/tests/unit/service/validation/edp/test_job_binary.py b/sahara/tests/unit/service/validation/edp/test_job_binary.py index c1dd4e3d6c..1edd98a936 100644 --- a/sahara/tests/unit/service/validation/edp/test_job_binary.py +++ b/sahara/tests/unit/service/validation/edp/test_job_binary.py @@ -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 sahara.service.api import v10 as api from sahara.service.validations.edp import job_binary as b diff --git a/sahara/tests/unit/service/validation/edp/test_job_binary_internal.py b/sahara/tests/unit/service/validation/edp/test_job_binary_internal.py index d755a95862..3d310153e7 100644 --- a/sahara/tests/unit/service/validation/edp/test_job_binary_internal.py +++ b/sahara/tests/unit/service/validation/edp/test_job_binary_internal.py @@ -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 sahara.service.api import v10 as api from sahara.service.validations.edp import job_binary_internal as jb diff --git a/sahara/tests/unit/service/validation/edp/test_job_executor.py b/sahara/tests/unit/service/validation/edp/test_job_executor.py index e49a486600..49fad5140a 100644 --- a/sahara/tests/unit/service/validation/edp/test_job_executor.py +++ b/sahara/tests/unit/service/validation/edp/test_job_executor.py @@ -14,8 +14,8 @@ # limitations under the License. import time +from unittest import mock -import mock from oslo_utils import timeutils from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/validation/edp/test_job_interface.py b/sahara/tests/unit/service/validation/edp/test_job_interface.py index 6659c460f7..cfec69f4cc 100644 --- a/sahara/tests/unit/service/validation/edp/test_job_interface.py +++ b/sahara/tests/unit/service/validation/edp/test_job_interface.py @@ -15,8 +15,8 @@ import collections import itertools +from unittest import mock -import mock from sahara.service.validations.edp import job as j from sahara.service.validations.edp import job_execution_schema as j_e_schema diff --git a/sahara/tests/unit/service/validation/test_cluster_create_validation.py b/sahara/tests/unit/service/validation/test_cluster_create_validation.py index 23f66f4cb4..af4d8e596b 100644 --- a/sahara/tests/unit/service/validation/test_cluster_create_validation.py +++ b/sahara/tests/unit/service/validation/test_cluster_create_validation.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import six import testtools diff --git a/sahara/tests/unit/service/validation/test_cluster_delete_validation.py b/sahara/tests/unit/service/validation/test_cluster_delete_validation.py index d79ee5b7d6..d2299049c5 100644 --- a/sahara/tests/unit/service/validation/test_cluster_delete_validation.py +++ b/sahara/tests/unit/service/validation/test_cluster_delete_validation.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara import exceptions as ex from sahara.service import validation as v diff --git a/sahara/tests/unit/service/validation/test_cluster_scaling_validation.py b/sahara/tests/unit/service/validation/test_cluster_scaling_validation.py index 65dd4dfecc..98f2b04e4b 100644 --- a/sahara/tests/unit/service/validation/test_cluster_scaling_validation.py +++ b/sahara/tests/unit/service/validation/test_cluster_scaling_validation.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import six import testtools diff --git a/sahara/tests/unit/service/validation/test_cluster_template_create_validation.py b/sahara/tests/unit/service/validation/test_cluster_template_create_validation.py index b2dee6e351..612742699a 100644 --- a/sahara/tests/unit/service/validation/test_cluster_template_create_validation.py +++ b/sahara/tests/unit/service/validation/test_cluster_template_create_validation.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils from sahara.service.api import v10 as api diff --git a/sahara/tests/unit/service/validation/test_cluster_template_update_validation.py b/sahara/tests/unit/service/validation/test_cluster_template_update_validation.py index 98d2e042fc..93757b29ac 100644 --- a/sahara/tests/unit/service/validation/test_cluster_template_update_validation.py +++ b/sahara/tests/unit/service/validation/test_cluster_template_update_validation.py @@ -14,8 +14,8 @@ # limitations under the License. import copy +from unittest import mock -import mock from sahara.service.api import v10 as api from sahara.service.validations import cluster_template_schema as ct_schema diff --git a/sahara/tests/unit/service/validation/test_cluster_update_validation.py b/sahara/tests/unit/service/validation/test_cluster_update_validation.py index b28104d203..7e0020e44d 100644 --- a/sahara/tests/unit/service/validation/test_cluster_update_validation.py +++ b/sahara/tests/unit/service/validation/test_cluster_update_validation.py @@ -14,8 +14,8 @@ # limitations under the License. -import mock import testtools +from unittest import mock from sahara import exceptions as ex from sahara.service.api import v10 as api diff --git a/sahara/tests/unit/service/validation/test_ng_template_validation_create.py b/sahara/tests/unit/service/validation/test_ng_template_validation_create.py index 8c9f79adc1..1c9de91216 100644 --- a/sahara/tests/unit/service/validation/test_ng_template_validation_create.py +++ b/sahara/tests/unit/service/validation/test_ng_template_validation_create.py @@ -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 sahara.service.api import v10 as api from sahara.service.validations import node_group_template_schema as ngt_schema diff --git a/sahara/tests/unit/service/validation/test_share_validations.py b/sahara/tests/unit/service/validation/test_share_validations.py index 88a07dae8a..f13a021d56 100644 --- a/sahara/tests/unit/service/validation/test_share_validations.py +++ b/sahara/tests/unit/service/validation/test_share_validations.py @@ -17,7 +17,7 @@ try: from manilaclient.common.apiclient import exceptions as manila_ex except ImportError: from manilaclient.openstack.common.apiclient import exceptions as manila_ex -import mock +from unittest import mock from sahara.service.validations import shares from sahara.tests.unit.service.validation import utils as u diff --git a/sahara/tests/unit/service/validation/test_validation.py b/sahara/tests/unit/service/validation/test_validation.py index 8d10c0fad8..5a2def3931 100644 --- a/sahara/tests/unit/service/validation/test_validation.py +++ b/sahara/tests/unit/service/validation/test_validation.py @@ -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 sahara import exceptions from sahara.service import validation diff --git a/sahara/tests/unit/service/validation/utils.py b/sahara/tests/unit/service/validation/utils.py index 7862c2a38a..cd371d6617 100644 --- a/sahara/tests/unit/service/validation/utils.py +++ b/sahara/tests/unit/service/validation/utils.py @@ -15,8 +15,8 @@ import ast import re +from unittest import mock -import mock from neutronclient.common import exceptions as neutron_ex import novaclient.exceptions as nova_ex import six diff --git a/sahara/tests/unit/swift/test_swift_helper.py b/sahara/tests/unit/swift/test_swift_helper.py index 6bb3bc1efe..bdd780136c 100644 --- a/sahara/tests/unit/swift/test_swift_helper.py +++ b/sahara/tests/unit/swift/test_swift_helper.py @@ -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 sahara.swift import swift_helper as h from sahara.tests.unit import base diff --git a/sahara/tests/unit/swift/test_utils.py b/sahara/tests/unit/swift/test_utils.py index 7450a40e08..2416a09e62 100644 --- a/sahara/tests/unit/swift/test_utils.py +++ b/sahara/tests/unit/swift/test_utils.py @@ -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 sahara.swift import utils from sahara.tests.unit import base as testbase diff --git a/sahara/tests/unit/test_context.py b/sahara/tests/unit/test_context.py index e2cb7c3332..85ab68e20c 100644 --- a/sahara/tests/unit/test_context.py +++ b/sahara/tests/unit/test_context.py @@ -14,9 +14,9 @@ # limitations under the License. import random +from unittest import mock import fixtures -import mock import six import testtools diff --git a/sahara/tests/unit/test_main.py b/sahara/tests/unit/test_main.py index b7528eade8..172f038f00 100644 --- a/sahara/tests/unit/test_main.py +++ b/sahara/tests/unit/test_main.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara import context from sahara import main diff --git a/sahara/tests/unit/topology/test_topology.py b/sahara/tests/unit/topology/test_topology.py index 8820428aca..cc3699ecef 100644 --- a/sahara/tests/unit/topology/test_topology.py +++ b/sahara/tests/unit/topology/test_topology.py @@ -14,8 +14,8 @@ # limitations under the License. import tempfile +from unittest import mock -import mock from sahara.conductor import objects as o from sahara import context diff --git a/sahara/tests/unit/utils/notification/test_sender.py b/sahara/tests/unit/utils/notification/test_sender.py index 5f68aea353..0a472b038d 100644 --- a/sahara/tests/unit/utils/notification/test_sender.py +++ b/sahara/tests/unit/utils/notification/test_sender.py @@ -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 sahara import context from sahara.tests.unit import base diff --git a/sahara/tests/unit/utils/openstack/test_base.py b/sahara/tests/unit/utils/openstack/test_base.py index 089c7110a5..fe7d1b714b 100644 --- a/sahara/tests/unit/utils/openstack/test_base.py +++ b/sahara/tests/unit/utils/openstack/test_base.py @@ -14,10 +14,11 @@ # limitations under the License. +from unittest import mock + from cinderclient import exceptions as cinder_exc from heatclient import exc as heat_exc from keystoneauth1 import exceptions as keystone_exc -import mock from neutronclient.common import exceptions as neutron_exc from novaclient import exceptions as nova_exc diff --git a/sahara/tests/unit/utils/openstack/test_heat.py b/sahara/tests/unit/utils/openstack/test_heat.py index 53d858e27d..2a7225367d 100644 --- a/sahara/tests/unit/utils/openstack/test_heat.py +++ b/sahara/tests/unit/utils/openstack/test_heat.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara.utils.openstack import heat as heat_u diff --git a/sahara/tests/unit/utils/openstack/test_images.py b/sahara/tests/unit/utils/openstack/test_images.py index abb27b45e1..c9f5f2bd16 100644 --- a/sahara/tests/unit/utils/openstack/test_images.py +++ b/sahara/tests/unit/utils/openstack/test_images.py @@ -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 sahara.tests.unit import base from sahara.utils.openstack import images as sahara_images diff --git a/sahara/tests/unit/utils/openstack/test_swift.py b/sahara/tests/unit/utils/openstack/test_swift.py index 4a8e444535..09d044e35b 100644 --- a/sahara/tests/unit/utils/openstack/test_swift.py +++ b/sahara/tests/unit/utils/openstack/test_swift.py @@ -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 sahara.tests.unit import base as testbase from sahara.utils.openstack import swift diff --git a/sahara/tests/unit/utils/test_api.py b/sahara/tests/unit/utils/test_api.py index d5949c09a1..6571b08522 100644 --- a/sahara/tests/unit/utils/test_api.py +++ b/sahara/tests/unit/utils/test_api.py @@ -14,8 +14,8 @@ # limitations under the License. import copy +from unittest import mock -import mock import testtools from sahara.utils import api diff --git a/sahara/tests/unit/utils/test_cinder.py b/sahara/tests/unit/utils/test_cinder.py index 5bed8c4c1e..bcdaae5d1d 100644 --- a/sahara/tests/unit/utils/test_cinder.py +++ b/sahara/tests/unit/utils/test_cinder.py @@ -14,8 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from unittest import mock + from keystoneauth1 import exceptions as keystone_exceptions -import mock from oslo_config import cfg from sahara import main diff --git a/sahara/tests/unit/utils/test_cluster.py b/sahara/tests/unit/utils/test_cluster.py index cda7d34581..a48d7871eb 100644 --- a/sahara/tests/unit/utils/test_cluster.py +++ b/sahara/tests/unit/utils/test_cluster.py @@ -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 sahara import conductor from sahara import context diff --git a/sahara/tests/unit/utils/test_cluster_progress_ops.py b/sahara/tests/unit/utils/test_cluster_progress_ops.py index 361944c9d7..7370010d09 100644 --- a/sahara/tests/unit/utils/test_cluster_progress_ops.py +++ b/sahara/tests/unit/utils/test_cluster_progress_ops.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils from sahara import conductor diff --git a/sahara/tests/unit/utils/test_edp.py b/sahara/tests/unit/utils/test_edp.py index f1aa8d2d33..f82ae99007 100644 --- a/sahara/tests/unit/utils/test_edp.py +++ b/sahara/tests/unit/utils/test_edp.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara.utils import edp diff --git a/sahara/tests/unit/utils/test_general.py b/sahara/tests/unit/utils/test_general.py index 2956ad9fbf..4afdea756d 100644 --- a/sahara/tests/unit/utils/test_general.py +++ b/sahara/tests/unit/utils/test_general.py @@ -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 sahara.tests.unit import base from sahara.utils import general diff --git a/sahara/tests/unit/utils/test_heat.py b/sahara/tests/unit/utils/test_heat.py index d7d61f62d4..7ef8f8692f 100644 --- a/sahara/tests/unit/utils/test_heat.py +++ b/sahara/tests/unit/utils/test_heat.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import testtools +from unittest import mock from sahara import exceptions as ex from sahara.utils.openstack import heat as h diff --git a/sahara/tests/unit/utils/test_neutron.py b/sahara/tests/unit/utils/test_neutron.py index 4bd60970eb..7a9bc304dc 100644 --- a/sahara/tests/unit/utils/test_neutron.py +++ b/sahara/tests/unit/utils/test_neutron.py @@ -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 sahara.tests.unit import base from sahara.utils.openstack import neutron as neutron_client diff --git a/sahara/tests/unit/utils/test_poll_utils.py b/sahara/tests/unit/utils/test_poll_utils.py index c960ecd867..f5e1fae37e 100644 --- a/sahara/tests/unit/utils/test_poll_utils.py +++ b/sahara/tests/unit/utils/test_poll_utils.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import six import testtools diff --git a/sahara/tests/unit/utils/test_proxy.py b/sahara/tests/unit/utils/test_proxy.py index aab6aedecf..581b0cf0e1 100644 --- a/sahara/tests/unit/utils/test_proxy.py +++ b/sahara/tests/unit/utils/test_proxy.py @@ -14,7 +14,8 @@ # limitations under the License. -import mock +from unittest import mock + from oslo_utils import uuidutils from sahara.service.edp import job_utils diff --git a/sahara/tests/unit/utils/test_rpc.py b/sahara/tests/unit/utils/test_rpc.py index 1b2008aaad..455c3aa29e 100644 --- a/sahara/tests/unit/utils/test_rpc.py +++ b/sahara/tests/unit/utils/test_rpc.py @@ -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 sahara import main from sahara.tests.unit import base diff --git a/sahara/tests/unit/utils/test_ssh_remote.py b/sahara/tests/unit/utils/test_ssh_remote.py index 5846fdbcaa..c8674af71f 100644 --- a/sahara/tests/unit/utils/test_ssh_remote.py +++ b/sahara/tests/unit/utils/test_ssh_remote.py @@ -15,8 +15,8 @@ import shlex +from unittest import mock -import mock import testtools from sahara import exceptions as ex diff --git a/test-requirements.txt b/test-requirements.txt index 8c24197486..d1731921f5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,7 +10,6 @@ bashate>=0.5.1 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0 psycopg2>=2.7.3 # LGPL/ZPL