From 4f412502239c2ca58dc9b1d69922fec3bc37727a Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 18 Apr 2020 11:52:52 -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: I8f764e9ba46a4e2055be61eb0fe97d155ab1c70e Signed-off-by: Sean McGinnis --- .../heat_docker/heat_docker/tests/fake_docker_client.py | 2 +- .../heat_docker/tests/test_docker_container.py | 2 +- heat/tests/api/aws/test_api_ec2token.py | 2 +- heat/tests/api/cfn/test_api_cfn_v1.py | 2 +- heat/tests/api/openstack_v1/test_actions.py | 5 +++++ heat/tests/api/openstack_v1/test_build_info.py | 6 ++++++ heat/tests/api/openstack_v1/test_events.py | 6 ++++++ heat/tests/api/openstack_v1/test_resources.py | 6 ++++++ heat/tests/api/openstack_v1/test_services.py | 3 ++- heat/tests/api/openstack_v1/test_software_configs.py | 2 +- heat/tests/api/openstack_v1/test_software_deployments.py | 2 +- heat/tests/api/openstack_v1/test_stacks.py | 2 +- heat/tests/api/openstack_v1/test_util.py | 3 ++- heat/tests/api/openstack_v1/test_views_common.py | 6 ++++++ heat/tests/api/openstack_v1/test_views_stacks_view.py | 2 +- heat/tests/api/openstack_v1/tools.py | 3 ++- heat/tests/api/test_wsgi.py | 9 +++++++-- heat/tests/autoscaling/test_heat_scaling_group.py | 2 +- heat/tests/autoscaling/test_heat_scaling_policy.py | 6 ++++++ heat/tests/autoscaling/test_launch_config.py | 6 ++++++ heat/tests/autoscaling/test_lbutils.py | 6 ++++++ heat/tests/autoscaling/test_scaling_group.py | 2 +- heat/tests/autoscaling/test_scaling_policy.py | 6 ++++++ heat/tests/aws/test_eip.py | 2 +- heat/tests/aws/test_instance.py | 2 +- heat/tests/aws/test_loadbalancer.py | 2 +- heat/tests/aws/test_s3.py | 5 +++++ heat/tests/aws/test_security_group.py | 2 +- heat/tests/aws/test_user.py | 3 ++- heat/tests/aws/test_volume.py | 2 +- heat/tests/aws/test_waitcondition.py | 2 +- heat/tests/clients/test_barbican_client.py | 2 +- heat/tests/clients/test_blazar_client.py | 3 ++- heat/tests/clients/test_cinder_client.py | 2 +- heat/tests/clients/test_clients.py | 3 ++- heat/tests/clients/test_designate_client.py | 3 ++- heat/tests/clients/test_glance_client.py | 2 +- heat/tests/clients/test_heat_client.py | 2 +- heat/tests/clients/test_ironic_client.py | 3 ++- heat/tests/clients/test_keystone_client.py | 6 ++++++ heat/tests/clients/test_magnum_client.py | 3 ++- heat/tests/clients/test_manila_client.py | 2 +- heat/tests/clients/test_mistral_client.py | 3 ++- heat/tests/clients/test_monasca_client.py | 6 ++++++ heat/tests/clients/test_neutron_client.py | 7 +++++++ heat/tests/clients/test_nova_client.py | 2 +- heat/tests/clients/test_sahara_client.py | 2 +- heat/tests/clients/test_sdk_client.py | 2 +- heat/tests/clients/test_senlin_client.py | 3 ++- heat/tests/clients/test_swift_client.py | 2 +- heat/tests/clients/test_zaqar_client.py | 3 +-- heat/tests/clients/test_zun_client.py | 2 +- heat/tests/constraints/test_common_constraints.py | 6 ++++++ heat/tests/convergence/framework/worker_wrapper.py | 2 +- heat/tests/db/test_sqlalchemy_api.py | 5 ++--- heat/tests/db/test_sqlalchemy_filters.py | 2 +- heat/tests/engine/service/test_service_engine.py | 2 +- heat/tests/engine/service/test_software_config.py | 2 +- heat/tests/engine/service/test_stack_action.py | 3 ++- heat/tests/engine/service/test_stack_adopt.py | 3 ++- heat/tests/engine/service/test_stack_create.py | 3 ++- heat/tests/engine/service/test_stack_delete.py | 3 ++- heat/tests/engine/service/test_stack_events.py | 3 ++- heat/tests/engine/service/test_stack_resources.py | 3 ++- heat/tests/engine/service/test_stack_snapshot.py | 2 +- heat/tests/engine/service/test_stack_update.py | 2 +- heat/tests/engine/service/test_threadgroup_mgr.py | 4 ++-- heat/tests/engine/test_check_resource.py | 4 ++-- heat/tests/engine/test_engine_worker.py | 2 +- heat/tests/engine/test_resource_type.py | 6 ++++++ heat/tests/engine/test_scheduler.py | 7 ++++++- heat/tests/engine/test_sync_point.py | 3 ++- heat/tests/fakes.py | 3 ++- heat/tests/openstack/aodh/test_alarm.py | 5 +++++ heat/tests/openstack/aodh/test_composite_alarm.py | 5 +++++ heat/tests/openstack/aodh/test_gnocchi_alarm.py | 2 +- heat/tests/openstack/barbican/test_container.py | 6 ++++++ heat/tests/openstack/barbican/test_order.py | 6 ++++++ heat/tests/openstack/barbican/test_secret.py | 2 +- heat/tests/openstack/blazar/test_host.py | 3 ++- heat/tests/openstack/blazar/test_lease.py | 3 ++- heat/tests/openstack/cinder/test_qos_specs.py | 2 +- heat/tests/openstack/cinder/test_quota.py | 6 ++++++ heat/tests/openstack/cinder/test_volume.py | 2 +- heat/tests/openstack/cinder/test_volume_type.py | 6 ++++++ .../openstack/cinder/test_volume_type_encryption.py | 2 +- heat/tests/openstack/cinder/test_volume_utils.py | 6 ++++++ heat/tests/openstack/designate/test_recordset.py | 3 ++- heat/tests/openstack/designate/test_zone.py | 2 +- heat/tests/openstack/glance/test_image.py | 6 ++++++ heat/tests/openstack/heat/test_cloud_config.py | 2 +- heat/tests/openstack/heat/test_deployed_server.py | 2 +- heat/tests/openstack/heat/test_instance_group.py | 5 +++++ .../openstack/heat/test_instance_group_update_policy.py | 2 +- heat/tests/openstack/heat/test_multi_part.py | 3 +-- heat/tests/openstack/heat/test_none_resource.py | 2 +- heat/tests/openstack/heat/test_random_string.py | 5 +++++ heat/tests/openstack/heat/test_remote_stack.py | 2 +- heat/tests/openstack/heat/test_resource_chain.py | 6 ++++++ heat/tests/openstack/heat/test_resource_group.py | 5 +++++ heat/tests/openstack/heat/test_software_component.py | 6 ++++++ heat/tests/openstack/heat/test_software_config.py | 2 +- heat/tests/openstack/heat/test_software_deployment.py | 5 +++++ heat/tests/openstack/heat/test_structured_config.py | 2 +- heat/tests/openstack/heat/test_swiftsignal.py | 2 +- heat/tests/openstack/heat/test_waitcondition.py | 2 +- heat/tests/openstack/keystone/test_domain.py | 2 +- heat/tests/openstack/keystone/test_endpoint.py | 3 +-- heat/tests/openstack/keystone/test_group.py | 2 +- heat/tests/openstack/keystone/test_project.py | 2 +- heat/tests/openstack/keystone/test_region.py | 6 ++++++ heat/tests/openstack/keystone/test_role.py | 2 +- heat/tests/openstack/keystone/test_role_assignments.py | 2 +- heat/tests/openstack/keystone/test_service.py | 3 +-- heat/tests/openstack/keystone/test_user.py | 2 +- heat/tests/openstack/magnum/test_bay.py | 3 ++- heat/tests/openstack/magnum/test_cluster.py | 3 ++- heat/tests/openstack/magnum/test_cluster_template.py | 3 ++- heat/tests/openstack/manila/test_security_service.py | 6 ++++++ heat/tests/openstack/manila/test_share.py | 5 +++++ heat/tests/openstack/manila/test_share_network.py | 2 +- heat/tests/openstack/manila/test_share_type.py | 2 +- heat/tests/openstack/mistral/test_cron_trigger.py | 2 +- heat/tests/openstack/mistral/test_external_resource.py | 2 +- heat/tests/openstack/mistral/test_workflow.py | 5 +++++ heat/tests/openstack/monasca/test_alarm_definition.py | 2 +- heat/tests/openstack/monasca/test_notification.py | 6 ++++++ .../tests/openstack/neutron/lbaas/test_health_monitor.py | 2 +- heat/tests/openstack/neutron/lbaas/test_l7policy.py | 2 +- heat/tests/openstack/neutron/lbaas/test_l7rule.py | 2 +- heat/tests/openstack/neutron/lbaas/test_listener.py | 2 +- heat/tests/openstack/neutron/lbaas/test_loadbalancer.py | 2 +- heat/tests/openstack/neutron/lbaas/test_pool.py | 2 +- heat/tests/openstack/neutron/lbaas/test_pool_member.py | 2 +- heat/tests/openstack/neutron/test_address_scope.py | 2 +- heat/tests/openstack/neutron/test_extraroute.py | 2 +- heat/tests/openstack/neutron/test_neutron_firewall.py | 3 ++- heat/tests/openstack/neutron/test_neutron_floating_ip.py | 2 +- heat/tests/openstack/neutron/test_neutron_l2_gateway.py | 3 ++- .../neutron/test_neutron_l2_gateway_connection.py | 3 ++- .../tests/openstack/neutron/test_neutron_loadbalancer.py | 3 ++- heat/tests/openstack/neutron/test_neutron_metering.py | 5 +++++ .../openstack/neutron/test_neutron_network_gateway.py | 5 +++++ heat/tests/openstack/neutron/test_neutron_port.py | 3 ++- .../tests/openstack/neutron/test_neutron_provider_net.py | 2 +- heat/tests/openstack/neutron/test_neutron_rbac_policy.py | 2 +- heat/tests/openstack/neutron/test_neutron_router.py | 2 +- .../openstack/neutron/test_neutron_security_group.py | 2 +- .../neutron/test_neutron_security_group_rule.py | 2 +- heat/tests/openstack/neutron/test_neutron_segment.py | 3 ++- heat/tests/openstack/neutron/test_neutron_subnet.py | 3 ++- heat/tests/openstack/neutron/test_neutron_vpnservice.py | 5 +++++ heat/tests/openstack/neutron/test_qos.py | 2 +- heat/tests/openstack/neutron/test_quota.py | 6 ++++++ .../openstack/neutron/test_sfc/test_flow_classifier.py | 2 +- heat/tests/openstack/neutron/test_sfc/test_port_chain.py | 2 +- heat/tests/openstack/neutron/test_sfc/test_port_pair.py | 2 +- .../openstack/neutron/test_sfc/test_port_pair_group.py | 2 +- heat/tests/openstack/neutron/test_taas/test_tap_flow.py | 2 +- .../openstack/neutron/test_taas/test_tap_service.py | 2 +- heat/tests/openstack/nova/fakes.py | 4 ++-- heat/tests/openstack/nova/test_flavor.py | 2 +- heat/tests/openstack/nova/test_floatingip.py | 2 +- heat/tests/openstack/nova/test_host_aggregate.py | 2 +- heat/tests/openstack/nova/test_keypair.py | 5 +++++ heat/tests/openstack/nova/test_quota.py | 6 ++++++ heat/tests/openstack/nova/test_server.py | 2 +- heat/tests/openstack/nova/test_server_group.py | 3 +-- heat/tests/openstack/octavia/test_flavor.py | 2 +- heat/tests/openstack/octavia/test_flavor_profile.py | 2 +- heat/tests/openstack/octavia/test_health_monitor.py | 2 +- heat/tests/openstack/octavia/test_l7policy.py | 2 +- heat/tests/openstack/octavia/test_l7rule.py | 2 +- heat/tests/openstack/octavia/test_listener.py | 2 +- heat/tests/openstack/octavia/test_loadbalancer.py | 2 +- heat/tests/openstack/octavia/test_pool.py | 2 +- heat/tests/openstack/octavia/test_pool_member.py | 2 +- heat/tests/openstack/octavia/test_quota.py | 3 ++- heat/tests/openstack/sahara/test_cluster.py | 3 ++- heat/tests/openstack/sahara/test_data_source.py | 6 ++++++ heat/tests/openstack/sahara/test_image.py | 2 +- heat/tests/openstack/sahara/test_job.py | 2 +- heat/tests/openstack/sahara/test_job_binary.py | 6 ++++++ heat/tests/openstack/sahara/test_templates.py | 6 ++++++ heat/tests/openstack/senlin/test_cluster.py | 3 ++- heat/tests/openstack/senlin/test_node.py | 3 ++- heat/tests/openstack/senlin/test_policy.py | 2 +- heat/tests/openstack/senlin/test_profile.py | 2 +- heat/tests/openstack/senlin/test_receiver.py | 2 +- heat/tests/openstack/swift/test_container.py | 6 ++++++ heat/tests/openstack/trove/test_cluster.py | 6 ++++++ heat/tests/openstack/trove/test_instance.py | 2 +- heat/tests/openstack/zaqar/test_queue.py | 7 +++++++ heat/tests/openstack/zaqar/test_subscription.py | 6 ++++++ heat/tests/openstack/zun/test_container.py | 6 ++++++ heat/tests/test_attributes.py | 6 ++++++ heat/tests/test_auth_password.py | 3 ++- heat/tests/test_auth_url.py | 2 +- heat/tests/test_common_auth_plugin.py | 3 ++- heat/tests/test_common_context.py | 2 +- heat/tests/test_convg_stack.py | 3 ++- heat/tests/test_engine_api_utils.py | 2 +- heat/tests/test_engine_service.py | 2 +- heat/tests/test_environment.py | 2 +- heat/tests/test_environment_format.py | 2 +- heat/tests/test_event.py | 3 ++- heat/tests/test_exception.py | 3 ++- heat/tests/test_grouputils.py | 2 +- heat/tests/test_hot.py | 2 +- heat/tests/test_lifecycle_plugin_utils.py | 2 +- heat/tests/test_loguserdata.py | 2 +- heat/tests/test_metadata_refresh.py | 3 ++- heat/tests/test_nested_stack.py | 3 ++- heat/tests/test_notifications.py | 3 ++- heat/tests/test_plugin_loader.py | 3 +-- heat/tests/test_properties.py | 3 ++- heat/tests/test_provider_template.py | 3 +-- heat/tests/test_resource.py | 4 ++-- heat/tests/test_rpc_client.py | 2 +- heat/tests/test_rpc_listener_client.py | 3 ++- heat/tests/test_rpc_worker_client.py | 2 +- heat/tests/test_server_tags.py | 3 +-- heat/tests/test_signal.py | 2 +- heat/tests/test_stack.py | 2 +- heat/tests/test_stack_delete.py | 2 +- heat/tests/test_stack_lock.py | 2 +- heat/tests/test_stack_resource.py | 2 +- heat/tests/test_stack_update.py | 2 +- heat/tests/test_stack_user.py | 3 ++- heat/tests/test_template_format.py | 2 +- heat/tests/test_translation_rule.py | 2 +- heat/tests/test_validate.py | 3 ++- heat/tests/test_vpc.py | 2 +- test-requirements.txt | 1 - 234 files changed, 530 insertions(+), 200 deletions(-) diff --git a/contrib/heat_docker/heat_docker/tests/fake_docker_client.py b/contrib/heat_docker/heat_docker/tests/fake_docker_client.py index 98d7747d86..ecb79789dc 100644 --- a/contrib/heat_docker/heat_docker/tests/fake_docker_client.py +++ b/contrib/heat_docker/heat_docker/tests/fake_docker_client.py @@ -14,9 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. -import mock import random import string +from unittest import mock class APIError(Exception): diff --git a/contrib/heat_docker/heat_docker/tests/test_docker_container.py b/contrib/heat_docker/heat_docker/tests/test_docker_container.py index 9872a9bf1d..19c872a124 100644 --- a/contrib/heat_docker/heat_docker/tests/test_docker_container.py +++ b/contrib/heat_docker/heat_docker/tests/test_docker_container.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common.i18n import _ diff --git a/heat/tests/api/aws/test_api_ec2token.py b/heat/tests/api/aws/test_api_ec2token.py index 40cc5de2cb..af1305f609 100644 --- a/heat/tests/api/aws/test_api_ec2token.py +++ b/heat/tests/api/aws/test_api_ec2token.py @@ -13,7 +13,7 @@ import json -import mock +from unittest import mock from oslo_config import cfg from oslo_utils import importutils diff --git a/heat/tests/api/cfn/test_api_cfn_v1.py b/heat/tests/api/cfn/test_api_cfn_v1.py index f3b2c5ee9b..88d3764c68 100644 --- a/heat/tests/api/cfn/test_api_cfn_v1.py +++ b/heat/tests/api/cfn/test_api_cfn_v1.py @@ -13,8 +13,8 @@ import json import os +from unittest import mock -import mock from oslo_config import fixture as config_fixture from heat.api.aws import exception diff --git a/heat/tests/api/openstack_v1/test_actions.py b/heat/tests/api/openstack_v1/test_actions.py index 35d41299ee..c3708e992b 100644 --- a/heat/tests/api/openstack_v1/test_actions.py +++ b/heat/tests/api/openstack_v1/test_actions.py @@ -12,8 +12,13 @@ # under the License. import json +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import webob.exc import heat.api.middleware.fault as fault diff --git a/heat/tests/api/openstack_v1/test_build_info.py b/heat/tests/api/openstack_v1/test_build_info.py index c958068d63..c5a500b878 100644 --- a/heat/tests/api/openstack_v1/test_build_info.py +++ b/heat/tests/api/openstack_v1/test_build_info.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import heat.api.middleware.fault as fault import heat.api.openstack.v1.build_info as build_info diff --git a/heat/tests/api/openstack_v1/test_events.py b/heat/tests/api/openstack_v1/test_events.py index 217ae51bb4..d048b5e2d8 100644 --- a/heat/tests/api/openstack_v1/test_events.py +++ b/heat/tests/api/openstack_v1/test_events.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import webob.exc import heat.api.middleware.fault as fault diff --git a/heat/tests/api/openstack_v1/test_resources.py b/heat/tests/api/openstack_v1/test_resources.py index 5af626c3fb..0fdbfbd759 100644 --- a/heat/tests/api/openstack_v1/test_resources.py +++ b/heat/tests/api/openstack_v1/test_resources.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import webob.exc import heat.api.middleware.fault as fault diff --git a/heat/tests/api/openstack_v1/test_services.py b/heat/tests/api/openstack_v1/test_services.py index 1b078d013f..ef659ddcbb 100644 --- a/heat/tests/api/openstack_v1/test_services.py +++ b/heat/tests/api/openstack_v1/test_services.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_messaging import exceptions import webob.exc diff --git a/heat/tests/api/openstack_v1/test_software_configs.py b/heat/tests/api/openstack_v1/test_software_configs.py index aa644cf230..c1516eda07 100644 --- a/heat/tests/api/openstack_v1/test_software_configs.py +++ b/heat/tests/api/openstack_v1/test_software_configs.py @@ -12,8 +12,8 @@ # under the License. import json +from unittest import mock -import mock import webob.exc import heat.api.middleware.fault as fault diff --git a/heat/tests/api/openstack_v1/test_software_deployments.py b/heat/tests/api/openstack_v1/test_software_deployments.py index 9f4023a27d..3abe98f30e 100644 --- a/heat/tests/api/openstack_v1/test_software_deployments.py +++ b/heat/tests/api/openstack_v1/test_software_deployments.py @@ -12,8 +12,8 @@ # under the License. import json +from unittest import mock -import mock import webob.exc import heat.api.middleware.fault as fault diff --git a/heat/tests/api/openstack_v1/test_stacks.py b/heat/tests/api/openstack_v1/test_stacks.py index f27253a4e2..5a9f41eea5 100644 --- a/heat/tests/api/openstack_v1/test_stacks.py +++ b/heat/tests/api/openstack_v1/test_stacks.py @@ -12,8 +12,8 @@ # under the License. import json +from unittest import mock -import mock from oslo_config import cfg import webob.exc diff --git a/heat/tests/api/openstack_v1/test_util.py b/heat/tests/api/openstack_v1/test_util.py index ff286a596c..8add5b3a72 100644 --- a/heat/tests/api/openstack_v1/test_util.py +++ b/heat/tests/api/openstack_v1/test_util.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from webob import exc from heat.api.openstack.v1 import util diff --git a/heat/tests/api/openstack_v1/test_views_common.py b/heat/tests/api/openstack_v1/test_views_common.py index 1f3fb238cb..f51f425811 100644 --- a/heat/tests/api/openstack_v1/test_views_common.py +++ b/heat/tests/api/openstack_v1/test_views_common.py @@ -11,8 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock from urllib import parse as urlparse +======= +from unittest import mock + +from six.moves.urllib import parse as urlparse +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.api.openstack.v1.views import views_common from heat.tests import common diff --git a/heat/tests/api/openstack_v1/test_views_stacks_view.py b/heat/tests/api/openstack_v1/test_views_stacks_view.py index 5f71c0feec..00c56a564f 100644 --- a/heat/tests/api/openstack_v1/test_views_stacks_view.py +++ b/heat/tests/api/openstack_v1/test_views_stacks_view.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.api.openstack.v1.views import stacks_view from heat.common import identifier diff --git a/heat/tests/api/openstack_v1/tools.py b/heat/tests/api/openstack_v1/tools.py index 7ed27ee33c..63a8b0521a 100644 --- a/heat/tests/api/openstack_v1/tools.py +++ b/heat/tests/api/openstack_v1/tools.py @@ -11,7 +11,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_log import log from oslo_messaging._drivers import common as rpc_common diff --git a/heat/tests/api/test_wsgi.py b/heat/tests/api/test_wsgi.py index 9d273d536b..e08f3dd026 100644 --- a/heat/tests/api/test_wsgi.py +++ b/heat/tests/api/test_wsgi.py @@ -15,14 +15,19 @@ # under the License. +from unittest import mock + import fixtures import json +<<<<<<< HEAD import mock +======= +from oslo_config import cfg +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import socket import webob -from oslo_config import cfg - from heat.api.aws import exception as aws_exception from heat.common import exception from heat.common import wsgi diff --git a/heat/tests/autoscaling/test_heat_scaling_group.py b/heat/tests/autoscaling/test_heat_scaling_group.py index 031460ebf7..b91c333124 100644 --- a/heat/tests/autoscaling/test_heat_scaling_group.py +++ b/heat/tests/autoscaling/test_heat_scaling_group.py @@ -12,8 +12,8 @@ import datetime import json +from unittest import mock -import mock from oslo_utils import timeutils from heat.common import exception diff --git a/heat/tests/autoscaling/test_heat_scaling_policy.py b/heat/tests/autoscaling/test_heat_scaling_policy.py index a3e89b67c6..f12aed67c0 100644 --- a/heat/tests/autoscaling/test_heat_scaling_policy.py +++ b/heat/tests/autoscaling/test_heat_scaling_policy.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/autoscaling/test_launch_config.py b/heat/tests/autoscaling/test_launch_config.py index d4413e8081..2733fd279e 100644 --- a/heat/tests/autoscaling/test_launch_config.py +++ b/heat/tests/autoscaling/test_launch_config.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import short_id diff --git a/heat/tests/autoscaling/test_lbutils.py b/heat/tests/autoscaling/test_lbutils.py index 51ad5c2d80..9b273c9bb6 100644 --- a/heat/tests/autoscaling/test_lbutils.py +++ b/heat/tests/autoscaling/test_lbutils.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/autoscaling/test_scaling_group.py b/heat/tests/autoscaling/test_scaling_group.py index 91e5f96307..db2177a9ff 100644 --- a/heat/tests/autoscaling/test_scaling_group.py +++ b/heat/tests/autoscaling/test_scaling_group.py @@ -13,8 +13,8 @@ import datetime import json +from unittest import mock -import mock from oslo_utils import timeutils from heat.common import exception diff --git a/heat/tests/autoscaling/test_scaling_policy.py b/heat/tests/autoscaling/test_scaling_policy.py index 2c7cc51903..dbd82cea4f 100644 --- a/heat/tests/autoscaling/test_scaling_policy.py +++ b/heat/tests/autoscaling/test_scaling_policy.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/aws/test_eip.py b/heat/tests/aws/test_eip.py index 948002f185..4b6047d6c2 100644 --- a/heat/tests/aws/test_eip.py +++ b/heat/tests/aws/test_eip.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from neutronclient.common import exceptions as q_exceptions from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/aws/test_instance.py b/heat/tests/aws/test_instance.py index 7445cabf82..500cb190dc 100644 --- a/heat/tests/aws/test_instance.py +++ b/heat/tests/aws/test_instance.py @@ -12,9 +12,9 @@ # under the License. import copy +from unittest import mock import uuid -import mock from neutronclient.v2_0 import client as neutronclient from heat.common import exception diff --git a/heat/tests/aws/test_loadbalancer.py b/heat/tests/aws/test_loadbalancer.py index 07417d1305..7ad6106a9c 100644 --- a/heat/tests/aws/test_loadbalancer.py +++ b/heat/tests/aws/test_loadbalancer.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/aws/test_s3.py b/heat/tests/aws/test_s3.py index 229f36c4b9..91b5efd787 100644 --- a/heat/tests/aws/test_s3.py +++ b/heat/tests/aws/test_s3.py @@ -11,9 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from oslo_config import cfg +import six import swiftclient.client as sc from heat.common import exception diff --git a/heat/tests/aws/test_security_group.py b/heat/tests/aws/test_security_group.py index 8c1b755e9f..9f720caa97 100644 --- a/heat/tests/aws/test_security_group.py +++ b/heat/tests/aws/test_security_group.py @@ -13,8 +13,8 @@ import collections import copy +from unittest import mock -import mock from neutronclient.common import exceptions as neutron_exc from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/aws/test_user.py b/heat/tests/aws/test_user.py index 8d6a89fac6..410d2cff57 100644 --- a/heat/tests/aws/test_user.py +++ b/heat/tests/aws/test_user.py @@ -11,7 +11,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 heat.common import exception diff --git a/heat/tests/aws/test_volume.py b/heat/tests/aws/test_volume.py index 54c72e4f48..a2dfbf91ca 100644 --- a/heat/tests/aws/test_volume.py +++ b/heat/tests/aws/test_volume.py @@ -12,9 +12,9 @@ # under the License. import copy +from unittest import mock from cinderclient import exceptions as cinder_exp -import mock from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/aws/test_waitcondition.py b/heat/tests/aws/test_waitcondition.py index a0a737fbf8..5eff036b02 100644 --- a/heat/tests/aws/test_waitcondition.py +++ b/heat/tests/aws/test_waitcondition.py @@ -14,9 +14,9 @@ import copy import datetime import json +from unittest import mock import uuid -import mock from oslo_utils import timeutils from urllib import parse diff --git a/heat/tests/clients/test_barbican_client.py b/heat/tests/clients/test_barbican_client.py index 977886710a..6159ab70ea 100644 --- a/heat/tests/clients/test_barbican_client.py +++ b/heat/tests/clients/test_barbican_client.py @@ -12,9 +12,9 @@ # under the License. import collections +from unittest import mock from barbicanclient import exceptions -import mock from heat.common import exception from heat.engine.clients.os import barbican diff --git a/heat/tests/clients/test_blazar_client.py b/heat/tests/clients/test_blazar_client.py index f9410f9fe0..e671f862cb 100644 --- a/heat/tests/clients/test_blazar_client.py +++ b/heat/tests/clients/test_blazar_client.py @@ -11,9 +11,10 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from heat.tests import common from heat.tests import utils -import mock class BlazarClientPluginTest(common.HeatTestCase): diff --git a/heat/tests/clients/test_cinder_client.py b/heat/tests/clients/test_cinder_client.py index bebfc574d8..69b13c6127 100644 --- a/heat/tests/clients/test_cinder_client.py +++ b/heat/tests/clients/test_cinder_client.py @@ -12,11 +12,11 @@ # under the License. """Tests for :module:'heat.engine.clients.os.cinder'.""" +from unittest import mock import uuid from cinderclient import exceptions as cinder_exc from keystoneauth1 import exceptions as ks_exceptions -import mock from heat.common import exception from heat.engine.clients.os import cinder diff --git a/heat/tests/clients/test_clients.py b/heat/tests/clients/test_clients.py index d30a4f4fbc..c392c2a300 100644 --- a/heat/tests/clients/test_clients.py +++ b/heat/tests/clients/test_clients.py @@ -11,6 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from aodhclient import exceptions as aodh_exc from cinderclient import exceptions as cinder_exc from glanceclient import exc as glance_exc @@ -20,7 +22,6 @@ from keystoneauth1 import exceptions as keystone_exc from keystoneauth1.identity import generic from manilaclient import exceptions as manila_exc from mistralclient.api import base as mistral_base -import mock from neutronclient.common import exceptions as neutron_exc from openstack import exceptions from oslo_config import cfg diff --git a/heat/tests/clients/test_designate_client.py b/heat/tests/clients/test_designate_client.py index 03f74547f2..5631565aad 100644 --- a/heat/tests/clients/test_designate_client.py +++ b/heat/tests/clients/test_designate_client.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from designateclient import client as designate_client -import mock from heat.common import exception as heat_exception from heat.engine.clients.os import designate as client diff --git a/heat/tests/clients/test_glance_client.py b/heat/tests/clients/test_glance_client.py index 738f471d82..4db8b1ead3 100644 --- a/heat/tests/clients/test_glance_client.py +++ b/heat/tests/clients/test_glance_client.py @@ -11,10 +11,10 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid from glanceclient import exc -import mock from heat.engine.clients import client_exception as exception from heat.engine.clients.os import glance diff --git a/heat/tests/clients/test_heat_client.py b/heat/tests/clients/test_heat_client.py index c7d4d5cb84..912fbdf75f 100644 --- a/heat/tests/clients/test_heat_client.py +++ b/heat/tests/clients/test_heat_client.py @@ -12,7 +12,7 @@ # under the License. import json -import mock +from unittest import mock import uuid from keystoneauth1 import access as ks_access diff --git a/heat/tests/clients/test_ironic_client.py b/heat/tests/clients/test_ironic_client.py index a56ae3e1b7..5b0568d57b 100644 --- a/heat/tests/clients/test_ironic_client.py +++ b/heat/tests/clients/test_ironic_client.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from ironicclient import exceptions as ic_exc -import mock from heat.engine.clients.os import ironic as ic from heat.tests import common diff --git a/heat/tests/clients/test_keystone_client.py b/heat/tests/clients/test_keystone_client.py index 8536604fa7..308b2a60b4 100644 --- a/heat/tests/clients/test_keystone_client.py +++ b/heat/tests/clients/test_keystone_client.py @@ -11,8 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from keystoneauth1 import exceptions as keystone_exceptions +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.engine.clients.os import keystone diff --git a/heat/tests/clients/test_magnum_client.py b/heat/tests/clients/test_magnum_client.py index 97bf939ce3..e0468308c4 100644 --- a/heat/tests/clients/test_magnum_client.py +++ b/heat/tests/clients/test_magnum_client.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from magnumclient import exceptions as mc_exc -import mock from heat.engine.clients.os import magnum as mc from heat.tests import common diff --git a/heat/tests/clients/test_manila_client.py b/heat/tests/clients/test_manila_client.py index a1a986091b..5ed2f7a2f9 100644 --- a/heat/tests/clients/test_manila_client.py +++ b/heat/tests/clients/test_manila_client.py @@ -11,9 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. import collections +from unittest import mock from manilaclient import exceptions -import mock from heat.common import exception as heat_exception from heat.tests import common diff --git a/heat/tests/clients/test_mistral_client.py b/heat/tests/clients/test_mistral_client.py index da3707ba17..b054754239 100644 --- a/heat/tests/clients/test_mistral_client.py +++ b/heat/tests/clients/test_mistral_client.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from mistralclient.auth import keystone -import mock from heat.common import exception from heat.engine.clients.os import mistral diff --git a/heat/tests/clients/test_monasca_client.py b/heat/tests/clients/test_monasca_client.py index 37214c693d..2fcd362f23 100644 --- a/heat/tests/clients/test_monasca_client.py +++ b/heat/tests/clients/test_monasca_client.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception as heat_exception from heat.engine.clients.os import monasca as client_plugin diff --git a/heat/tests/clients/test_neutron_client.py b/heat/tests/clients/test_neutron_client.py index a8b8b9e625..42ffd5799c 100644 --- a/heat/tests/clients/test_neutron_client.py +++ b/heat/tests/clients/test_neutron_client.py @@ -11,7 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six + +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from neutronclient.common import exceptions as qe from heat.common import exception diff --git a/heat/tests/clients/test_nova_client.py b/heat/tests/clients/test_nova_client.py index 9bdba9a2ae..35e37cc61d 100644 --- a/heat/tests/clients/test_nova_client.py +++ b/heat/tests/clients/test_nova_client.py @@ -13,9 +13,9 @@ """Tests for :module:'heat.engine.clients.os.nova'.""" import collections +from unittest import mock import uuid -import mock from novaclient import client as nc from novaclient import exceptions as nova_exceptions from oslo_config import cfg diff --git a/heat/tests/clients/test_sahara_client.py b/heat/tests/clients/test_sahara_client.py index 1cc97dd444..d0d0d3438c 100644 --- a/heat/tests/clients/test_sahara_client.py +++ b/heat/tests/clients/test_sahara_client.py @@ -11,9 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid -import mock from saharaclient.api import base as sahara_base from heat.common import exception diff --git a/heat/tests/clients/test_sdk_client.py b/heat/tests/clients/test_sdk_client.py index 98f40af07e..d2fd238f0b 100644 --- a/heat/tests/clients/test_sdk_client.py +++ b/heat/tests/clients/test_sdk_client.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from openstack import exceptions diff --git a/heat/tests/clients/test_senlin_client.py b/heat/tests/clients/test_senlin_client.py index 9510050d16..0e3bdf3d8c 100644 --- a/heat/tests/clients/test_senlin_client.py +++ b/heat/tests/clients/test_senlin_client.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from openstack import exceptions from heat.engine.clients.os import senlin as senlin_plugin diff --git a/heat/tests/clients/test_swift_client.py b/heat/tests/clients/test_swift_client.py index 4b6d1060fe..90272b6df1 100644 --- a/heat/tests/clients/test_swift_client.py +++ b/heat/tests/clients/test_swift_client.py @@ -12,8 +12,8 @@ # under the License. import datetime +from unittest import mock -import mock import pytz from testtools import matchers diff --git a/heat/tests/clients/test_zaqar_client.py b/heat/tests/clients/test_zaqar_client.py index ffd7b6aaaa..bd588c7c91 100644 --- a/heat/tests/clients/test_zaqar_client.py +++ b/heat/tests/clients/test_zaqar_client.py @@ -11,10 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os import zaqar - from heat.tests import common from heat.tests import utils diff --git a/heat/tests/clients/test_zun_client.py b/heat/tests/clients/test_zun_client.py index ae022a2238..e20326597b 100644 --- a/heat/tests/clients/test_zun_client.py +++ b/heat/tests/clients/test_zun_client.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.tests import common from heat.tests import utils diff --git a/heat/tests/constraints/test_common_constraints.py b/heat/tests/constraints/test_common_constraints.py index 5d5c84aa55..0a2cfdef7b 100644 --- a/heat/tests/constraints/test_common_constraints.py +++ b/heat/tests/constraints/test_common_constraints.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.engine.constraint import common_constraints as cc from heat.tests import common diff --git a/heat/tests/convergence/framework/worker_wrapper.py b/heat/tests/convergence/framework/worker_wrapper.py index 7ca39ada1d..841cdb3619 100644 --- a/heat/tests/convergence/framework/worker_wrapper.py +++ b/heat/tests/convergence/framework/worker_wrapper.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine import worker from heat.tests.convergence.framework import message_processor diff --git a/heat/tests/db/test_sqlalchemy_api.py b/heat/tests/db/test_sqlalchemy_api.py index 2b43cc8066..d022188fe1 100644 --- a/heat/tests/db/test_sqlalchemy_api.py +++ b/heat/tests/db/test_sqlalchemy_api.py @@ -13,20 +13,19 @@ import copy import datetime -import fixtures import json import logging import time +from unittest import mock import uuid -import mock +import fixtures from oslo_config import cfg from oslo_db import exception as db_exception from oslo_utils import timeutils from sqlalchemy.orm import exc from sqlalchemy.orm import session - from heat.common import context from heat.common import exception from heat.common import short_id diff --git a/heat/tests/db/test_sqlalchemy_filters.py b/heat/tests/db/test_sqlalchemy_filters.py index 93a9cb4a5c..e3424aee78 100644 --- a/heat/tests/db/test_sqlalchemy_filters.py +++ b/heat/tests/db/test_sqlalchemy_filters.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.db.sqlalchemy import filters as db_filters from heat.tests import common diff --git a/heat/tests/engine/service/test_service_engine.py b/heat/tests/engine/service/test_service_engine.py index 421c2e3598..cdda530976 100644 --- a/heat/tests/engine/service/test_service_engine.py +++ b/heat/tests/engine/service/test_service_engine.py @@ -12,8 +12,8 @@ # under the License. import datetime +from unittest import mock -import mock from oslo_config import cfg from oslo_utils import timeutils diff --git a/heat/tests/engine/service/test_software_config.py b/heat/tests/engine/service/test_software_config.py index 83657adf36..ecd7bef624 100644 --- a/heat/tests/engine/service/test_software_config.py +++ b/heat/tests/engine/service/test_software_config.py @@ -12,9 +12,9 @@ # under the License. import datetime +from unittest import mock import uuid -import mock from oslo_messaging.rpc import dispatcher from oslo_serialization import jsonutils as json from oslo_utils import timeutils diff --git a/heat/tests/engine/service/test_stack_action.py b/heat/tests/engine/service/test_stack_action.py index ccec6bcacc..48a704b676 100644 --- a/heat/tests/engine/service/test_stack_action.py +++ b/heat/tests/engine/service/test_stack_action.py @@ -10,7 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_messaging.rpc import dispatcher from heat.common import exception diff --git a/heat/tests/engine/service/test_stack_adopt.py b/heat/tests/engine/service/test_stack_adopt.py index 4421b6d30b..acdb6c2532 100644 --- a/heat/tests/engine/service/test_stack_adopt.py +++ b/heat/tests/engine/service/test_stack_adopt.py @@ -11,7 +11,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_messaging.rpc import dispatcher diff --git a/heat/tests/engine/service/test_stack_create.py b/heat/tests/engine/service/test_stack_create.py index 428540e5bc..ad55a270f7 100644 --- a/heat/tests/engine/service/test_stack_create.py +++ b/heat/tests/engine/service/test_stack_create.py @@ -11,7 +11,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_messaging.rpc import dispatcher from oslo_service import threadgroup diff --git a/heat/tests/engine/service/test_stack_delete.py b/heat/tests/engine/service/test_stack_delete.py index 8eb40f763e..1b34ee61c9 100644 --- a/heat/tests/engine/service/test_stack_delete.py +++ b/heat/tests/engine/service/test_stack_delete.py @@ -10,7 +10,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_messaging.rpc import dispatcher from oslo_utils import timeutils diff --git a/heat/tests/engine/service/test_stack_events.py b/heat/tests/engine/service/test_stack_events.py index fa0e8e1d18..a1da41582e 100644 --- a/heat/tests/engine/service/test_stack_events.py +++ b/heat/tests/engine/service/test_stack_events.py @@ -11,7 +11,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_messaging import conffixture diff --git a/heat/tests/engine/service/test_stack_resources.py b/heat/tests/engine/service/test_stack_resources.py index c432a0cff5..ce97bafab9 100644 --- a/heat/tests/engine/service/test_stack_resources.py +++ b/heat/tests/engine/service/test_stack_resources.py @@ -10,7 +10,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_messaging.rpc import dispatcher diff --git a/heat/tests/engine/service/test_stack_snapshot.py b/heat/tests/engine/service/test_stack_snapshot.py index 058738e3dc..79e8b05b96 100644 --- a/heat/tests/engine/service/test_stack_snapshot.py +++ b/heat/tests/engine/service/test_stack_snapshot.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid -import mock from oslo_messaging.rpc import dispatcher from heat.common import exception diff --git a/heat/tests/engine/service/test_stack_update.py b/heat/tests/engine/service/test_stack_update.py index cf005b6bbb..17aaabb8b7 100644 --- a/heat/tests/engine/service/test_stack_update.py +++ b/heat/tests/engine/service/test_stack_update.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid import eventlet.queue -import mock from oslo_config import cfg from oslo_messaging import conffixture from oslo_messaging.rpc import dispatcher diff --git a/heat/tests/engine/service/test_threadgroup_mgr.py b/heat/tests/engine/service/test_threadgroup_mgr.py index b66e96170b..6df892e138 100644 --- a/heat/tests/engine/service/test_threadgroup_mgr.py +++ b/heat/tests/engine/service/test_threadgroup_mgr.py @@ -11,9 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. -import eventlet -import mock +from unittest import mock +import eventlet from oslo_context import context from heat.engine import service diff --git a/heat/tests/engine/test_check_resource.py b/heat/tests/engine/test_check_resource.py index 486c15ea77..b0544bacd3 100644 --- a/heat/tests/engine/test_check_resource.py +++ b/heat/tests/engine/test_check_resource.py @@ -13,10 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import eventlet -import mock +from unittest import mock import uuid +import eventlet from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/engine/test_engine_worker.py b/heat/tests/engine/test_engine_worker.py index bdde6c8be6..0eed84fb09 100644 --- a/heat/tests/engine/test_engine_worker.py +++ b/heat/tests/engine/test_engine_worker.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 heat.db.sqlalchemy import api as db_api from heat.engine import check_resource diff --git a/heat/tests/engine/test_resource_type.py b/heat/tests/engine/test_resource_type.py index db3023bc15..ae771ebd41 100644 --- a/heat/tests/engine/test_resource_type.py +++ b/heat/tests/engine/test_resource_type.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.engine import environment diff --git a/heat/tests/engine/test_scheduler.py b/heat/tests/engine/test_scheduler.py index edb20f97cb..1caa338a08 100644 --- a/heat/tests/engine/test_scheduler.py +++ b/heat/tests/engine/test_scheduler.py @@ -12,10 +12,15 @@ # under the License. import contextlib -import itertools +from unittest import mock import eventlet +<<<<<<< HEAD import mock +======= +import itertools +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import timeutils from heat.engine import dependencies diff --git a/heat/tests/engine/test_sync_point.py b/heat/tests/engine/test_sync_point.py index cbe03d1641..d424160c82 100644 --- a/heat/tests/engine/test_sync_point.py +++ b/heat/tests/engine/test_sync_point.py @@ -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_db import exception from heat.engine import sync_point diff --git a/heat/tests/fakes.py b/heat/tests/fakes.py index c157440a15..b2cb29df51 100644 --- a/heat/tests/fakes.py +++ b/heat/tests/fakes.py @@ -18,8 +18,9 @@ wrong the tests might raise AssertionError. I've indicated in comments the places where actual behavior differs from the spec. """ +from unittest import mock + from keystoneauth1 import plugin -import mock class FakeClient(object): diff --git a/heat/tests/openstack/aodh/test_alarm.py b/heat/tests/openstack/aodh/test_alarm.py index 9197dd5a2d..bfedfdc0b9 100644 --- a/heat/tests/openstack/aodh/test_alarm.py +++ b/heat/tests/openstack/aodh/test_alarm.py @@ -14,8 +14,13 @@ import copy import json +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/aodh/test_composite_alarm.py b/heat/tests/openstack/aodh/test_composite_alarm.py index 6afdb9efb3..65269cd2e7 100644 --- a/heat/tests/openstack/aodh/test_composite_alarm.py +++ b/heat/tests/openstack/aodh/test_composite_alarm.py @@ -12,8 +12,13 @@ # under the License. import copy +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/aodh/test_gnocchi_alarm.py b/heat/tests/openstack/aodh/test_gnocchi_alarm.py index 1d554efbe1..2747b707bc 100644 --- a/heat/tests/openstack/aodh/test_gnocchi_alarm.py +++ b/heat/tests/openstack/aodh/test_gnocchi_alarm.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/barbican/test_container.py b/heat/tests/openstack/barbican/test_container.py index 1bf7ef5dfa..72b4508766 100644 --- a/heat/tests/openstack/barbican/test_container.py +++ b/heat/tests/openstack/barbican/test_container.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/barbican/test_order.py b/heat/tests/openstack/barbican/test_order.py index 8cac6b72f0..83154b3b22 100644 --- a/heat/tests/openstack/barbican/test_order.py +++ b/heat/tests/openstack/barbican/test_order.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/barbican/test_secret.py b/heat/tests/openstack/barbican/test_secret.py index ffcea6f8f5..673ef40daa 100644 --- a/heat/tests/openstack/barbican/test_secret.py +++ b/heat/tests/openstack/barbican/test_secret.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/blazar/test_host.py b/heat/tests/openstack/blazar/test_host.py index ab3d750a96..6021b6a8c5 100644 --- a/heat/tests/openstack/blazar/test_host.py +++ b/heat/tests/openstack/blazar/test_host.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from blazarclient import exception as client_exception -import mock from oslo_utils.fixture import uuidsentinel as uuids from heat.common import exception diff --git a/heat/tests/openstack/blazar/test_lease.py b/heat/tests/openstack/blazar/test_lease.py index 4991a14d21..00938e3a60 100644 --- a/heat/tests/openstack/blazar/test_lease.py +++ b/heat/tests/openstack/blazar/test_lease.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from blazarclient import exception as client_exception -import mock from oslo_utils.fixture import uuidsentinel as uuids from heat.common import exception diff --git a/heat/tests/openstack/cinder/test_qos_specs.py b/heat/tests/openstack/cinder/test_qos_specs.py index b77cd728f5..fc5178aa5b 100644 --- a/heat/tests/openstack/cinder/test_qos_specs.py +++ b/heat/tests/openstack/cinder/test_qos_specs.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os import cinder as c_plugin from heat.engine.resources.openstack.cinder import qos_specs diff --git a/heat/tests/openstack/cinder/test_quota.py b/heat/tests/openstack/cinder/test_quota.py index c1b1213ef7..eefad5ded5 100644 --- a/heat/tests/openstack/cinder/test_quota.py +++ b/heat/tests/openstack/cinder/test_quota.py @@ -10,7 +10,13 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/cinder/test_volume.py b/heat/tests/openstack/cinder/test_volume.py index 2d4e302b7c..6a2cc5ea93 100644 --- a/heat/tests/openstack/cinder/test_volume.py +++ b/heat/tests/openstack/cinder/test_volume.py @@ -14,9 +14,9 @@ import collections import copy import json +from unittest import mock from cinderclient import exceptions as cinder_exp -import mock from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/cinder/test_volume_type.py b/heat/tests/openstack/cinder/test_volume_type.py index e8d904c51c..93706dd4ca 100644 --- a/heat/tests/openstack/cinder/test_volume_type.py +++ b/heat/tests/openstack/cinder/test_volume_type.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. import collections +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.engine.clients.os import cinder as c_plugin diff --git a/heat/tests/openstack/cinder/test_volume_type_encryption.py b/heat/tests/openstack/cinder/test_volume_type_encryption.py index 08815b7bc6..563c35aa4d 100644 --- a/heat/tests/openstack/cinder/test_volume_type_encryption.py +++ b/heat/tests/openstack/cinder/test_volume_type_encryption.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.engine.clients.os import cinder as c_plugin diff --git a/heat/tests/openstack/cinder/test_volume_utils.py b/heat/tests/openstack/cinder/test_volume_utils.py index 376bb84dd4..e9bf6cbaf6 100644 --- a/heat/tests/openstack/cinder/test_volume_utils.py +++ b/heat/tests/openstack/cinder/test_volume_utils.py @@ -11,8 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from cinderclient.v2 import client as cinderclient +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.engine.clients.os import cinder from heat.engine.clients.os import nova diff --git a/heat/tests/openstack/designate/test_recordset.py b/heat/tests/openstack/designate/test_recordset.py index c2166ed91a..53d56fba3b 100644 --- a/heat/tests/openstack/designate/test_recordset.py +++ b/heat/tests/openstack/designate/test_recordset.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from designateclient import exceptions as designate_exception -import mock from heat.common import exception from heat.engine.resources.openstack.designate import recordset diff --git a/heat/tests/openstack/designate/test_zone.py b/heat/tests/openstack/designate/test_zone.py index 8f5a0288ce..7956ce13f6 100644 --- a/heat/tests/openstack/designate/test_zone.py +++ b/heat/tests/openstack/designate/test_zone.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.engine.resources.openstack.designate import zone diff --git a/heat/tests/openstack/glance/test_image.py b/heat/tests/openstack/glance/test_image.py index 73f47a81a0..276cfede91 100644 --- a/heat/tests/openstack/glance/test_image.py +++ b/heat/tests/openstack/glance/test_image.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from glanceclient import exc from heat.common import exception diff --git a/heat/tests/openstack/heat/test_cloud_config.py b/heat/tests/openstack/heat/test_cloud_config.py index 9f740da5b1..90fc7fbfe1 100644 --- a/heat/tests/openstack/heat/test_cloud_config.py +++ b/heat/tests/openstack/heat/test_cloud_config.py @@ -11,10 +11,10 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid import yaml -import mock from heat.engine import stack from heat.engine import template diff --git a/heat/tests/openstack/heat/test_deployed_server.py b/heat/tests/openstack/heat/test_deployed_server.py index 86761e6b67..ba459c12b5 100644 --- a/heat/tests/openstack/heat/test_deployed_server.py +++ b/heat/tests/openstack/heat/test_deployed_server.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from oslo_serialization import jsonutils from oslo_utils import uuidutils diff --git a/heat/tests/openstack/heat/test_instance_group.py b/heat/tests/openstack/heat/test_instance_group.py index 45e3b5c1cf..99e49e0bf3 100644 --- a/heat/tests/openstack/heat/test_instance_group.py +++ b/heat/tests/openstack/heat/test_instance_group.py @@ -12,8 +12,13 @@ # under the License. import copy +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import grouputils diff --git a/heat/tests/openstack/heat/test_instance_group_update_policy.py b/heat/tests/openstack/heat/test_instance_group_update_policy.py index 9ece3aa285..759b20e5e7 100644 --- a/heat/tests/openstack/heat/test_instance_group_update_policy.py +++ b/heat/tests/openstack/heat/test_instance_group_update_policy.py @@ -12,8 +12,8 @@ # under the License. import json +from unittest import mock -import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/heat/test_multi_part.py b/heat/tests/openstack/heat/test_multi_part.py index 3d2b244c82..ad8d676c13 100644 --- a/heat/tests/openstack/heat/test_multi_part.py +++ b/heat/tests/openstack/heat/test_multi_part.py @@ -13,10 +13,9 @@ import contextlib import email +from unittest import mock import uuid -import mock - from heat.common import exception as exc from heat.engine import stack as parser from heat.engine import template diff --git a/heat/tests/openstack/heat/test_none_resource.py b/heat/tests/openstack/heat/test_none_resource.py index 13370ebaf6..7344b36e5d 100644 --- a/heat/tests/openstack/heat/test_none_resource.py +++ b/heat/tests/openstack/heat/test_none_resource.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import template_format from heat.engine import resource diff --git a/heat/tests/openstack/heat/test_random_string.py b/heat/tests/openstack/heat/test_random_string.py index 3eeb8c45cf..7a06fdd916 100644 --- a/heat/tests/openstack/heat/test_random_string.py +++ b/heat/tests/openstack/heat/test_random_string.py @@ -12,8 +12,13 @@ # under the License. import re +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from testtools import matchers from heat.common import exception diff --git a/heat/tests/openstack/heat/test_remote_stack.py b/heat/tests/openstack/heat/test_remote_stack.py index 02768cf8c3..b5df410a2a 100644 --- a/heat/tests/openstack/heat/test_remote_stack.py +++ b/heat/tests/openstack/heat/test_remote_stack.py @@ -13,11 +13,11 @@ import collections import json +from unittest import mock from heatclient import exc from heatclient.v1 import stacks from keystoneauth1 import loading as ks_loading -import mock from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/heat/test_resource_chain.py b/heat/tests/openstack/heat/test_resource_chain.py index 2ec1f54639..ad4d58d95c 100644 --- a/heat/tests/openstack/heat/test_resource_chain.py +++ b/heat/tests/openstack/heat/test_resource_chain.py @@ -12,7 +12,13 @@ # under the License. import copy +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.engine import node_data diff --git a/heat/tests/openstack/heat/test_resource_group.py b/heat/tests/openstack/heat/test_resource_group.py index bd39bc1ad1..c4a783bd09 100644 --- a/heat/tests/openstack/heat/test_resource_group.py +++ b/heat/tests/openstack/heat/test_resource_group.py @@ -12,8 +12,13 @@ # under the License. import copy +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import grouputils diff --git a/heat/tests/openstack/heat/test_software_component.py b/heat/tests/openstack/heat/test_software_component.py index 5e0842c401..bac28c771c 100644 --- a/heat/tests/openstack/heat/test_software_component.py +++ b/heat/tests/openstack/heat/test_software_component.py @@ -12,7 +12,13 @@ # under the License. import contextlib +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception as exc from heat.common import template_format diff --git a/heat/tests/openstack/heat/test_software_config.py b/heat/tests/openstack/heat/test_software_config.py index 0ac5b643e6..f194ec7355 100644 --- a/heat/tests/openstack/heat/test_software_config.py +++ b/heat/tests/openstack/heat/test_software_config.py @@ -12,7 +12,7 @@ # under the License. import contextlib -import mock +from unittest import mock from heat.common import exception as exc from heat.engine import stack diff --git a/heat/tests/openstack/heat/test_software_deployment.py b/heat/tests/openstack/heat/test_software_deployment.py index b6f4349ca3..fecf6c92c4 100644 --- a/heat/tests/openstack/heat/test_software_deployment.py +++ b/heat/tests/openstack/heat/test_software_deployment.py @@ -14,11 +14,16 @@ import contextlib import copy import re +from unittest import mock import uuid +<<<<<<< HEAD import mock +======= +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from oslo_serialization import jsonutils +import six from heat.common import exception as exc from heat.common.i18n import _ diff --git a/heat/tests/openstack/heat/test_structured_config.py b/heat/tests/openstack/heat/test_structured_config.py index ba389c19f1..fa5c7511e8 100644 --- a/heat/tests/openstack/heat/test_structured_config.py +++ b/heat/tests/openstack/heat/test_structured_config.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.engine.resources.openstack.heat import structured_config as sc diff --git a/heat/tests/openstack/heat/test_swiftsignal.py b/heat/tests/openstack/heat/test_swiftsignal.py index c910d315a3..c3d2db0d64 100644 --- a/heat/tests/openstack/heat/test_swiftsignal.py +++ b/heat/tests/openstack/heat/test_swiftsignal.py @@ -13,9 +13,9 @@ import datetime import json +from unittest import mock import uuid -import mock from oslo_utils import timeutils from swiftclient import client as swiftclient_client from swiftclient import exceptions as swiftclient_exceptions diff --git a/heat/tests/openstack/heat/test_waitcondition.py b/heat/tests/openstack/heat/test_waitcondition.py index 930598e7cf..b3b17bb763 100644 --- a/heat/tests/openstack/heat/test_waitcondition.py +++ b/heat/tests/openstack/heat/test_waitcondition.py @@ -12,9 +12,9 @@ # under the License. import datetime +from unittest import mock import uuid -import mock from oslo_serialization import jsonutils as json from oslo_utils import timeutils diff --git a/heat/tests/openstack/keystone/test_domain.py b/heat/tests/openstack/keystone/test_domain.py index 1f6e45259a..204b092059 100644 --- a/heat/tests/openstack/keystone/test_domain.py +++ b/heat/tests/openstack/keystone/test_domain.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import resource diff --git a/heat/tests/openstack/keystone/test_endpoint.py b/heat/tests/openstack/keystone/test_endpoint.py index 9bcc8b4c61..9a53476a1a 100644 --- a/heat/tests/openstack/keystone/test_endpoint.py +++ b/heat/tests/openstack/keystone/test_endpoint.py @@ -12,8 +12,7 @@ # under the License. import copy - -import mock +from unittest import mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import constraints diff --git a/heat/tests/openstack/keystone/test_group.py b/heat/tests/openstack/keystone/test_group.py index 6803820305..01ecd9c93d 100644 --- a/heat/tests/openstack/keystone/test_group.py +++ b/heat/tests/openstack/keystone/test_group.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import constraints diff --git a/heat/tests/openstack/keystone/test_project.py b/heat/tests/openstack/keystone/test_project.py index 9b3c4ef63f..095251a297 100644 --- a/heat/tests/openstack/keystone/test_project.py +++ b/heat/tests/openstack/keystone/test_project.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine import constraints from heat.engine import properties diff --git a/heat/tests/openstack/keystone/test_region.py b/heat/tests/openstack/keystone/test_region.py index 0068c4ba26..5a963e8b68 100644 --- a/heat/tests/openstack/keystone/test_region.py +++ b/heat/tests/openstack/keystone/test_region.py @@ -11,8 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock from urllib import parse +======= +from unittest import mock + +from six.moves.urllib import parse +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import resource diff --git a/heat/tests/openstack/keystone/test_role.py b/heat/tests/openstack/keystone/test_role.py index df9eda1507..65fa0138a5 100644 --- a/heat/tests/openstack/keystone/test_role.py +++ b/heat/tests/openstack/keystone/test_role.py @@ -12,7 +12,7 @@ # under the License. import copy -import mock +from unittest import mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import resource diff --git a/heat/tests/openstack/keystone/test_role_assignments.py b/heat/tests/openstack/keystone/test_role_assignments.py index a2f2358667..116747778c 100644 --- a/heat/tests/openstack/keystone/test_role_assignments.py +++ b/heat/tests/openstack/keystone/test_role_assignments.py @@ -12,7 +12,7 @@ # under the License. import copy -import mock +from unittest import mock from heat.common import exception from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks diff --git a/heat/tests/openstack/keystone/test_service.py b/heat/tests/openstack/keystone/test_service.py index ba2a7e0add..2f773db2ad 100644 --- a/heat/tests/openstack/keystone/test_service.py +++ b/heat/tests/openstack/keystone/test_service.py @@ -12,8 +12,7 @@ # under the License. import copy - -import mock +from unittest import mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import properties diff --git a/heat/tests/openstack/keystone/test_user.py b/heat/tests/openstack/keystone/test_user.py index 7f67d5c34e..6f7dda8f21 100644 --- a/heat/tests/openstack/keystone/test_user.py +++ b/heat/tests/openstack/keystone/test_user.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks from heat.engine import resource diff --git a/heat/tests/openstack/magnum/test_bay.py b/heat/tests/openstack/magnum/test_bay.py index f6102728c4..66803e80e9 100644 --- a/heat/tests/openstack/magnum/test_bay.py +++ b/heat/tests/openstack/magnum/test_bay.py @@ -12,7 +12,8 @@ # under the License. import copy -import mock +from unittest import mock + from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/magnum/test_cluster.py b/heat/tests/openstack/magnum/test_cluster.py index c0c7be8298..4bc58aecba 100644 --- a/heat/tests/openstack/magnum/test_cluster.py +++ b/heat/tests/openstack/magnum/test_cluster.py @@ -12,7 +12,8 @@ # under the License. import copy -import mock +from unittest import mock + from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/magnum/test_cluster_template.py b/heat/tests/openstack/magnum/test_cluster_template.py index 7b1fc1e338..22d2aa31c7 100644 --- a/heat/tests/openstack/magnum/test_cluster_template.py +++ b/heat/tests/openstack/magnum/test_cluster_template.py @@ -12,7 +12,8 @@ # under the License. import copy -import mock +from unittest import mock + from neutronclient.neutron import v2_0 as neutronV20 from heat.common import exception diff --git a/heat/tests/openstack/manila/test_security_service.py b/heat/tests/openstack/manila/test_security_service.py index fe63d78230..26812dcdf2 100644 --- a/heat/tests/openstack/manila/test_security_service.py +++ b/heat/tests/openstack/manila/test_security_service.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/manila/test_share.py b/heat/tests/openstack/manila/test_share.py index 08c7de679b..b067c54100 100644 --- a/heat/tests/openstack/manila/test_share.py +++ b/heat/tests/openstack/manila/test_share.py @@ -12,8 +12,13 @@ # under the License. import collections import copy +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/manila/test_share_network.py b/heat/tests/openstack/manila/test_share_network.py index da723b35b5..e550137b9a 100644 --- a/heat/tests/openstack/manila/test_share_network.py +++ b/heat/tests/openstack/manila/test_share_network.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/manila/test_share_type.py b/heat/tests/openstack/manila/test_share_type.py index cf1032aad2..08a79c0408 100644 --- a/heat/tests/openstack/manila/test_share_type.py +++ b/heat/tests/openstack/manila/test_share_type.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from heat.common import template_format from heat.engine.resources.openstack.manila import share_type as mshare_type diff --git a/heat/tests/openstack/mistral/test_cron_trigger.py b/heat/tests/openstack/mistral/test_cron_trigger.py index 58c6a15d36..939452f611 100644 --- a/heat/tests/openstack/mistral/test_cron_trigger.py +++ b/heat/tests/openstack/mistral/test_cron_trigger.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/mistral/test_external_resource.py b/heat/tests/openstack/mistral/test_external_resource.py index 77032b8176..fd92440a8c 100644 --- a/heat/tests/openstack/mistral/test_external_resource.py +++ b/heat/tests/openstack/mistral/test_external_resource.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/mistral/test_workflow.py b/heat/tests/openstack/mistral/test_workflow.py index c311b5f567..8d32430227 100644 --- a/heat/tests/openstack/mistral/test_workflow.py +++ b/heat/tests/openstack/mistral/test_workflow.py @@ -11,12 +11,17 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import yaml from mistralclient.api import base as mistral_base from mistralclient.api.v2 import executions from oslo_serialization import jsonutils +import six from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/monasca/test_alarm_definition.py b/heat/tests/openstack/monasca/test_alarm_definition.py index f0ea7927cd..8dba8d04de 100644 --- a/heat/tests/openstack/monasca/test_alarm_definition.py +++ b/heat/tests/openstack/monasca/test_alarm_definition.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os import monasca as client_plugin from heat.engine.resources.openstack.monasca import alarm_definition diff --git a/heat/tests/openstack/monasca/test_notification.py b/heat/tests/openstack/monasca/test_notification.py index 7f2b511ae0..1d61477a69 100644 --- a/heat/tests/openstack/monasca/test_notification.py +++ b/heat/tests/openstack/monasca/test_notification.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.engine.cfn import functions as cfn_funcs diff --git a/heat/tests/openstack/neutron/lbaas/test_health_monitor.py b/heat/tests/openstack/neutron/lbaas/test_health_monitor.py index bed3e2b459..4f0fd64a21 100644 --- a/heat/tests/openstack/neutron/lbaas/test_health_monitor.py +++ b/heat/tests/openstack/neutron/lbaas/test_health_monitor.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/lbaas/test_l7policy.py b/heat/tests/openstack/neutron/lbaas/test_l7policy.py index 95ab88779f..e5b9de1559 100644 --- a/heat/tests/openstack/neutron/lbaas/test_l7policy.py +++ b/heat/tests/openstack/neutron/lbaas/test_l7policy.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/lbaas/test_l7rule.py b/heat/tests/openstack/neutron/lbaas/test_l7rule.py index 258343ffc6..b6103a966b 100644 --- a/heat/tests/openstack/neutron/lbaas/test_l7rule.py +++ b/heat/tests/openstack/neutron/lbaas/test_l7rule.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/lbaas/test_listener.py b/heat/tests/openstack/neutron/lbaas/test_listener.py index 0b5887e8e9..c7aa118fca 100644 --- a/heat/tests/openstack/neutron/lbaas/test_listener.py +++ b/heat/tests/openstack/neutron/lbaas/test_listener.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/lbaas/test_loadbalancer.py b/heat/tests/openstack/neutron/lbaas/test_loadbalancer.py index 24bb7047da..bc38d1aaf1 100644 --- a/heat/tests/openstack/neutron/lbaas/test_loadbalancer.py +++ b/heat/tests/openstack/neutron/lbaas/test_loadbalancer.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/lbaas/test_pool.py b/heat/tests/openstack/neutron/lbaas/test_pool.py index b71c25bc83..debd5523fd 100644 --- a/heat/tests/openstack/neutron/lbaas/test_pool.py +++ b/heat/tests/openstack/neutron/lbaas/test_pool.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/lbaas/test_pool_member.py b/heat/tests/openstack/neutron/lbaas/test_pool_member.py index d6c6c0af3e..3138c2527f 100644 --- a/heat/tests/openstack/neutron/lbaas/test_pool_member.py +++ b/heat/tests/openstack/neutron/lbaas/test_pool_member.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/test_address_scope.py b/heat/tests/openstack/neutron/test_address_scope.py index 1473501c51..82d7df97ce 100644 --- a/heat/tests/openstack/neutron/test_address_scope.py +++ b/heat/tests/openstack/neutron/test_address_scope.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import template_format from heat.engine.clients.os import neutron diff --git a/heat/tests/openstack/neutron/test_extraroute.py b/heat/tests/openstack/neutron/test_extraroute.py index 8ab5ac3531..6ef33a0f29 100644 --- a/heat/tests/openstack/neutron/test_extraroute.py +++ b/heat/tests/openstack/neutron/test_extraroute.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_firewall.py b/heat/tests/openstack/neutron/test_neutron_firewall.py index ded9afdf11..b2b288bb99 100644 --- a/heat/tests/openstack/neutron/test_neutron_firewall.py +++ b/heat/tests/openstack/neutron/test_neutron_firewall.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from neutronclient.common import exceptions from neutronclient.v2_0 import client as neutronclient from oslo_config import cfg diff --git a/heat/tests/openstack/neutron/test_neutron_floating_ip.py b/heat/tests/openstack/neutron/test_neutron_floating_ip.py index dc2ebac63c..59f54147b0 100644 --- a/heat/tests/openstack/neutron/test_neutron_floating_ip.py +++ b/heat/tests/openstack/neutron/test_neutron_floating_ip.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from neutronclient.common import exceptions as qe from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_l2_gateway.py b/heat/tests/openstack/neutron/test_neutron_l2_gateway.py index fc64584da9..c711bc9d62 100644 --- a/heat/tests/openstack/neutron/test_neutron_l2_gateway.py +++ b/heat/tests/openstack/neutron/test_neutron_l2_gateway.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from neutronclient.common import exceptions from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_l2_gateway_connection.py b/heat/tests/openstack/neutron/test_neutron_l2_gateway_connection.py index b040281d32..6fecffd1ba 100644 --- a/heat/tests/openstack/neutron/test_neutron_l2_gateway_connection.py +++ b/heat/tests/openstack/neutron/test_neutron_l2_gateway_connection.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from neutronclient.v2_0 import client as neutronclient from heat.common import template_format diff --git a/heat/tests/openstack/neutron/test_neutron_loadbalancer.py b/heat/tests/openstack/neutron/test_neutron_loadbalancer.py index 4670072f53..388c8056e3 100644 --- a/heat/tests/openstack/neutron/test_neutron_loadbalancer.py +++ b/heat/tests/openstack/neutron/test_neutron_loadbalancer.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from neutronclient.common import exceptions from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_metering.py b/heat/tests/openstack/neutron/test_neutron_metering.py index 6363e50a6f..9318b04eda 100644 --- a/heat/tests/openstack/neutron/test_neutron_metering.py +++ b/heat/tests/openstack/neutron/test_neutron_metering.py @@ -11,10 +11,15 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from neutronclient.common import exceptions from neutronclient.v2_0 import client as neutronclient +import six from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/neutron/test_neutron_network_gateway.py b/heat/tests/openstack/neutron/test_neutron_network_gateway.py index feea90afac..fa01414c47 100644 --- a/heat/tests/openstack/neutron/test_neutron_network_gateway.py +++ b/heat/tests/openstack/neutron/test_neutron_network_gateway.py @@ -14,11 +14,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from neutronclient.common import exceptions as qe from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient +import six from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/neutron/test_neutron_port.py b/heat/tests/openstack/neutron/test_neutron_port.py index 228273cdea..4af5d54e1a 100644 --- a/heat/tests/openstack/neutron/test_neutron_port.py +++ b/heat/tests/openstack/neutron/test_neutron_port.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from neutronclient.common import exceptions as qe from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_provider_net.py b/heat/tests/openstack/neutron/test_neutron_provider_net.py index 3d95714ed3..a528c4d4da 100644 --- a/heat/tests/openstack/neutron/test_neutron_provider_net.py +++ b/heat/tests/openstack/neutron/test_neutron_provider_net.py @@ -12,7 +12,7 @@ # under the License. import copy -import mock +from unittest import mock from neutronclient.common import exceptions as qe from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_rbac_policy.py b/heat/tests/openstack/neutron/test_neutron_rbac_policy.py index 0ee21acf7a..765a4caa11 100644 --- a/heat/tests/openstack/neutron/test_neutron_rbac_policy.py +++ b/heat/tests/openstack/neutron/test_neutron_rbac_policy.py @@ -12,7 +12,7 @@ # under the License. -import mock +from unittest import mock import yaml from neutronclient.common import exceptions diff --git a/heat/tests/openstack/neutron/test_neutron_router.py b/heat/tests/openstack/neutron/test_neutron_router.py index 19b1281acf..442668a2b2 100644 --- a/heat/tests/openstack/neutron/test_neutron_router.py +++ b/heat/tests/openstack/neutron/test_neutron_router.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from neutronclient.common import exceptions as qe from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_security_group.py b/heat/tests/openstack/neutron/test_neutron_security_group.py index ea269aa224..28a931f51b 100644 --- a/heat/tests/openstack/neutron/test_neutron_security_group.py +++ b/heat/tests/openstack/neutron/test_neutron_security_group.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.common import exceptions as neutron_exc from neutronclient.neutron import v2_0 as neutronV20 diff --git a/heat/tests/openstack/neutron/test_neutron_security_group_rule.py b/heat/tests/openstack/neutron/test_neutron_security_group_rule.py index 407f5e9ce8..49b4276344 100644 --- a/heat/tests/openstack/neutron/test_neutron_security_group_rule.py +++ b/heat/tests/openstack/neutron/test_neutron_security_group_rule.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/neutron/test_neutron_segment.py b/heat/tests/openstack/neutron/test_neutron_segment.py index 4d5a1917bb..fa00cf4c97 100644 --- a/heat/tests/openstack/neutron/test_neutron_segment.py +++ b/heat/tests/openstack/neutron/test_neutron_segment.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from neutronclient.neutron import v2_0 as neutronV20 from openstack import exceptions from oslo_utils import excutils diff --git a/heat/tests/openstack/neutron/test_neutron_subnet.py b/heat/tests/openstack/neutron/test_neutron_subnet.py index 1ce9209c43..a90e012302 100644 --- a/heat/tests/openstack/neutron/test_neutron_subnet.py +++ b/heat/tests/openstack/neutron/test_neutron_subnet.py @@ -12,7 +12,8 @@ # under the License. import copy -import mock +from unittest import mock + from neutronclient.common import exceptions as qe from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/neutron/test_neutron_vpnservice.py b/heat/tests/openstack/neutron/test_neutron_vpnservice.py index aa28c58f33..73c0f6c448 100644 --- a/heat/tests/openstack/neutron/test_neutron_vpnservice.py +++ b/heat/tests/openstack/neutron/test_neutron_vpnservice.py @@ -12,12 +12,17 @@ # under the License. import copy +<<<<<<< HEAD import mock +======= +from unittest import mock +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from neutronclient.common import exceptions from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient from oslo_config import cfg +import six from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/neutron/test_qos.py b/heat/tests/openstack/neutron/test_qos.py index b490638f53..d46eb64f48 100644 --- a/heat/tests/openstack/neutron/test_qos.py +++ b/heat/tests/openstack/neutron/test_qos.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import template_format from heat.engine.clients.os import neutron diff --git a/heat/tests/openstack/neutron/test_quota.py b/heat/tests/openstack/neutron/test_quota.py index e2765ee03b..1c96fb7ac1 100644 --- a/heat/tests/openstack/neutron/test_quota.py +++ b/heat/tests/openstack/neutron/test_quota.py @@ -10,7 +10,13 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/neutron/test_sfc/test_flow_classifier.py b/heat/tests/openstack/neutron/test_sfc/test_flow_classifier.py index 5f5113c77a..c4a0fd4e5d 100644 --- a/heat/tests/openstack/neutron/test_sfc/test_flow_classifier.py +++ b/heat/tests/openstack/neutron/test_sfc/test_flow_classifier.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.resources.openstack.neutron.sfc import flow_classifier from heat.engine import stack diff --git a/heat/tests/openstack/neutron/test_sfc/test_port_chain.py b/heat/tests/openstack/neutron/test_sfc/test_port_chain.py index bfa073cba6..233bb15495 100644 --- a/heat/tests/openstack/neutron/test_sfc/test_port_chain.py +++ b/heat/tests/openstack/neutron/test_sfc/test_port_chain.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os import neutron from heat.engine.resources.openstack.neutron.sfc import port_chain diff --git a/heat/tests/openstack/neutron/test_sfc/test_port_pair.py b/heat/tests/openstack/neutron/test_sfc/test_port_pair.py index 5bb9c7003d..bb4fbf8563 100644 --- a/heat/tests/openstack/neutron/test_sfc/test_port_pair.py +++ b/heat/tests/openstack/neutron/test_sfc/test_port_pair.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.resources.openstack.neutron.sfc import port_pair from heat.engine import stack diff --git a/heat/tests/openstack/neutron/test_sfc/test_port_pair_group.py b/heat/tests/openstack/neutron/test_sfc/test_port_pair_group.py index c1d73e228f..0b150aec8f 100644 --- a/heat/tests/openstack/neutron/test_sfc/test_port_pair_group.py +++ b/heat/tests/openstack/neutron/test_sfc/test_port_pair_group.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os import neutron from heat.engine.resources.openstack.neutron.sfc import port_pair_group diff --git a/heat/tests/openstack/neutron/test_taas/test_tap_flow.py b/heat/tests/openstack/neutron/test_taas/test_tap_flow.py index 7cf0095c48..ffff2fa59f 100644 --- a/heat/tests/openstack/neutron/test_taas/test_tap_flow.py +++ b/heat/tests/openstack/neutron/test_taas/test_tap_flow.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.resources.openstack.neutron.taas import tap_flow from heat.engine import stack diff --git a/heat/tests/openstack/neutron/test_taas/test_tap_service.py b/heat/tests/openstack/neutron/test_taas/test_tap_service.py index 03fb3e5cf7..322c910b65 100644 --- a/heat/tests/openstack/neutron/test_taas/test_tap_service.py +++ b/heat/tests/openstack/neutron/test_taas/test_tap_service.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.resources.openstack.neutron.taas import tap_service from heat.engine import stack diff --git a/heat/tests/openstack/nova/fakes.py b/heat/tests/openstack/nova/fakes.py index 17628a985d..115a9910eb 100644 --- a/heat/tests/openstack/nova/fakes.py +++ b/heat/tests/openstack/nova/fakes.py @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + from novaclient import client as base_client from novaclient import exceptions as nova_exceptions import requests @@ -22,7 +23,6 @@ from urllib import parse as urlparse from heat.tests import fakes - NOVA_API_VERSION = "2.1" Client = base_client.Client(NOVA_API_VERSION).__class__ diff --git a/heat/tests/openstack/nova/test_flavor.py b/heat/tests/openstack/nova/test_flavor.py index 1f6afcfdfb..ffb8334dab 100644 --- a/heat/tests/openstack/nova/test_flavor.py +++ b/heat/tests/openstack/nova/test_flavor.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine import stack from heat.engine import template diff --git a/heat/tests/openstack/nova/test_floatingip.py b/heat/tests/openstack/nova/test_floatingip.py index afbdde0242..e747ce2248 100644 --- a/heat/tests/openstack/nova/test_floatingip.py +++ b/heat/tests/openstack/nova/test_floatingip.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from neutronclient.v2_0 import client as neutronclient from heat.common import exception as heat_ex diff --git a/heat/tests/openstack/nova/test_host_aggregate.py b/heat/tests/openstack/nova/test_host_aggregate.py index 676f5e5c4f..bb0fbd9447 100644 --- a/heat/tests/openstack/nova/test_host_aggregate.py +++ b/heat/tests/openstack/nova/test_host_aggregate.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.engine.clients.os import nova from heat.engine import stack diff --git a/heat/tests/openstack/nova/test_keypair.py b/heat/tests/openstack/nova/test_keypair.py index 4c2a3c7ecf..68bfd002d6 100644 --- a/heat/tests/openstack/nova/test_keypair.py +++ b/heat/tests/openstack/nova/test_keypair.py @@ -12,8 +12,13 @@ # under the License. import copy +from unittest import mock +<<<<<<< HEAD import mock +======= +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.engine.clients.os import keystone diff --git a/heat/tests/openstack/nova/test_quota.py b/heat/tests/openstack/nova/test_quota.py index 2c275904ec..6cec19e0b5 100644 --- a/heat/tests/openstack/nova/test_quota.py +++ b/heat/tests/openstack/nova/test_quota.py @@ -10,7 +10,13 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/nova/test_server.py b/heat/tests/openstack/nova/test_server.py index e90d5f4f98..6f841165d9 100644 --- a/heat/tests/openstack/nova/test_server.py +++ b/heat/tests/openstack/nova/test_server.py @@ -14,7 +14,7 @@ import collections import contextlib import copy -import mock +from unittest import mock from keystoneauth1 import exceptions as ks_exceptions from neutronclient.v2_0 import client as neutronclient diff --git a/heat/tests/openstack/nova/test_server_group.py b/heat/tests/openstack/nova/test_server_group.py index 6a2e8bed55..0a1e682e0f 100644 --- a/heat/tests/openstack/nova/test_server_group.py +++ b/heat/tests/openstack/nova/test_server_group.py @@ -12,8 +12,7 @@ # under the License. import json - -import mock +from unittest import mock from heat.common import template_format from heat.engine import scheduler diff --git a/heat/tests/openstack/octavia/test_flavor.py b/heat/tests/openstack/octavia/test_flavor.py index 556b9d31fa..3d5b9537d7 100644 --- a/heat/tests/openstack/octavia/test_flavor.py +++ b/heat/tests/openstack/octavia/test_flavor.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import template_format from heat.tests import common diff --git a/heat/tests/openstack/octavia/test_flavor_profile.py b/heat/tests/openstack/octavia/test_flavor_profile.py index 0452e9639c..4c0646a33e 100644 --- a/heat/tests/openstack/octavia/test_flavor_profile.py +++ b/heat/tests/openstack/octavia/test_flavor_profile.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import template_format from heat.tests import common diff --git a/heat/tests/openstack/octavia/test_health_monitor.py b/heat/tests/openstack/octavia/test_health_monitor.py index 8804738815..bbc4c3e189 100644 --- a/heat/tests/openstack/octavia/test_health_monitor.py +++ b/heat/tests/openstack/octavia/test_health_monitor.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_l7policy.py b/heat/tests/openstack/octavia/test_l7policy.py index c66eff0435..0628a94e5f 100644 --- a/heat/tests/openstack/octavia/test_l7policy.py +++ b/heat/tests/openstack/octavia/test_l7policy.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_l7rule.py b/heat/tests/openstack/octavia/test_l7rule.py index 2d46d6fca1..e5d1eb6b42 100644 --- a/heat/tests/openstack/octavia/test_l7rule.py +++ b/heat/tests/openstack/octavia/test_l7rule.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_listener.py b/heat/tests/openstack/octavia/test_listener.py index a126ec98a4..bfafe29b16 100644 --- a/heat/tests/openstack/octavia/test_listener.py +++ b/heat/tests/openstack/octavia/test_listener.py @@ -12,7 +12,7 @@ # under the License. -import mock +from unittest import mock import yaml from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_loadbalancer.py b/heat/tests/openstack/octavia/test_loadbalancer.py index 56e527ab08..a93dda3f43 100644 --- a/heat/tests/openstack/octavia/test_loadbalancer.py +++ b/heat/tests/openstack/octavia/test_loadbalancer.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.neutron import v2_0 as neutronV20 from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_pool.py b/heat/tests/openstack/octavia/test_pool.py index 34b3e31e82..1192d53d76 100644 --- a/heat/tests/openstack/octavia/test_pool.py +++ b/heat/tests/openstack/octavia/test_pool.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_pool_member.py b/heat/tests/openstack/octavia/test_pool_member.py index a75b3e8081..07ce9f0755 100644 --- a/heat/tests/openstack/octavia/test_pool_member.py +++ b/heat/tests/openstack/octavia/test_pool_member.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from neutronclient.neutron import v2_0 as neutronV20 from osc_lib import exceptions diff --git a/heat/tests/openstack/octavia/test_quota.py b/heat/tests/openstack/octavia/test_quota.py index 5d440c88d0..390ff30836 100644 --- a/heat/tests/openstack/octavia/test_quota.py +++ b/heat/tests/openstack/octavia/test_quota.py @@ -10,7 +10,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 + import six from heat.common import exception diff --git a/heat/tests/openstack/sahara/test_cluster.py b/heat/tests/openstack/sahara/test_cluster.py index 221dbf630d..d137984e9a 100644 --- a/heat/tests/openstack/sahara/test_cluster.py +++ b/heat/tests/openstack/sahara/test_cluster.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_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/sahara/test_data_source.py b/heat/tests/openstack/sahara/test_data_source.py index b563dbd9b6..a91399cd46 100644 --- a/heat/tests/openstack/sahara/test_data_source.py +++ b/heat/tests/openstack/sahara/test_data_source.py @@ -12,7 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/sahara/test_image.py b/heat/tests/openstack/sahara/test_image.py index 5da7a17ebc..a7b00d8964 100644 --- a/heat/tests/openstack/sahara/test_image.py +++ b/heat/tests/openstack/sahara/test_image.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from heat.common import template_format from heat.engine.clients.os import glance diff --git a/heat/tests/openstack/sahara/test_job.py b/heat/tests/openstack/sahara/test_job.py index 0566b8f453..4d8234b185 100644 --- a/heat/tests/openstack/sahara/test_job.py +++ b/heat/tests/openstack/sahara/test_job.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from heat.common import template_format from heat.engine.clients.os import sahara diff --git a/heat/tests/openstack/sahara/test_job_binary.py b/heat/tests/openstack/sahara/test_job_binary.py index 12d54d67ad..27da2f758e 100644 --- a/heat/tests/openstack/sahara/test_job_binary.py +++ b/heat/tests/openstack/sahara/test_job_binary.py @@ -12,7 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/sahara/test_templates.py b/heat/tests/openstack/sahara/test_templates.py index 2a43bde637..1c1a40a4fd 100644 --- a/heat/tests/openstack/sahara/test_templates.py +++ b/heat/tests/openstack/sahara/test_templates.py @@ -13,7 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/senlin/test_cluster.py b/heat/tests/openstack/senlin/test_cluster.py index 38a89c1604..32b39fb54c 100644 --- a/heat/tests/openstack/senlin/test_cluster.py +++ b/heat/tests/openstack/senlin/test_cluster.py @@ -14,7 +14,8 @@ # limitations under the License. import copy -import mock +from unittest import mock + from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/senlin/test_node.py b/heat/tests/openstack/senlin/test_node.py index 9ba233d013..108d737eaa 100644 --- a/heat/tests/openstack/senlin/test_node.py +++ b/heat/tests/openstack/senlin/test_node.py @@ -13,7 +13,8 @@ # limitations under the License. import copy -import mock +from unittest import mock + from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/openstack/senlin/test_policy.py b/heat/tests/openstack/senlin/test_policy.py index 05e0053136..5763cc561d 100644 --- a/heat/tests/openstack/senlin/test_policy.py +++ b/heat/tests/openstack/senlin/test_policy.py @@ -13,7 +13,7 @@ # limitations under the License. import copy -import mock +from unittest import mock from openstack.clustering.v1._proxy import Proxy from openstack import exceptions diff --git a/heat/tests/openstack/senlin/test_profile.py b/heat/tests/openstack/senlin/test_profile.py index 2a0001a9d3..c3eb6b869d 100644 --- a/heat/tests/openstack/senlin/test_profile.py +++ b/heat/tests/openstack/senlin/test_profile.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 heat.common import template_format from heat.engine.clients.os import senlin diff --git a/heat/tests/openstack/senlin/test_receiver.py b/heat/tests/openstack/senlin/test_receiver.py index 138de4c6b2..5685424b2d 100644 --- a/heat/tests/openstack/senlin/test_receiver.py +++ b/heat/tests/openstack/senlin/test_receiver.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from openstack import exceptions diff --git a/heat/tests/openstack/swift/test_container.py b/heat/tests/openstack/swift/test_container.py index deeb4dae38..6374dd0434 100644 --- a/heat/tests/openstack/swift/test_container.py +++ b/heat/tests/openstack/swift/test_container.py @@ -12,7 +12,13 @@ # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock import swiftclient.client as sc from heat.common import exception diff --git a/heat/tests/openstack/trove/test_cluster.py b/heat/tests/openstack/trove/test_cluster.py index b3cb0b3826..720178f257 100644 --- a/heat/tests/openstack/trove/test_cluster.py +++ b/heat/tests/openstack/trove/test_cluster.py @@ -12,7 +12,13 @@ # under the License. import copy +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from troveclient import exceptions as troveexc from heat.common import exception diff --git a/heat/tests/openstack/trove/test_instance.py b/heat/tests/openstack/trove/test_instance.py index c1ac2aac22..bc4d024d28 100644 --- a/heat/tests/openstack/trove/test_instance.py +++ b/heat/tests/openstack/trove/test_instance.py @@ -11,9 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid -import mock from oslo_config import cfg from troveclient import exceptions as troveexc from troveclient.v1 import users diff --git a/heat/tests/openstack/zaqar/test_queue.py b/heat/tests/openstack/zaqar/test_queue.py index e3c45e7447..00f7a93d50 100644 --- a/heat/tests/openstack/zaqar/test_queue.py +++ b/heat/tests/openstack/zaqar/test_queue.py @@ -11,9 +11,16 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock from urllib import parse as urlparse +======= +from unittest import mock + +import six +from six.moves.urllib import parse as urlparse +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import template_format from heat.engine.clients import client_plugin diff --git a/heat/tests/openstack/zaqar/test_subscription.py b/heat/tests/openstack/zaqar/test_subscription.py index 214ce9bb3e..1801775e94 100644 --- a/heat/tests/openstack/zaqar/test_subscription.py +++ b/heat/tests/openstack/zaqar/test_subscription.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/openstack/zun/test_container.py b/heat/tests/openstack/zun/test_container.py index 683a888c40..ea62546ad5 100644 --- a/heat/tests/openstack/zun/test_container.py +++ b/heat/tests/openstack/zun/test_container.py @@ -12,7 +12,13 @@ # under the License. import copy +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from oslo_config import cfg from zunclient import exceptions as zc_exc diff --git a/heat/tests/test_attributes.py b/heat/tests/test_attributes.py index 182e0cdef3..86fdb3e3c7 100644 --- a/heat/tests/test_attributes.py +++ b/heat/tests/test_attributes.py @@ -11,7 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +<<<<<<< HEAD import mock +======= +from unittest import mock + +import six +>>>>>>> f9b47ffef... Use unittest.mock instead of third party mock from heat.engine import attributes from heat.engine import resources diff --git a/heat/tests/test_auth_password.py b/heat/tests/test_auth_password.py index e1a207ab12..ee06d8b1e6 100644 --- a/heat/tests/test_auth_password.py +++ b/heat/tests/test_auth_password.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_exc -import mock from oslo_config import cfg import webob diff --git a/heat/tests/test_auth_url.py b/heat/tests/test_auth_url.py index 8a00e48cc0..e66c44424e 100644 --- a/heat/tests/test_auth_url.py +++ b/heat/tests/test_auth_url.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock import webob from webob import exc diff --git a/heat/tests/test_common_auth_plugin.py b/heat/tests/test_common_auth_plugin.py index 3321c5ed15..ac289b3f18 100644 --- a/heat/tests/test_common_auth_plugin.py +++ b/heat/tests/test_common_auth_plugin.py @@ -12,9 +12,10 @@ # under the License. import json +from unittest import mock + from keystoneauth1 import loading as ks_loading from keystoneauth1 import session -import mock from heat.common import auth_plugin from heat.common import config diff --git a/heat/tests/test_common_context.py b/heat/tests/test_common_context.py index 405eaf8696..01604c6652 100644 --- a/heat/tests/test_common_context.py +++ b/heat/tests/test_common_context.py @@ -13,9 +13,9 @@ # under the License. import os +from unittest import mock from keystoneauth1 import loading as ks_loading -import mock from oslo_config import cfg from oslo_config import fixture as config_fixture from oslo_middleware import request_id diff --git a/heat/tests/test_convg_stack.py b/heat/tests/test_convg_stack.py index 1d2476d0b7..0db119781e 100644 --- a/heat/tests/test_convg_stack.py +++ b/heat/tests/test_convg_stack.py @@ -11,7 +11,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 heat.common import template_format diff --git a/heat/tests/test_engine_api_utils.py b/heat/tests/test_engine_api_utils.py index b1f5db6e80..d7d4ea6eb8 100644 --- a/heat/tests/test_engine_api_utils.py +++ b/heat/tests/test_engine_api_utils.py @@ -13,9 +13,9 @@ import datetime as dt import json +from unittest import mock import uuid -import mock from oslo_utils import timeutils from heat.common import exception diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index 40ddb9b111..aa6b62818a 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -11,9 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid -import mock from oslo_config import cfg from oslo_messaging.rpc import dispatcher from oslo_serialization import jsonutils as json diff --git a/heat/tests/test_environment.py b/heat/tests/test_environment.py index 575d262e30..6de00dc9f7 100644 --- a/heat/tests/test_environment.py +++ b/heat/tests/test_environment.py @@ -13,9 +13,9 @@ import os.path import sys +from unittest import mock import fixtures -import mock from oslo_config import cfg from heat.common import environment_format diff --git a/heat/tests/test_environment_format.py b/heat/tests/test_environment_format.py index facc5d3a3e..55e1213e8c 100644 --- a/heat/tests/test_environment_format.py +++ b/heat/tests/test_environment_format.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import yaml from heat.common import environment_format diff --git a/heat/tests/test_event.py b/heat/tests/test_event.py index 2035be4c99..8d9a2521ba 100644 --- a/heat/tests/test_event.py +++ b/heat/tests/test_event.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_config import cfg import uuid diff --git a/heat/tests/test_exception.py b/heat/tests/test_exception.py index d36a3f6b57..eb2eb8ace9 100644 --- a/heat/tests/test_exception.py +++ b/heat/tests/test_exception.py @@ -15,8 +15,9 @@ # under the License. +from unittest import mock + import fixtures -import mock from heat.common import exception from heat.common.i18n import _ diff --git a/heat/tests/test_grouputils.py b/heat/tests/test_grouputils.py index 46908a6134..32ac5de7cb 100644 --- a/heat/tests/test_grouputils.py +++ b/heat/tests/test_grouputils.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import grouputils from heat.common import identifier diff --git a/heat/tests/test_hot.py b/heat/tests/test_hot.py index 03a7054d6f..6f0a0b495b 100644 --- a/heat/tests/test_hot.py +++ b/heat/tests/test_hot.py @@ -12,7 +12,7 @@ # under the License. import copy -import mock +from unittest import mock from heat.common import exception from heat.common import identifier diff --git a/heat/tests/test_lifecycle_plugin_utils.py b/heat/tests/test_lifecycle_plugin_utils.py index 352922b4ac..9d8f42bf4f 100644 --- a/heat/tests/test_lifecycle_plugin_utils.py +++ b/heat/tests/test_lifecycle_plugin_utils.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import lifecycle_plugin_utils from heat.engine import lifecycle_plugin diff --git a/heat/tests/test_loguserdata.py b/heat/tests/test_loguserdata.py index 85802ebdba..7bb17002ae 100644 --- a/heat/tests/test_loguserdata.py +++ b/heat/tests/test_loguserdata.py @@ -14,8 +14,8 @@ import errno import os import subprocess +from unittest import mock -import mock from heat.cloudinit import loguserdata from heat.tests import common diff --git a/heat/tests/test_metadata_refresh.py b/heat/tests/test_metadata_refresh.py index b638f3d366..da87ead4c5 100644 --- a/heat/tests/test_metadata_refresh.py +++ b/heat/tests/test_metadata_refresh.py @@ -10,7 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_serialization import jsonutils from heat.common import identifier diff --git a/heat/tests/test_nested_stack.py b/heat/tests/test_nested_stack.py index bd4f005d86..2fd71eecfa 100644 --- a/heat/tests/test_nested_stack.py +++ b/heat/tests/test_nested_stack.py @@ -12,7 +12,8 @@ # under the License. -import mock +from unittest import mock + from oslo_config import cfg from requests import exceptions import yaml diff --git a/heat/tests/test_notifications.py b/heat/tests/test_notifications.py index f909774ff0..e31575da7f 100644 --- a/heat/tests/test_notifications.py +++ b/heat/tests/test_notifications.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_utils import timeutils from heat.common import timeutils as heat_timeutils diff --git a/heat/tests/test_plugin_loader.py b/heat/tests/test_plugin_loader.py index e8cbe9b628..681e7b2e93 100644 --- a/heat/tests/test_plugin_loader.py +++ b/heat/tests/test_plugin_loader.py @@ -14,8 +14,7 @@ import pkgutil import sys - -import mock +from unittest import mock from heat.common import plugin_loader import heat.engine diff --git a/heat/tests/test_properties.py b/heat/tests/test_properties.py index dfc148980c..29647dcddf 100644 --- a/heat/tests/test_properties.py +++ b/heat/tests/test_properties.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_serialization import jsonutils from heat.common import exception diff --git a/heat/tests/test_provider_template.py b/heat/tests/test_provider_template.py index dbfee43149..360a1c3e69 100644 --- a/heat/tests/test_provider_template.py +++ b/heat/tests/test_provider_template.py @@ -14,10 +14,9 @@ import collections import json import os +from unittest import mock import uuid -import mock - from heat.common import exception from heat.common.i18n import _ from heat.common import identifier diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py index 41cd569307..3adf5c4289 100644 --- a/heat/tests/test_resource.py +++ b/heat/tests/test_resource.py @@ -13,14 +13,14 @@ import collections import datetime -import eventlet import itertools import json import os import sys +from unittest import mock import uuid -import mock +import eventlet from oslo_config import cfg from heat.common import exception diff --git a/heat/tests/test_rpc_client.py b/heat/tests/test_rpc_client.py index 7bf414216c..a5fded812f 100644 --- a/heat/tests/test_rpc_client.py +++ b/heat/tests/test_rpc_client.py @@ -18,8 +18,8 @@ Unit Tests for heat.rpc.client """ import copy +from unittest import mock -import mock from oslo_messaging._drivers import common as rpc_common from oslo_utils import reflection diff --git a/heat/tests/test_rpc_listener_client.py b/heat/tests/test_rpc_listener_client.py index fe10f33339..f753f9385f 100644 --- a/heat/tests/test_rpc_listener_client.py +++ b/heat/tests/test_rpc_listener_client.py @@ -11,7 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import oslo_messaging as messaging from heat.rpc import api as rpc_api diff --git a/heat/tests/test_rpc_worker_client.py b/heat/tests/test_rpc_worker_client.py index 730e189a20..af1de7fb14 100644 --- a/heat/tests/test_rpc_worker_client.py +++ b/heat/tests/test_rpc_worker_client.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 heat.rpc import worker_api as rpc_api from heat.rpc import worker_client as rpc_client diff --git a/heat/tests/test_server_tags.py b/heat/tests/test_server_tags.py index 2d484b160d..d231022273 100644 --- a/heat/tests/test_server_tags.py +++ b/heat/tests/test_server_tags.py @@ -11,10 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock import uuid -import mock - from heat.common import template_format from heat.engine.clients.os import glance from heat.engine.clients.os import nova diff --git a/heat/tests/test_signal.py b/heat/tests/test_signal.py index ff3470628e..e55ece0a2b 100644 --- a/heat/tests/test_signal.py +++ b/heat/tests/test_signal.py @@ -12,9 +12,9 @@ # under the License. import datetime +from unittest import mock from keystoneauth1 import exceptions as kc_exceptions -import mock from urllib import parse as urlparse from heat.common import exception diff --git a/heat/tests/test_stack.py b/heat/tests/test_stack.py index 2180491c5f..0e8a0b4e44 100644 --- a/heat/tests/test_stack.py +++ b/heat/tests/test_stack.py @@ -17,10 +17,10 @@ import datetime import json import logging import time +from unittest import mock import eventlet import fixtures -import mock from oslo_config import cfg from heat.common import context diff --git a/heat/tests/test_stack_delete.py b/heat/tests/test_stack_delete.py index 6b07ce0b24..51fb26a0ce 100644 --- a/heat/tests/test_stack_delete.py +++ b/heat/tests/test_stack_delete.py @@ -13,10 +13,10 @@ import copy import time +from unittest import mock import fixtures from keystoneauth1 import exceptions as kc_exceptions -import mock from oslo_log import log as logging from heat.common import exception diff --git a/heat/tests/test_stack_lock.py b/heat/tests/test_stack_lock.py index 272e689a00..7ea41c398e 100644 --- a/heat/tests/test_stack_lock.py +++ b/heat/tests/test_stack_lock.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from heat.common import exception from heat.common import service_utils diff --git a/heat/tests/test_stack_resource.py b/heat/tests/test_stack_resource.py index 3a305422c9..f10f0a3472 100644 --- a/heat/tests/test_stack_resource.py +++ b/heat/tests/test_stack_resource.py @@ -13,9 +13,9 @@ import contextlib import json +from unittest import mock import uuid -import mock from oslo_config import cfg from oslo_messaging import exceptions as msg_exceptions from oslo_serialization import jsonutils diff --git a/heat/tests/test_stack_update.py b/heat/tests/test_stack_update.py index 2fe3243c15..90a6698815 100644 --- a/heat/tests/test_stack_update.py +++ b/heat/tests/test_stack_update.py @@ -12,8 +12,8 @@ # under the License. import copy +from unittest import mock -import mock from heat.common import exception from heat.common import template_format diff --git a/heat/tests/test_stack_user.py b/heat/tests/test_stack_user.py index 82099118b6..856fad220f 100644 --- a/heat/tests/test_stack_user.py +++ b/heat/tests/test_stack_user.py @@ -11,8 +11,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from keystoneauth1 import exceptions as kc_exceptions -import mock from heat.common import exception from heat.common import short_id diff --git a/heat/tests/test_template_format.py b/heat/tests/test_template_format.py index 66e8d275c8..3ce127c246 100644 --- a/heat/tests/test_template_format.py +++ b/heat/tests/test_template_format.py @@ -12,8 +12,8 @@ # under the License. import os +from unittest import mock -import mock import re import yaml diff --git a/heat/tests/test_translation_rule.py b/heat/tests/test_translation_rule.py index d599ac5506..efbc6d40d9 100644 --- a/heat/tests/test_translation_rule.py +++ b/heat/tests/test_translation_rule.py @@ -12,7 +12,7 @@ # under the License. import copy -import mock +from unittest import mock from heat.common import exception from heat.engine.cfn import functions as cfn_funcs diff --git a/heat/tests/test_validate.py b/heat/tests/test_validate.py index febef0d4e9..a5521e4358 100644 --- a/heat/tests/test_validate.py +++ b/heat/tests/test_validate.py @@ -11,7 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_messaging.rpc import dispatcher import webob diff --git a/heat/tests/test_vpc.py b/heat/tests/test_vpc.py index 06eb4b1def..5db8f96603 100644 --- a/heat/tests/test_vpc.py +++ b/heat/tests/test_vpc.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import uuid from heat.common import exception diff --git a/test-requirements.txt b/test-requirements.txt index 9e9a488a4c..a1965614db 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,6 @@ bandit!=1.6.0,>=1.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD kombu!=4.0.2,>=4.0.0 # BSD -mock>=2.0.0 # BSD PyMySQL>=0.7.6 # MIT License oslotest>=3.2.0 # Apache-2.0 psycopg2>=2.7 # LGPL/ZPL