From 69db9fe73c81bc6341c37948365163902b6437ee Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Fri, 10 Jan 2020 14:21:47 -0600 Subject: [PATCH] Raise flake8-import-order version to latest We had this library capped at a release that is a few years old. Now that we have dropped py2 testing, we can pick up the latest version. This uncovered a few things to clean up. Mostly the fact that mock is now a part of the StdLib unittest since Python 3.3. Change-Id: I27484dd4c25378413ff16e97a35a1a46062357bc Signed-off-by: Sean McGinnis --- openstackclient/api/api.py | 3 +-- openstackclient/tests/unit/api/test_object_store_v1.py | 2 +- openstackclient/tests/unit/common/test_availability_zone.py | 2 +- openstackclient/tests/unit/common/test_command.py | 2 +- openstackclient/tests/unit/common/test_configuration.py | 2 +- openstackclient/tests/unit/common/test_extension.py | 2 +- openstackclient/tests/unit/common/test_logs.py | 3 +-- openstackclient/tests/unit/common/test_module.py | 2 +- openstackclient/tests/unit/common/test_project_purge.py | 2 +- openstackclient/tests/unit/common/test_quota.py | 2 +- openstackclient/tests/unit/compute/v2/fakes.py | 2 +- openstackclient/tests/unit/compute/v2/test_agent.py | 4 ++-- openstackclient/tests/unit/compute/v2/test_aggregate.py | 4 ++-- openstackclient/tests/unit/compute/v2/test_console.py | 2 +- openstackclient/tests/unit/compute/v2/test_flavor.py | 4 ++-- openstackclient/tests/unit/compute/v2/test_host.py | 2 +- openstackclient/tests/unit/compute/v2/test_keypair.py | 4 ++-- openstackclient/tests/unit/compute/v2/test_server.py | 4 ++-- openstackclient/tests/unit/compute/v2/test_server_backup.py | 2 +- openstackclient/tests/unit/compute/v2/test_server_group.py | 2 +- openstackclient/tests/unit/compute/v2/test_server_image.py | 2 +- openstackclient/tests/unit/compute/v2/test_service.py | 5 +++-- openstackclient/tests/unit/compute/v2/test_usage.py | 2 +- openstackclient/tests/unit/fakes.py | 2 +- openstackclient/tests/unit/identity/v2_0/fakes.py | 2 +- openstackclient/tests/unit/identity/v2_0/test_catalog.py | 2 +- openstackclient/tests/unit/identity/v2_0/test_project.py | 2 +- openstackclient/tests/unit/identity/v2_0/test_role.py | 2 +- .../tests/unit/identity/v2_0/test_role_assignment.py | 2 +- openstackclient/tests/unit/identity/v2_0/test_token.py | 2 +- openstackclient/tests/unit/identity/v2_0/test_user.py | 2 +- openstackclient/tests/unit/identity/v3/fakes.py | 2 +- .../tests/unit/identity/v3/test_application_credential.py | 2 +- openstackclient/tests/unit/identity/v3/test_catalog.py | 2 +- openstackclient/tests/unit/identity/v3/test_credential.py | 4 ++-- .../tests/unit/identity/v3/test_endpoint_group.py | 2 +- openstackclient/tests/unit/identity/v3/test_group.py | 4 ++-- .../tests/unit/identity/v3/test_identity_provider.py | 3 +-- openstackclient/tests/unit/identity/v3/test_mappings.py | 2 +- openstackclient/tests/unit/identity/v3/test_project.py | 4 ++-- openstackclient/tests/unit/identity/v3/test_role.py | 2 +- .../tests/unit/identity/v3/test_role_assignment.py | 3 +-- openstackclient/tests/unit/identity/v3/test_token.py | 2 +- openstackclient/tests/unit/identity/v3/test_trust.py | 2 +- openstackclient/tests/unit/identity/v3/test_user.py | 2 +- openstackclient/tests/unit/image/v1/fakes.py | 3 +-- openstackclient/tests/unit/image/v1/test_image.py | 3 +-- openstackclient/tests/unit/image/v2/fakes.py | 2 +- openstackclient/tests/unit/image/v2/test_image.py | 2 +- openstackclient/tests/unit/integ/cli/test_shell.py | 2 +- openstackclient/tests/unit/network/test_common.py | 2 +- openstackclient/tests/unit/network/v2/fakes.py | 3 +-- openstackclient/tests/unit/network/v2/test_address_scope.py | 4 ++-- .../tests/unit/network/v2/test_floating_ip_compute.py | 4 ++-- .../tests/unit/network/v2/test_floating_ip_network.py | 4 ++-- .../tests/unit/network/v2/test_floating_ip_pool_compute.py | 2 +- .../unit/network/v2/test_floating_ip_port_forwarding.py | 4 ++-- .../tests/unit/network/v2/test_ip_availability.py | 2 +- openstackclient/tests/unit/network/v2/test_network.py | 5 ++--- openstackclient/tests/unit/network/v2/test_network_agent.py | 4 ++-- .../unit/network/v2/test_network_auto_allocated_topology.py | 2 +- .../tests/unit/network/v2/test_network_compute.py | 4 ++-- openstackclient/tests/unit/network/v2/test_network_flavor.py | 2 +- .../tests/unit/network/v2/test_network_flavor_profile.py | 2 +- openstackclient/tests/unit/network/v2/test_network_meter.py | 4 ++-- .../tests/unit/network/v2/test_network_meter_rule.py | 4 ++-- .../tests/unit/network/v2/test_network_qos_policy.py | 4 ++-- .../tests/unit/network/v2/test_network_qos_rule.py | 2 +- .../tests/unit/network/v2/test_network_qos_rule_type.py | 2 +- openstackclient/tests/unit/network/v2/test_network_rbac.py | 4 ++-- .../tests/unit/network/v2/test_network_segment.py | 4 ++-- .../tests/unit/network/v2/test_network_segment_range.py | 4 ++-- .../tests/unit/network/v2/test_network_service_provider.py | 2 +- openstackclient/tests/unit/network/v2/test_port.py | 4 ++-- openstackclient/tests/unit/network/v2/test_router.py | 4 ++-- .../tests/unit/network/v2/test_security_group_compute.py | 4 ++-- .../tests/unit/network/v2/test_security_group_network.py | 4 ++-- .../unit/network/v2/test_security_group_rule_compute.py | 4 ++-- .../unit/network/v2/test_security_group_rule_network.py | 4 ++-- openstackclient/tests/unit/network/v2/test_subnet.py | 4 ++-- openstackclient/tests/unit/network/v2/test_subnet_pool.py | 5 ++--- openstackclient/tests/unit/object/v1/fakes.py | 3 +-- openstackclient/tests/unit/object/v1/test_container.py | 3 +-- openstackclient/tests/unit/object/v1/test_object.py | 3 +-- openstackclient/tests/unit/object/v1/test_object_all.py | 2 +- openstackclient/tests/unit/test_shell.py | 2 +- openstackclient/tests/unit/utils.py | 3 +-- openstackclient/tests/unit/volume/test_find_resource.py | 2 +- openstackclient/tests/unit/volume/v1/fakes.py | 3 +-- openstackclient/tests/unit/volume/v1/test_qos_specs.py | 5 ++--- .../tests/unit/volume/v1/test_transfer_request.py | 4 ++-- openstackclient/tests/unit/volume/v1/test_type.py | 4 ++-- openstackclient/tests/unit/volume/v1/test_volume.py | 5 ++--- openstackclient/tests/unit/volume/v1/test_volume_backup.py | 4 ++-- openstackclient/tests/unit/volume/v2/fakes.py | 3 +-- .../tests/unit/volume/v2/test_consistency_group.py | 4 ++-- .../tests/unit/volume/v2/test_consistency_group_snapshot.py | 2 +- openstackclient/tests/unit/volume/v2/test_qos_specs.py | 5 ++--- .../tests/unit/volume/v2/test_transfer_request.py | 4 ++-- openstackclient/tests/unit/volume/v2/test_type.py | 4 ++-- openstackclient/tests/unit/volume/v2/test_volume.py | 5 ++--- openstackclient/tests/unit/volume/v2/test_volume_backup.py | 4 ++-- test-requirements.txt | 2 +- 103 files changed, 145 insertions(+), 163 deletions(-) diff --git a/openstackclient/api/api.py b/openstackclient/api/api.py index 7e2fe38f0e..d4772f94c3 100644 --- a/openstackclient/api/api.py +++ b/openstackclient/api/api.py @@ -13,11 +13,10 @@ """Base API Library""" -import simplejson as json - from keystoneauth1 import exceptions as ks_exceptions from keystoneauth1 import session as ks_session from osc_lib import exceptions +import simplejson as json from openstackclient.i18n import _ diff --git a/openstackclient/tests/unit/api/test_object_store_v1.py b/openstackclient/tests/unit/api/test_object_store_v1.py index 74b62493db..1c55be7192 100644 --- a/openstackclient/tests/unit/api/test_object_store_v1.py +++ b/openstackclient/tests/unit/api/test_object_store_v1.py @@ -13,7 +13,7 @@ """Object Store v1 API Library Tests""" -import mock +from unittest import mock from keystoneauth1 import session from requests_mock.contrib import fixture diff --git a/openstackclient/tests/unit/common/test_availability_zone.py b/openstackclient/tests/unit/common/test_availability_zone.py index 49e5904dbd..8733b51014 100644 --- a/openstackclient/tests/unit/common/test_availability_zone.py +++ b/openstackclient/tests/unit/common/test_availability_zone.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.common import availability_zone from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes diff --git a/openstackclient/tests/unit/common/test_command.py b/openstackclient/tests/unit/common/test_command.py index 6ddb7c1220..4fde5301d5 100644 --- a/openstackclient/tests/unit/common/test_command.py +++ b/openstackclient/tests/unit/common/test_command.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from osc_lib.command import command from osc_lib import exceptions diff --git a/openstackclient/tests/unit/common/test_configuration.py b/openstackclient/tests/unit/common/test_configuration.py index e10522b99c..bdd3debff5 100644 --- a/openstackclient/tests/unit/common/test_configuration.py +++ b/openstackclient/tests/unit/common/test_configuration.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.common import configuration from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/common/test_extension.py b/openstackclient/tests/unit/common/test_extension.py index 87c62da499..5093cbbb09 100644 --- a/openstackclient/tests/unit/common/test_extension.py +++ b/openstackclient/tests/unit/common/test_extension.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.common import extension from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes diff --git a/openstackclient/tests/unit/common/test_logs.py b/openstackclient/tests/unit/common/test_logs.py index 421234d62c..0e7105619d 100644 --- a/openstackclient/tests/unit/common/test_logs.py +++ b/openstackclient/tests/unit/common/test_logs.py @@ -15,8 +15,7 @@ # or Jun 2017. import logging - -import mock +from unittest import mock from osc_lib import logs diff --git a/openstackclient/tests/unit/common/test_module.py b/openstackclient/tests/unit/common/test_module.py index 2491d63965..d2e8293fa3 100644 --- a/openstackclient/tests/unit/common/test_module.py +++ b/openstackclient/tests/unit/common/test_module.py @@ -15,7 +15,7 @@ """Test module module""" -import mock +from unittest import mock from openstackclient.common import module as osc_module from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/common/test_project_purge.py b/openstackclient/tests/unit/common/test_project_purge.py index 6e8ce188f7..adc48ce26f 100644 --- a/openstackclient/tests/unit/common/test_project_purge.py +++ b/openstackclient/tests/unit/common/test_project_purge.py @@ -10,7 +10,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/openstackclient/tests/unit/common/test_quota.py b/openstackclient/tests/unit/common/test_quota.py index 297452a2dc..bd59ca77fe 100644 --- a/openstackclient/tests/unit/common/test_quota.py +++ b/openstackclient/tests/unit/common/test_quota.py @@ -11,8 +11,8 @@ # under the License. import copy +from unittest import mock -import mock from osc_lib import exceptions from openstackclient.common import quota diff --git a/openstackclient/tests/unit/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py index 7357e1430a..6e12f735d4 100644 --- a/openstackclient/tests/unit/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -14,9 +14,9 @@ # import copy +from unittest import mock import uuid -import mock from novaclient import api_versions from openstackclient.api import compute_v2 diff --git a/openstackclient/tests/unit/compute/v2/test_agent.py b/openstackclient/tests/unit/compute/v2/test_agent.py index 169940e29c..c6d4f2b655 100644 --- a/openstackclient/tests/unit/compute/v2/test_agent.py +++ b/openstackclient/tests/unit/compute/v2/test_agent.py @@ -13,8 +13,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/compute/v2/test_aggregate.py b/openstackclient/tests/unit/compute/v2/test_aggregate.py index 0937047cf0..cd0c1525ee 100644 --- a/openstackclient/tests/unit/compute/v2/test_aggregate.py +++ b/openstackclient/tests/unit/compute/v2/test_aggregate.py @@ -13,8 +13,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/compute/v2/test_console.py b/openstackclient/tests/unit/compute/v2/test_console.py index 3c708aaee3..99a14f048d 100644 --- a/openstackclient/tests/unit/compute/v2/test_console.py +++ b/openstackclient/tests/unit/compute/v2/test_console.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.compute.v2 import console from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes diff --git a/openstackclient/tests/unit/compute/v2/test_flavor.py b/openstackclient/tests/unit/compute/v2/test_flavor.py index a112fc1fae..fe7ce17481 100644 --- a/openstackclient/tests/unit/compute/v2/test_flavor.py +++ b/openstackclient/tests/unit/compute/v2/test_flavor.py @@ -13,8 +13,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call import novaclient from osc_lib import exceptions diff --git a/openstackclient/tests/unit/compute/v2/test_host.py b/openstackclient/tests/unit/compute/v2/test_host.py index 244da41317..4e1b5ad15b 100644 --- a/openstackclient/tests/unit/compute/v2/test_host.py +++ b/openstackclient/tests/unit/compute/v2/test_host.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.compute.v2 import host from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes diff --git a/openstackclient/tests/unit/compute/v2/test_keypair.py b/openstackclient/tests/unit/compute/v2/test_keypair.py index 0e5fb14324..1f3f56f989 100644 --- a/openstackclient/tests/unit/compute/v2/test_keypair.py +++ b/openstackclient/tests/unit/compute/v2/test_keypair.py @@ -13,10 +13,10 @@ # under the License. # +from unittest import mock +from unittest.mock import call import uuid -import mock -from mock import call from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py index c2bac2771f..b3be514724 100644 --- a/openstackclient/tests/unit/compute/v2/test_server.py +++ b/openstackclient/tests/unit/compute/v2/test_server.py @@ -16,9 +16,9 @@ import argparse import collections import copy import getpass +from unittest import mock +from unittest.mock import call -import mock -from mock import call from novaclient import api_versions from openstack import exceptions as sdk_exceptions from osc_lib import exceptions diff --git a/openstackclient/tests/unit/compute/v2/test_server_backup.py b/openstackclient/tests/unit/compute/v2/test_server_backup.py index 24a94531a4..7dd459d823 100644 --- a/openstackclient/tests/unit/compute/v2/test_server_backup.py +++ b/openstackclient/tests/unit/compute/v2/test_server_backup.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/compute/v2/test_server_group.py b/openstackclient/tests/unit/compute/v2/test_server_group.py index dc924e2421..9cd876ead1 100644 --- a/openstackclient/tests/unit/compute/v2/test_server_group.py +++ b/openstackclient/tests/unit/compute/v2/test_server_group.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/compute/v2/test_server_image.py b/openstackclient/tests/unit/compute/v2/test_server_image.py index 02e43129ed..f9d7b10e75 100644 --- a/openstackclient/tests/unit/compute/v2/test_server_image.py +++ b/openstackclient/tests/unit/compute/v2/test_server_image.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. # -import mock +from unittest import mock from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/compute/v2/test_service.py b/openstackclient/tests/unit/compute/v2/test_service.py index 0d663b2e67..7a03683364 100644 --- a/openstackclient/tests/unit/compute/v2/test_service.py +++ b/openstackclient/tests/unit/compute/v2/test_service.py @@ -13,8 +13,9 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call + from novaclient import api_versions from osc_lib import exceptions import six diff --git a/openstackclient/tests/unit/compute/v2/test_usage.py b/openstackclient/tests/unit/compute/v2/test_usage.py index 76dcc963fb..c08710256b 100644 --- a/openstackclient/tests/unit/compute/v2/test_usage.py +++ b/openstackclient/tests/unit/compute/v2/test_usage.py @@ -12,8 +12,8 @@ # import datetime +from unittest import mock -import mock from novaclient import api_versions from openstackclient.compute.v2 import usage diff --git a/openstackclient/tests/unit/fakes.py b/openstackclient/tests/unit/fakes.py index 59cbbe1055..e5476f06bb 100644 --- a/openstackclient/tests/unit/fakes.py +++ b/openstackclient/tests/unit/fakes.py @@ -15,9 +15,9 @@ import json import sys +from unittest import mock from keystoneauth1 import fixture -import mock import requests import six diff --git a/openstackclient/tests/unit/identity/v2_0/fakes.py b/openstackclient/tests/unit/identity/v2_0/fakes.py index 5db9422275..bd76a784a0 100644 --- a/openstackclient/tests/unit/identity/v2_0/fakes.py +++ b/openstackclient/tests/unit/identity/v2_0/fakes.py @@ -14,11 +14,11 @@ # import copy +from unittest import mock import uuid from keystoneauth1 import access from keystoneauth1 import fixture -import mock from openstackclient.tests.unit import fakes from openstackclient.tests.unit import utils diff --git a/openstackclient/tests/unit/identity/v2_0/test_catalog.py b/openstackclient/tests/unit/identity/v2_0/test_catalog.py index 362dec0885..1735507469 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_catalog.py +++ b/openstackclient/tests/unit/identity/v2_0/test_catalog.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.identity.v2_0 import catalog from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes diff --git a/openstackclient/tests/unit/identity/v2_0/test_project.py b/openstackclient/tests/unit/identity/v2_0/test_project.py index 7af7b3946e..cd8c825d15 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_project.py +++ b/openstackclient/tests/unit/identity/v2_0/test_project.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from keystoneauth1 import exceptions as ks_exc from osc_lib.cli import format_columns diff --git a/openstackclient/tests/unit/identity/v2_0/test_role.py b/openstackclient/tests/unit/identity/v2_0/test_role.py index 643d77f600..423884d9f5 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_role.py +++ b/openstackclient/tests/unit/identity/v2_0/test_role.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions diff --git a/openstackclient/tests/unit/identity/v2_0/test_role_assignment.py b/openstackclient/tests/unit/identity/v2_0/test_role_assignment.py index 733fda6cb1..3e1231aa30 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +++ b/openstackclient/tests/unit/identity/v2_0/test_role_assignment.py @@ -12,8 +12,8 @@ # import copy +from unittest import mock -import mock from osc_lib import exceptions from openstackclient.identity.v2_0 import role_assignment diff --git a/openstackclient/tests/unit/identity/v2_0/test_token.py b/openstackclient/tests/unit/identity/v2_0/test_token.py index dd7f4f4ab4..c079ce6796 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_token.py +++ b/openstackclient/tests/unit/identity/v2_0/test_token.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.identity.v2_0 import token from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes diff --git a/openstackclient/tests/unit/identity/v2_0/test_user.py b/openstackclient/tests/unit/identity/v2_0/test_user.py index 0a0d4b3651..4308b05d05 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_user.py +++ b/openstackclient/tests/unit/identity/v2_0/test_user.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions diff --git a/openstackclient/tests/unit/identity/v3/fakes.py b/openstackclient/tests/unit/identity/v3/fakes.py index e9ff068944..c394ab8237 100644 --- a/openstackclient/tests/unit/identity/v3/fakes.py +++ b/openstackclient/tests/unit/identity/v3/fakes.py @@ -15,11 +15,11 @@ import copy import datetime +from unittest import mock import uuid from keystoneauth1 import access from keystoneauth1 import fixture -import mock from osc_lib.cli import format_columns from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/identity/v3/test_application_credential.py b/openstackclient/tests/unit/identity/v3/test_application_credential.py index e7c8ede826..163aae9db9 100644 --- a/openstackclient/tests/unit/identity/v3/test_application_credential.py +++ b/openstackclient/tests/unit/identity/v3/test_application_credential.py @@ -14,8 +14,8 @@ # import copy +from unittest import mock -import mock from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/identity/v3/test_catalog.py b/openstackclient/tests/unit/identity/v3/test_catalog.py index ba076dbddf..3630ccb6a3 100644 --- a/openstackclient/tests/unit/identity/v3/test_catalog.py +++ b/openstackclient/tests/unit/identity/v3/test_catalog.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.identity.v3 import catalog from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes diff --git a/openstackclient/tests/unit/identity/v3/test_credential.py b/openstackclient/tests/unit/identity/v3/test_credential.py index de0306dd68..40596d5874 100644 --- a/openstackclient/tests/unit/identity/v3/test_credential.py +++ b/openstackclient/tests/unit/identity/v3/test_credential.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/identity/v3/test_endpoint_group.py b/openstackclient/tests/unit/identity/v3/test_endpoint_group.py index 6e9da9c78e..c081fa1f11 100644 --- a/openstackclient/tests/unit/identity/v3/test_endpoint_group.py +++ b/openstackclient/tests/unit/identity/v3/test_endpoint_group.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.identity.v3 import endpoint_group from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes diff --git a/openstackclient/tests/unit/identity/v3/test_group.py b/openstackclient/tests/unit/identity/v3/test_group.py index 81722631b3..04ba0dbe03 100644 --- a/openstackclient/tests/unit/identity/v3/test_group.py +++ b/openstackclient/tests/unit/identity/v3/test_group.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions diff --git a/openstackclient/tests/unit/identity/v3/test_identity_provider.py b/openstackclient/tests/unit/identity/v3/test_identity_provider.py index 0163c6c8d4..a419a9bcb1 100644 --- a/openstackclient/tests/unit/identity/v3/test_identity_provider.py +++ b/openstackclient/tests/unit/identity/v3/test_identity_provider.py @@ -13,8 +13,7 @@ # under the License. import copy - -import mock +from unittest import mock from openstackclient.identity.v3 import identity_provider from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/identity/v3/test_mappings.py b/openstackclient/tests/unit/identity/v3/test_mappings.py index 1d8e77d9e8..184bd2a265 100644 --- a/openstackclient/tests/unit/identity/v3/test_mappings.py +++ b/openstackclient/tests/unit/identity/v3/test_mappings.py @@ -13,8 +13,8 @@ # under the License. import copy +from unittest import mock -import mock from osc_lib import exceptions from openstackclient.identity.v3 import mapping diff --git a/openstackclient/tests/unit/identity/v3/test_project.py b/openstackclient/tests/unit/identity/v3/test_project.py index db27fedcdf..466bea1867 100644 --- a/openstackclient/tests/unit/identity/v3/test_project.py +++ b/openstackclient/tests/unit/identity/v3/test_project.py @@ -13,8 +13,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/identity/v3/test_role.py b/openstackclient/tests/unit/identity/v3/test_role.py index 99f3a2de74..ead2cb58bb 100644 --- a/openstackclient/tests/unit/identity/v3/test_role.py +++ b/openstackclient/tests/unit/identity/v3/test_role.py @@ -14,8 +14,8 @@ # import copy +from unittest import mock -import mock from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/identity/v3/test_role_assignment.py b/openstackclient/tests/unit/identity/v3/test_role_assignment.py index bff6c56df1..7d38d360b0 100644 --- a/openstackclient/tests/unit/identity/v3/test_role_assignment.py +++ b/openstackclient/tests/unit/identity/v3/test_role_assignment.py @@ -12,8 +12,7 @@ # import copy - -import mock +from unittest import mock from openstackclient.identity.v3 import role_assignment from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/identity/v3/test_token.py b/openstackclient/tests/unit/identity/v3/test_token.py index 7321909f47..adb491b30f 100644 --- a/openstackclient/tests/unit/identity/v3/test_token.py +++ b/openstackclient/tests/unit/identity/v3/test_token.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.identity.v3 import token from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes diff --git a/openstackclient/tests/unit/identity/v3/test_trust.py b/openstackclient/tests/unit/identity/v3/test_trust.py index 1355b9089b..d8cfc59fe8 100644 --- a/openstackclient/tests/unit/identity/v3/test_trust.py +++ b/openstackclient/tests/unit/identity/v3/test_trust.py @@ -12,8 +12,8 @@ # import copy +from unittest import mock -import mock from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/identity/v3/test_user.py b/openstackclient/tests/unit/identity/v3/test_user.py index 920ee95051..4b14bca05a 100644 --- a/openstackclient/tests/unit/identity/v3/test_user.py +++ b/openstackclient/tests/unit/identity/v3/test_user.py @@ -14,8 +14,8 @@ # import contextlib +from unittest import mock -import mock from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/image/v1/fakes.py b/openstackclient/tests/unit/image/v1/fakes.py index bbec00fc06..de23223572 100644 --- a/openstackclient/tests/unit/image/v1/fakes.py +++ b/openstackclient/tests/unit/image/v1/fakes.py @@ -14,10 +14,9 @@ # import copy +from unittest import mock import uuid -import mock - from openstackclient.tests.unit import fakes from openstackclient.tests.unit import utils from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes diff --git a/openstackclient/tests/unit/image/v1/test_image.py b/openstackclient/tests/unit/image/v1/test_image.py index 0997d76546..970b36c68a 100644 --- a/openstackclient/tests/unit/image/v1/test_image.py +++ b/openstackclient/tests/unit/image/v1/test_image.py @@ -14,8 +14,7 @@ # import copy - -import mock +from unittest import mock from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/image/v2/fakes.py b/openstackclient/tests/unit/image/v2/fakes.py index f69a2bc311..655ae341c6 100644 --- a/openstackclient/tests/unit/image/v2/fakes.py +++ b/openstackclient/tests/unit/image/v2/fakes.py @@ -15,10 +15,10 @@ import copy import random +from unittest import mock import uuid from glanceclient.v2 import schemas -import mock from osc_lib.cli import format_columns import warlock diff --git a/openstackclient/tests/unit/image/v2/test_image.py b/openstackclient/tests/unit/image/v2/test_image.py index 748a61aaf4..78d857e269 100644 --- a/openstackclient/tests/unit/image/v2/test_image.py +++ b/openstackclient/tests/unit/image/v2/test_image.py @@ -14,10 +14,10 @@ # import copy +from unittest import mock from glanceclient.common import utils as glanceclient_utils from glanceclient.v2 import schemas -import mock from osc_lib.cli import format_columns from osc_lib import exceptions import warlock diff --git a/openstackclient/tests/unit/integ/cli/test_shell.py b/openstackclient/tests/unit/integ/cli/test_shell.py index 2598517113..0c98a12942 100644 --- a/openstackclient/tests/unit/integ/cli/test_shell.py +++ b/openstackclient/tests/unit/integ/cli/test_shell.py @@ -11,9 +11,9 @@ # under the License. import copy +from unittest import mock import fixtures -import mock from osc_lib.tests import utils as osc_lib_utils from openstackclient import shell diff --git a/openstackclient/tests/unit/network/test_common.py b/openstackclient/tests/unit/network/test_common.py index 3a20687824..cde321aa23 100644 --- a/openstackclient/tests/unit/network/test_common.py +++ b/openstackclient/tests/unit/network/test_common.py @@ -12,8 +12,8 @@ # import argparse +from unittest import mock -import mock import openstack from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py index 35f0b1a59c..5809b225e1 100644 --- a/openstackclient/tests/unit/network/v2/fakes.py +++ b/openstackclient/tests/unit/network/v2/fakes.py @@ -15,10 +15,9 @@ import argparse import copy from random import choice from random import randint +from unittest import mock import uuid -import mock - from openstackclient.tests.unit import fakes from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 from openstackclient.tests.unit import utils diff --git a/openstackclient/tests/unit/network/v2/test_address_scope.py b/openstackclient/tests/unit/network/v2/test_address_scope.py index 400671881f..17f13e8351 100644 --- a/openstackclient/tests/unit/network/v2/test_address_scope.py +++ b/openstackclient/tests/unit/network/v2/test_address_scope.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_floating_ip_compute.py b/openstackclient/tests/unit/network/v2/test_floating_ip_compute.py index df47e63e91..18212cf707 100644 --- a/openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip_compute.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_floating_ip_network.py b/openstackclient/tests/unit/network/v2/test_floating_ip_network.py index cbd4da38ca..a98051e769 100644 --- a/openstackclient/tests/unit/network/v2/test_floating_ip_network.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip_network.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py b/openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py index 591f58ca4e..3dd99362c1 100644 --- a/openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from openstackclient.network.v2 import floating_ip_pool from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes diff --git a/openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py b/openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py index b51158be37..ea6cdd266f 100644 --- a/openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_ip_availability.py b/openstackclient/tests/unit/network/v2/test_ip_availability.py index 21508a8df1..9a712704c6 100644 --- a/openstackclient/tests/unit/network/v2/test_ip_availability.py +++ b/openstackclient/tests/unit/network/v2/test_ip_availability.py @@ -11,7 +11,7 @@ # under the License. # -import mock +from unittest import mock from osc_lib.cli import format_columns diff --git a/openstackclient/tests/unit/network/v2/test_network.py b/openstackclient/tests/unit/network/v2/test_network.py index 5c97c363f5..5f8eed6702 100644 --- a/openstackclient/tests/unit/network/v2/test_network.py +++ b/openstackclient/tests/unit/network/v2/test_network.py @@ -12,9 +12,8 @@ # import random - -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_agent.py b/openstackclient/tests/unit/network/v2/test_network_agent.py index 8500d08ea6..3181ee78a1 100644 --- a/openstackclient/tests/unit/network/v2/test_network_agent.py +++ b/openstackclient/tests/unit/network/v2/test_network_agent.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py b/openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py index 1a231160dd..e9687a70d3 100644 --- a/openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +++ b/openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from openstackclient.network.v2 import network_auto_allocated_topology from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes diff --git a/openstackclient/tests/unit/network/v2/test_network_compute.py b/openstackclient/tests/unit/network/v2/test_network_compute.py index c649401c41..89330fffe9 100644 --- a/openstackclient/tests/unit/network/v2/test_network_compute.py +++ b/openstackclient/tests/unit/network/v2/test_network_compute.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_flavor.py b/openstackclient/tests/unit/network/v2/test_network_flavor.py index 896a172530..010f53d33c 100644 --- a/openstackclient/tests/unit/network/v2/test_network_flavor.py +++ b/openstackclient/tests/unit/network/v2/test_network_flavor.py @@ -14,7 +14,7 @@ # under the License. # -import mock +from unittest import mock from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_flavor_profile.py b/openstackclient/tests/unit/network/v2/test_network_flavor_profile.py index 91683241c2..fcf24da9f2 100644 --- a/openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +++ b/openstackclient/tests/unit/network/v2/test_network_flavor_profile.py @@ -10,7 +10,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/openstackclient/tests/unit/network/v2/test_network_meter.py b/openstackclient/tests/unit/network/v2/test_network_meter.py index 2b96f7a680..4fadcfe1f8 100644 --- a/openstackclient/tests/unit/network/v2/test_network_meter.py +++ b/openstackclient/tests/unit/network/v2/test_network_meter.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_meter_rule.py b/openstackclient/tests/unit/network/v2/test_network_meter_rule.py index af481793d7..8f8922c020 100644 --- a/openstackclient/tests/unit/network/v2/test_network_meter_rule.py +++ b/openstackclient/tests/unit/network/v2/test_network_meter_rule.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_qos_policy.py b/openstackclient/tests/unit/network/v2/test_network_qos_policy.py index e7239932a5..d6a78410d4 100644 --- a/openstackclient/tests/unit/network/v2/test_network_qos_policy.py +++ b/openstackclient/tests/unit/network/v2/test_network_qos_policy.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_qos_rule.py b/openstackclient/tests/unit/network/v2/test_network_qos_rule.py index 5b54d318ac..217e481ea7 100644 --- a/openstackclient/tests/unit/network/v2/test_network_qos_rule.py +++ b/openstackclient/tests/unit/network/v2/test_network_qos_rule.py @@ -13,7 +13,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/openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py b/openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py index 80c52bf72e..08a83fabda 100644 --- a/openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +++ b/openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from openstackclient.network.v2 import network_qos_rule_type as _qos_rule_type from openstackclient.tests.unit.network.v2 import fakes as network_fakes diff --git a/openstackclient/tests/unit/network/v2/test_network_rbac.py b/openstackclient/tests/unit/network/v2/test_network_rbac.py index 96440091c1..078188ceb5 100644 --- a/openstackclient/tests/unit/network/v2/test_network_rbac.py +++ b/openstackclient/tests/unit/network/v2/test_network_rbac.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_segment.py b/openstackclient/tests/unit/network/v2/test_network_segment.py index 0639766d26..6cd948e3bb 100644 --- a/openstackclient/tests/unit/network/v2/test_network_segment.py +++ b/openstackclient/tests/unit/network/v2/test_network_segment.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_segment_range.py b/openstackclient/tests/unit/network/v2/test_network_segment_range.py index 22e25df133..89a0c223ce 100644 --- a/openstackclient/tests/unit/network/v2/test_network_segment_range.py +++ b/openstackclient/tests/unit/network/v2/test_network_segment_range.py @@ -14,8 +14,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_network_service_provider.py b/openstackclient/tests/unit/network/v2/test_network_service_provider.py index 5ba85ddb9a..5e4ddea6cf 100644 --- a/openstackclient/tests/unit/network/v2/test_network_service_provider.py +++ b/openstackclient/tests/unit/network/v2/test_network_service_provider.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from openstackclient.network.v2 import network_service_provider \ as service_provider diff --git a/openstackclient/tests/unit/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py index c30d682f59..d64cc79d56 100644 --- a/openstackclient/tests/unit/network/v2/test_port.py +++ b/openstackclient/tests/unit/network/v2/test_port.py @@ -12,9 +12,9 @@ # import argparse +from unittest import mock +from unittest.mock import call -import mock -from mock import call from osc_lib.cli import format_columns from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/network/v2/test_router.py b/openstackclient/tests/unit/network/v2/test_router.py index 500cfbe5a3..38861b0ad5 100644 --- a/openstackclient/tests/unit/network/v2/test_router.py +++ b/openstackclient/tests/unit/network/v2/test_router.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_security_group_compute.py b/openstackclient/tests/unit/network/v2/test_security_group_compute.py index df36006899..b4ddcf803d 100644 --- a/openstackclient/tests/unit/network/v2/test_security_group_compute.py +++ b/openstackclient/tests/unit/network/v2/test_security_group_compute.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_security_group_network.py b/openstackclient/tests/unit/network/v2/test_security_group_network.py index 57698ec586..14d5751436 100644 --- a/openstackclient/tests/unit/network/v2/test_security_group_network.py +++ b/openstackclient/tests/unit/network/v2/test_security_group_network.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py b/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py index cf5261b284..5720e30584 100644 --- a/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +++ b/openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py b/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py index 49c3d5dbec..0a9522b0bc 100644 --- a/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +++ b/openstackclient/tests/unit/network/v2/test_security_group_rule_network.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_subnet.py b/openstackclient/tests/unit/network/v2/test_subnet.py index 9903b0423a..e71e1dd6ed 100644 --- a/openstackclient/tests/unit/network/v2/test_subnet.py +++ b/openstackclient/tests/unit/network/v2/test_subnet.py @@ -11,8 +11,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/network/v2/test_subnet_pool.py b/openstackclient/tests/unit/network/v2/test_subnet_pool.py index 2271c08944..eb454646de 100644 --- a/openstackclient/tests/unit/network/v2/test_subnet_pool.py +++ b/openstackclient/tests/unit/network/v2/test_subnet_pool.py @@ -12,9 +12,8 @@ # import argparse - -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/object/v1/fakes.py b/openstackclient/tests/unit/object/v1/fakes.py index 5d65d1066f..0ed791a5bc 100644 --- a/openstackclient/tests/unit/object/v1/fakes.py +++ b/openstackclient/tests/unit/object/v1/fakes.py @@ -13,9 +13,8 @@ # under the License. # -import six - from keystoneauth1 import session +import six from openstackclient.api import object_store_v1 as object_store from openstackclient.tests.unit import utils diff --git a/openstackclient/tests/unit/object/v1/test_container.py b/openstackclient/tests/unit/object/v1/test_container.py index 39e2d80f4a..7d3cc8d840 100644 --- a/openstackclient/tests/unit/object/v1/test_container.py +++ b/openstackclient/tests/unit/object/v1/test_container.py @@ -14,8 +14,7 @@ # import copy - -import mock +from unittest import mock from openstackclient.api import object_store_v1 as object_store from openstackclient.object.v1 import container diff --git a/openstackclient/tests/unit/object/v1/test_object.py b/openstackclient/tests/unit/object/v1/test_object.py index b629937351..fc3073c8bc 100644 --- a/openstackclient/tests/unit/object/v1/test_object.py +++ b/openstackclient/tests/unit/object/v1/test_object.py @@ -14,8 +14,7 @@ # import copy - -import mock +from unittest import mock from openstackclient.api import object_store_v1 as object_store from openstackclient.object.v1 import object as obj diff --git a/openstackclient/tests/unit/object/v1/test_object_all.py b/openstackclient/tests/unit/object/v1/test_object_all.py index 08a7534d06..dd587142fa 100644 --- a/openstackclient/tests/unit/object/v1/test_object_all.py +++ b/openstackclient/tests/unit/object/v1/test_object_all.py @@ -12,8 +12,8 @@ # import copy +from unittest import mock -import mock from osc_lib import exceptions from requests_mock.contrib import fixture import six diff --git a/openstackclient/tests/unit/test_shell.py b/openstackclient/tests/unit/test_shell.py index 31675c47e6..94f4f44d24 100644 --- a/openstackclient/tests/unit/test_shell.py +++ b/openstackclient/tests/unit/test_shell.py @@ -15,8 +15,8 @@ import os import sys +from unittest import mock -import mock from osc_lib.tests import utils as osc_lib_test_utils from oslo_utils import importutils import wrapt diff --git a/openstackclient/tests/unit/utils.py b/openstackclient/tests/unit/utils.py index 8df81a50eb..4f1bc46a98 100644 --- a/openstackclient/tests/unit/utils.py +++ b/openstackclient/tests/unit/utils.py @@ -16,12 +16,11 @@ import os +from cliff import columns as cliff_columns import fixtures from six.moves import StringIO import testtools -from cliff import columns as cliff_columns - from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/volume/test_find_resource.py b/openstackclient/tests/unit/volume/test_find_resource.py index 60591eff7f..208f55b94e 100644 --- a/openstackclient/tests/unit/volume/test_find_resource.py +++ b/openstackclient/tests/unit/volume/test_find_resource.py @@ -13,7 +13,7 @@ # under the License. # -import mock +from unittest import mock from cinderclient.v3 import volume_snapshots from cinderclient.v3 import volumes diff --git a/openstackclient/tests/unit/volume/v1/fakes.py b/openstackclient/tests/unit/volume/v1/fakes.py index de9c724f1e..adb775edf2 100644 --- a/openstackclient/tests/unit/volume/v1/fakes.py +++ b/openstackclient/tests/unit/volume/v1/fakes.py @@ -15,10 +15,9 @@ import copy import random +from unittest import mock import uuid -import mock - from openstackclient.tests.unit import fakes from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes from openstackclient.tests.unit import utils diff --git a/openstackclient/tests/unit/volume/v1/test_qos_specs.py b/openstackclient/tests/unit/volume/v1/test_qos_specs.py index 11dc80844a..83c533b6f0 100644 --- a/openstackclient/tests/unit/volume/v1/test_qos_specs.py +++ b/openstackclient/tests/unit/volume/v1/test_qos_specs.py @@ -14,9 +14,8 @@ # import copy - -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v1/test_transfer_request.py b/openstackclient/tests/unit/volume/v1/test_transfer_request.py index 680561d522..333bf52688 100644 --- a/openstackclient/tests/unit/volume/v1/test_transfer_request.py +++ b/openstackclient/tests/unit/volume/v1/test_transfer_request.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/volume/v1/test_type.py b/openstackclient/tests/unit/volume/v1/test_type.py index beff83364c..8bee574795 100644 --- a/openstackclient/tests/unit/volume/v1/test_type.py +++ b/openstackclient/tests/unit/volume/v1/test_type.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v1/test_volume.py b/openstackclient/tests/unit/volume/v1/test_volume.py index c415455534..25cdf92a43 100644 --- a/openstackclient/tests/unit/volume/v1/test_volume.py +++ b/openstackclient/tests/unit/volume/v1/test_volume.py @@ -14,9 +14,8 @@ # import argparse - -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v1/test_volume_backup.py b/openstackclient/tests/unit/volume/v1/test_volume_backup.py index 20be6e46d7..20aadcd344 100644 --- a/openstackclient/tests/unit/volume/v1/test_volume_backup.py +++ b/openstackclient/tests/unit/volume/v1/test_volume_backup.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/volume/v2/fakes.py b/openstackclient/tests/unit/volume/v2/fakes.py index 5f976b0625..5f18990e96 100644 --- a/openstackclient/tests/unit/volume/v2/fakes.py +++ b/openstackclient/tests/unit/volume/v2/fakes.py @@ -14,10 +14,9 @@ import copy import random +from unittest import mock import uuid -import mock - from osc_lib.cli import format_columns from openstackclient.tests.unit import fakes diff --git a/openstackclient/tests/unit/volume/v2/test_consistency_group.py b/openstackclient/tests/unit/volume/v2/test_consistency_group.py index d238818245..c3bd71e325 100644 --- a/openstackclient/tests/unit/volume/v2/test_consistency_group.py +++ b/openstackclient/tests/unit/volume/v2/test_consistency_group.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py b/openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py index 3bfe93df04..2202b85b98 100644 --- a/openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py +++ b/openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py @@ -12,7 +12,7 @@ # under the License. # -from mock import call +from unittest.mock import call from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import consistency_group_snapshot diff --git a/openstackclient/tests/unit/volume/v2/test_qos_specs.py b/openstackclient/tests/unit/volume/v2/test_qos_specs.py index 454747f5aa..073ec5709b 100644 --- a/openstackclient/tests/unit/volume/v2/test_qos_specs.py +++ b/openstackclient/tests/unit/volume/v2/test_qos_specs.py @@ -14,9 +14,8 @@ # import copy - -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v2/test_transfer_request.py b/openstackclient/tests/unit/volume/v2/test_transfer_request.py index 1ea6648f6a..c9dce3cab0 100644 --- a/openstackclient/tests/unit/volume/v2/test_transfer_request.py +++ b/openstackclient/tests/unit/volume/v2/test_transfer_request.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions from osc_lib import utils diff --git a/openstackclient/tests/unit/volume/v2/test_type.py b/openstackclient/tests/unit/volume/v2/test_type.py index 17915928dc..f13d08517a 100644 --- a/openstackclient/tests/unit/volume/v2/test_type.py +++ b/openstackclient/tests/unit/volume/v2/test_type.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v2/test_volume.py b/openstackclient/tests/unit/volume/v2/test_volume.py index 332b50a78f..5d41b3a180 100644 --- a/openstackclient/tests/unit/volume/v2/test_volume.py +++ b/openstackclient/tests/unit/volume/v2/test_volume.py @@ -13,9 +13,8 @@ # import argparse - -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib.cli import format_columns from osc_lib import exceptions diff --git a/openstackclient/tests/unit/volume/v2/test_volume_backup.py b/openstackclient/tests/unit/volume/v2/test_volume_backup.py index 30c7915dd9..4e1f7ee135 100644 --- a/openstackclient/tests/unit/volume/v2/test_volume_backup.py +++ b/openstackclient/tests/unit/volume/v2/test_volume_backup.py @@ -12,8 +12,8 @@ # under the License. # -import mock -from mock import call +from unittest import mock +from unittest.mock import call from osc_lib import exceptions from osc_lib import utils diff --git a/test-requirements.txt b/test-requirements.txt index 0f59e46faa..d0bce4405c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -flake8-import-order==0.13 # LGPLv3 +flake8-import-order>=0.13 # LGPLv3 mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 requests>=2.14.2 # Apache-2.0