From 64e3cb0fa883e653af4ecd03c085b69e5ab40ca7 Mon Sep 17 00:00:00 2001 From: Andrey Klychkov Date: Fri, 2 Aug 2019 18:18:14 +0300 Subject: [PATCH] Unit tests: remove unused imports (#59812) * Unit tests: remove unused imports * Unit tests: remove unused imports, fix --- test/units/module_utils/network/aci/test_aci.py | 2 +- test/units/module_utils/xenserver/conftest.py | 2 +- .../module_utils/xenserver/test_gather_vm_params_and_facts.py | 2 +- test/units/module_utils/xenserver/test_get_object_ref.py | 2 +- test/units/module_utils/xenserver/test_misc.py | 2 +- test/units/module_utils/xenserver/test_netaddr_functions.py | 2 +- test/units/module_utils/xenserver/test_set_vm_power_state.py | 2 +- test/units/module_utils/xenserver/test_wait_for_functions.py | 2 +- test/units/module_utils/xenserver/test_xapi.py | 2 +- test/units/module_utils/xenserver/test_xenserverobject.py | 2 +- .../units/modules/cloud/amazon/test_s3_bucket_notification.py | 2 +- test/units/modules/monitoring/test_pagerduty_alert.py | 2 +- test/units/modules/network/checkpoint/test_cp_network.py | 2 +- test/units/modules/network/cli/test_cli_config.py | 2 +- test/units/modules/network/junos/test_junos_rpc.py | 4 ++-- test/units/modules/network/netact/test_netact_cm_command.py | 2 +- .../modules/network/netscaler/test_netscaler_save_config.py | 2 +- test/units/modules/network/netvisor/test_pn_access_list_ip.py | 2 +- test/units/modules/network/netvisor/test_pn_admin_service.py | 2 +- .../modules/network/netvisor/test_pn_admin_session_timeout.py | 2 +- test/units/modules/network/netvisor/test_pn_admin_syslog.py | 2 +- .../network/netvisor/test_pn_connection_stats_settings.py | 2 +- test/units/modules/network/netvisor/test_pn_cpu_class.py | 2 +- test/units/modules/network/netvisor/test_pn_cpu_mgmt_class.py | 2 +- test/units/modules/network/netvisor/test_pn_dhcp_filter.py | 2 +- test/units/modules/network/netvisor/test_pn_dscp_map.py | 2 +- .../modules/network/netvisor/test_pn_dscp_map_pri_map.py | 2 +- test/units/modules/network/netvisor/test_pn_fabric_local.py | 2 +- test/units/modules/network/netvisor/test_pn_igmp_snooping.py | 2 +- .../modules/network/netvisor/test_pn_ipv6security_raguard.py | 2 +- .../network/netvisor/test_pn_ipv6security_raguard_port.py | 2 +- .../network/netvisor/test_pn_ipv6security_raguard_vlan.py | 2 +- test/units/modules/network/netvisor/test_pn_port_config.py | 2 +- test/units/modules/network/netvisor/test_pn_port_cos_bw.py | 2 +- .../modules/network/netvisor/test_pn_port_cos_rate_setting.py | 2 +- test/units/modules/network/netvisor/test_pn_prefix_list.py | 2 +- .../modules/network/netvisor/test_pn_prefix_list_network.py | 2 +- test/units/modules/network/netvisor/test_pn_role.py | 2 +- test/units/modules/network/netvisor/test_pn_snmp_community.py | 2 +- test/units/modules/network/netvisor/test_pn_snmp_trap_sink.py | 2 +- test/units/modules/network/netvisor/test_pn_snmp_vacm.py | 2 +- test/units/modules/network/netvisor/test_pn_stp.py | 2 +- test/units/modules/network/netvisor/test_pn_stp_port.py | 2 +- test/units/modules/network/netvisor/test_pn_switch_setup.py | 2 +- test/units/modules/network/netvisor/test_pn_user.py | 2 +- .../modules/network/netvisor/test_pn_vflow_table_profile.py | 2 +- test/units/modules/network/netvisor/test_pn_vrouter_bgp.py | 2 +- .../modules/network/netvisor/test_pn_vrouter_bgp_network.py | 2 +- .../modules/network/netvisor/test_pn_vrouter_interface_ip.py | 2 +- .../network/netvisor/test_pn_vrouter_loopback_interface.py | 2 +- test/units/modules/network/netvisor/test_pn_vrouter_ospf.py | 2 +- test/units/modules/network/netvisor/test_pn_vrouter_ospf6.py | 2 +- .../modules/network/netvisor/test_pn_vrouter_packet_relay.py | 2 +- .../modules/network/netvisor/test_pn_vrouter_pim_config.py | 2 +- test/units/modules/network/nso/test_nso_config.py | 2 +- test/units/modules/network/nuage/nuage_module.py | 2 +- test/units/modules/network/nxos/test_nxos_ospf.py | 2 +- .../units/modules/network/nxos/test_nxos_pim_interface_bfd.py | 2 +- test/units/modules/network/opx/test_opx_cps.py | 2 +- test/units/modules/network/vyos/test_vyos_banner.py | 2 +- test/units/modules/network/vyos/test_vyos_static_route.py | 2 +- .../remote_management/oneview/oneview_module_loader.py | 2 +- .../oneview/test_oneview_ethernet_network.py | 2 +- .../oneview/test_oneview_ethernet_network_facts.py | 2 +- .../modules/storage/netapp/test_na_ontap_gather_facts.py | 2 +- test/units/modules/storage/netapp/test_na_ontap_motd.py | 2 +- test/units/modules/storage/netapp/test_na_ontap_vscan.py | 2 +- .../storage/netapp/test_na_ontap_vscan_on_access_policy.py | 2 +- test/units/modules/storage/netapp/test_netapp_e_global.py | 2 +- test/units/modules/storage/netapp/test_netapp_e_host.py | 2 +- .../modules/storage/netapp/test_netapp_e_iscsi_interface.py | 2 +- .../modules/storage/netapp/test_netapp_e_iscsi_target.py | 2 +- test/units/modules/storage/netapp/test_netapp_e_syslog.py | 2 +- test/units/modules/storage/netapp/test_netapp_e_volume.py | 2 +- test/units/playbook/test_play.py | 2 +- test/units/playbook/test_playbook.py | 4 ++-- test/units/plugins/action/test_raw.py | 2 +- test/units/plugins/action/test_win_updates.py | 2 +- test/units/plugins/callback/test_callback.py | 2 +- test/units/plugins/cliconf/test_ios.py | 2 +- test/units/plugins/httpapi/test_checkpoint.py | 2 +- test/units/plugins/strategy/test_strategy_base.py | 2 +- test/units/plugins/test_plugins.py | 4 ++-- test/units/template/test_safe_eval.py | 2 +- 84 files changed, 87 insertions(+), 87 deletions(-) diff --git a/test/units/module_utils/network/aci/test_aci.py b/test/units/module_utils/network/aci/test_aci.py index 804d405ca03..af783b9534e 100644 --- a/test/units/module_utils/network/aci/test_aci.py +++ b/test/units/module_utils/network/aci/test_aci.py @@ -22,7 +22,7 @@ import sys from units.compat import unittest from ansible.module_utils.network.aci.aci import ACIModule -from ansible.module_utils.six import PY2, PY3 +from ansible.module_utils.six import PY2 from ansible.module_utils._text import to_native import pytest diff --git a/test/units/module_utils/xenserver/conftest.py b/test/units/module_utils/xenserver/conftest.py index 60db1bfc586..647758a3b1c 100644 --- a/test/units/module_utils/xenserver/conftest.py +++ b/test/units/module_utils/xenserver/conftest.py @@ -13,7 +13,7 @@ import os import json import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FakeAnsibleModule from ansible.module_utils import six from mock import MagicMock diff --git a/test/units/module_utils/xenserver/test_gather_vm_params_and_facts.py b/test/units/module_utils/xenserver/test_gather_vm_params_and_facts.py index cf3bc614a77..835c4e6cf16 100644 --- a/test/units/module_utils/xenserver/test_gather_vm_params_and_facts.py +++ b/test/units/module_utils/xenserver/test_gather_vm_params_and_facts.py @@ -9,7 +9,7 @@ __metaclass__ = type import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from .common import testcase_bad_xenapi_refs diff --git a/test/units/module_utils/xenserver/test_get_object_ref.py b/test/units/module_utils/xenserver/test_get_object_ref.py index 59546a91249..267302a0997 100644 --- a/test/units/module_utils/xenserver/test_get_object_ref.py +++ b/test/units/module_utils/xenserver/test_get_object_ref.py @@ -9,7 +9,7 @@ __metaclass__ = type import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from .common import fake_xenapi_ref diff --git a/test/units/module_utils/xenserver/test_misc.py b/test/units/module_utils/xenserver/test_misc.py index b6a0312a04d..c5724efb48f 100644 --- a/test/units/module_utils/xenserver/test_misc.py +++ b/test/units/module_utils/xenserver/test_misc.py @@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException def test_xapi_to_module_vm_power_state_bad_power_state(xenserver): diff --git a/test/units/module_utils/xenserver/test_netaddr_functions.py b/test/units/module_utils/xenserver/test_netaddr_functions.py index 43a7b4be308..3393d08a9c9 100644 --- a/test/units/module_utils/xenserver/test_netaddr_functions.py +++ b/test/units/module_utils/xenserver/test_netaddr_functions.py @@ -9,7 +9,7 @@ __metaclass__ = type import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from ansible.module_utils.common.network import is_mac testcase_is_valid_mac_addr = [ diff --git a/test/units/module_utils/xenserver/test_set_vm_power_state.py b/test/units/module_utils/xenserver/test_set_vm_power_state.py index 0cbf0119d3b..c14f2723517 100644 --- a/test/units/module_utils/xenserver/test_set_vm_power_state.py +++ b/test/units/module_utils/xenserver/test_set_vm_power_state.py @@ -9,7 +9,7 @@ __metaclass__ = type import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from .common import fake_xenapi_ref, testcase_bad_xenapi_refs diff --git a/test/units/module_utils/xenserver/test_wait_for_functions.py b/test/units/module_utils/xenserver/test_wait_for_functions.py index 6cbeae3ab32..9358e0bd913 100644 --- a/test/units/module_utils/xenserver/test_wait_for_functions.py +++ b/test/units/module_utils/xenserver/test_wait_for_functions.py @@ -9,7 +9,7 @@ __metaclass__ = type import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from .common import fake_xenapi_ref, testcase_bad_xenapi_refs diff --git a/test/units/module_utils/xenserver/test_xapi.py b/test/units/module_utils/xenserver/test_xapi.py index 0f60d2abccb..63cbbea1ba6 100644 --- a/test/units/module_utils/xenserver/test_xapi.py +++ b/test/units/module_utils/xenserver/test_xapi.py @@ -10,7 +10,7 @@ __metaclass__ = type import pytest import atexit -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from ansible.module_utils.ansible_release import __version__ as ANSIBLE_VERSION diff --git a/test/units/module_utils/xenserver/test_xenserverobject.py b/test/units/module_utils/xenserver/test_xenserverobject.py index 41728d27cf1..881acfd3c16 100644 --- a/test/units/module_utils/xenserver/test_xenserverobject.py +++ b/test/units/module_utils/xenserver/test_xenserverobject.py @@ -9,7 +9,7 @@ __metaclass__ = type import pytest -from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException +from .FakeAnsibleModule import FailJsonException from .common import fake_xenapi_ref diff --git a/test/units/modules/cloud/amazon/test_s3_bucket_notification.py b/test/units/modules/cloud/amazon/test_s3_bucket_notification.py index 0e386e5702c..934a1a68e58 100644 --- a/test/units/modules/cloud/amazon/test_s3_bucket_notification.py +++ b/test/units/modules/cloud/amazon/test_s3_bucket_notification.py @@ -6,7 +6,7 @@ from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible.modules.cloud.amazon.s3_bucket_notification import AmazonBucket, Config from ansible.modules.cloud.amazon import s3_bucket_notification try: - from botocore.exceptions import ClientError, ParamValidationError, BotoCoreError + from botocore.exceptions import ClientError except ImportError: pass diff --git a/test/units/modules/monitoring/test_pagerduty_alert.py b/test/units/modules/monitoring/test_pagerduty_alert.py index 4a92cb396ad..c91fb6b3596 100644 --- a/test/units/modules/monitoring/test_pagerduty_alert.py +++ b/test/units/modules/monitoring/test_pagerduty_alert.py @@ -1,7 +1,7 @@ from units.compat import unittest from ansible.modules.monitoring import pagerduty_alert -from ansible.module_utils.six.moves.urllib.parse import urlparse, urlencode, urlunparse +from ansible.module_utils.six.moves.urllib.parse import urlunparse class PagerDutyAlertsTest(unittest.TestCase): diff --git a/test/units/modules/network/checkpoint/test_cp_network.py b/test/units/modules/network/checkpoint/test_cp_network.py index 250ad6a65ad..d53d918e492 100644 --- a/test/units/modules/network/checkpoint/test_cp_network.py +++ b/test/units/modules/network/checkpoint/test_cp_network.py @@ -22,7 +22,7 @@ import pytest from units.modules.utils import set_module_args, exit_json, fail_json, AnsibleFailJson, AnsibleExitJson from ansible.module_utils import basic -from ansible.module_utils.network.checkpoint.checkpoint import checkpoint_argument_spec_for_objects, api_call +from ansible.module_utils.network.checkpoint.checkpoint import api_call from ansible.modules.network.checkpoint import cp_network diff --git a/test/units/modules/network/cli/test_cli_config.py b/test/units/modules/network/cli/test_cli_config.py index 4fa5f27a9e8..3e21fadc72e 100644 --- a/test/units/modules/network/cli/test_cli_config.py +++ b/test/units/modules/network/cli/test_cli_config.py @@ -22,7 +22,7 @@ __metaclass__ = type from units.compat.mock import patch, MagicMock from ansible.modules.network.cli import cli_config from units.modules.utils import set_module_args -from .cli_module import TestCliModule, load_fixture +from .cli_module import TestCliModule class TestCliConfigModule(TestCliModule): diff --git a/test/units/modules/network/junos/test_junos_rpc.py b/test/units/modules/network/junos/test_junos_rpc.py index 2fa4b95c1fd..e680ab6dfdd 100644 --- a/test/units/modules/network/junos/test_junos_rpc.py +++ b/test/units/modules/network/junos/test_junos_rpc.py @@ -20,9 +20,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type try: - from lxml.etree import tostring, fromstring + from lxml.etree import fromstring except ImportError: - from xml.etree.ElementTree import tostring, fromstring + from xml.etree.ElementTree import fromstring from units.compat.mock import patch from ansible.modules.network.junos import junos_rpc diff --git a/test/units/modules/network/netact/test_netact_cm_command.py b/test/units/modules/network/netact/test_netact_cm_command.py index e128979cb54..591a8b24c90 100644 --- a/test/units/modules/network/netact/test_netact_cm_command.py +++ b/test/units/modules/network/netact/test_netact_cm_command.py @@ -33,7 +33,7 @@ from ansible.module_utils._text import to_bytes from ansible.modules.network.netact import netact_cm_command from units.compat.mock import patch -from units.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase +from units.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson class AnsibleExitJson(Exception): diff --git a/test/units/modules/network/netscaler/test_netscaler_save_config.py b/test/units/modules/network/netscaler/test_netscaler_save_config.py index 2f4f0e7ea16..fa0067990a1 100644 --- a/test/units/modules/network/netscaler/test_netscaler_save_config.py +++ b/test/units/modules/network/netscaler/test_netscaler_save_config.py @@ -17,7 +17,7 @@ # along with Ansible. If not, see . # -from units.compat.mock import patch, Mock, MagicMock, call +from units.compat.mock import patch, Mock, call from units.modules.utils import set_module_args from .netscaler_module import TestModule, nitro_base_patcher diff --git a/test/units/modules/network/netvisor/test_pn_access_list_ip.py b/test/units/modules/network/netvisor/test_pn_access_list_ip.py index df6f6e8a490..244a6b2fa97 100644 --- a/test/units/modules/network/netvisor/test_pn_access_list_ip.py +++ b/test/units/modules/network/netvisor/test_pn_access_list_ip.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_access_list_ip from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAccessListIpModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_admin_service.py b/test/units/modules/network/netvisor/test_pn_admin_service.py index 41a4f9d6789..4032d8dc3a7 100644 --- a/test/units/modules/network/netvisor/test_pn_admin_service.py +++ b/test/units/modules/network/netvisor/test_pn_admin_service.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_admin_service from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAdminServiceModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_admin_session_timeout.py b/test/units/modules/network/netvisor/test_pn_admin_session_timeout.py index 7d39946645d..c31c107600e 100644 --- a/test/units/modules/network/netvisor/test_pn_admin_session_timeout.py +++ b/test/units/modules/network/netvisor/test_pn_admin_session_timeout.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_admin_session_timeout from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAdminServiceModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_admin_syslog.py b/test/units/modules/network/netvisor/test_pn_admin_syslog.py index 1bd22cb8516..25ed5631cd1 100644 --- a/test/units/modules/network/netvisor/test_pn_admin_syslog.py +++ b/test/units/modules/network/netvisor/test_pn_admin_syslog.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_admin_syslog from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAdminSyslogModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_connection_stats_settings.py b/test/units/modules/network/netvisor/test_pn_connection_stats_settings.py index 4cb3216eae3..521da134b37 100644 --- a/test/units/modules/network/netvisor/test_pn_connection_stats_settings.py +++ b/test/units/modules/network/netvisor/test_pn_connection_stats_settings.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_connection_stats_settings from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAdminServiceModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_cpu_class.py b/test/units/modules/network/netvisor/test_pn_cpu_class.py index 293d20356e9..63138db4d1b 100644 --- a/test/units/modules/network/netvisor/test_pn_cpu_class.py +++ b/test/units/modules/network/netvisor/test_pn_cpu_class.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_cpu_class from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestCpuClassModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_cpu_mgmt_class.py b/test/units/modules/network/netvisor/test_pn_cpu_mgmt_class.py index 2b3e04ef92f..be1dbd6ed44 100644 --- a/test/units/modules/network/netvisor/test_pn_cpu_mgmt_class.py +++ b/test/units/modules/network/netvisor/test_pn_cpu_mgmt_class.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_cpu_mgmt_class from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestCpuMgmtClassModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_dhcp_filter.py b/test/units/modules/network/netvisor/test_pn_dhcp_filter.py index bb179c8858a..accb11182bd 100644 --- a/test/units/modules/network/netvisor/test_pn_dhcp_filter.py +++ b/test/units/modules/network/netvisor/test_pn_dhcp_filter.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_dhcp_filter from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestDhcpFilterModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_dscp_map.py b/test/units/modules/network/netvisor/test_pn_dscp_map.py index eb965c2351d..07ad9c33ceb 100644 --- a/test/units/modules/network/netvisor/test_pn_dscp_map.py +++ b/test/units/modules/network/netvisor/test_pn_dscp_map.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_dscp_map from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestDscpMapModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_dscp_map_pri_map.py b/test/units/modules/network/netvisor/test_pn_dscp_map_pri_map.py index 656cd79571a..33dc90a48ff 100644 --- a/test/units/modules/network/netvisor/test_pn_dscp_map_pri_map.py +++ b/test/units/modules/network/netvisor/test_pn_dscp_map_pri_map.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_dscp_map_pri_map from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestCpuClassModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_fabric_local.py b/test/units/modules/network/netvisor/test_pn_fabric_local.py index 17a5501fbce..6dde01100fc 100644 --- a/test/units/modules/network/netvisor/test_pn_fabric_local.py +++ b/test/units/modules/network/netvisor/test_pn_fabric_local.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_fabric_local from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestFabricLocalModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_igmp_snooping.py b/test/units/modules/network/netvisor/test_pn_igmp_snooping.py index 87bf66fa87f..4cacbed7cda 100644 --- a/test/units/modules/network/netvisor/test_pn_igmp_snooping.py +++ b/test/units/modules/network/netvisor/test_pn_igmp_snooping.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_igmp_snooping from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAdminServiceModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_ipv6security_raguard.py b/test/units/modules/network/netvisor/test_pn_ipv6security_raguard.py index 84c5e05a25c..fc0e7c4ae54 100644 --- a/test/units/modules/network/netvisor/test_pn_ipv6security_raguard.py +++ b/test/units/modules/network/netvisor/test_pn_ipv6security_raguard.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_ipv6security_raguard from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestIPV6SecurityRaguardModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_port.py b/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_port.py index dc45b498aa2..adc9b56db7d 100644 --- a/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_port.py +++ b/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_port.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_ipv6security_raguard_port from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestIPV6SecurityRaguardPortModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_vlan.py b/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_vlan.py index b3e250f725b..58b2dac6889 100644 --- a/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_vlan.py +++ b/test/units/modules/network/netvisor/test_pn_ipv6security_raguard_vlan.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_ipv6security_raguard_vlan from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestIPV6SecurityReguardVlanModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_port_config.py b/test/units/modules/network/netvisor/test_pn_port_config.py index 2c9fc14cdda..514f8316434 100644 --- a/test/units/modules/network/netvisor/test_pn_port_config.py +++ b/test/units/modules/network/netvisor/test_pn_port_config.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_port_config from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestPortConfigModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_port_cos_bw.py b/test/units/modules/network/netvisor/test_pn_port_cos_bw.py index 7b3f5596b89..65d9b1417e6 100644 --- a/test/units/modules/network/netvisor/test_pn_port_cos_bw.py +++ b/test/units/modules/network/netvisor/test_pn_port_cos_bw.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_port_cos_bw from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestAdminServiceModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_port_cos_rate_setting.py b/test/units/modules/network/netvisor/test_pn_port_cos_rate_setting.py index 4144250edee..450e7d9d0f2 100644 --- a/test/units/modules/network/netvisor/test_pn_port_cos_rate_setting.py +++ b/test/units/modules/network/netvisor/test_pn_port_cos_rate_setting.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_port_cos_rate_setting from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestPortCosRateSettingModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_prefix_list.py b/test/units/modules/network/netvisor/test_pn_prefix_list.py index a95e96869b0..2c4d3e4388a 100644 --- a/test/units/modules/network/netvisor/test_pn_prefix_list.py +++ b/test/units/modules/network/netvisor/test_pn_prefix_list.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_prefix_list from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestPrefixListModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_prefix_list_network.py b/test/units/modules/network/netvisor/test_pn_prefix_list_network.py index 18cf6fa54f5..1eb9dbfe763 100644 --- a/test/units/modules/network/netvisor/test_pn_prefix_list_network.py +++ b/test/units/modules/network/netvisor/test_pn_prefix_list_network.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_prefix_list_network from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestPrefixListNetworkModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_role.py b/test/units/modules/network/netvisor/test_pn_role.py index 87ac2c2cd32..781418c2d07 100644 --- a/test/units/modules/network/netvisor/test_pn_role.py +++ b/test/units/modules/network/netvisor/test_pn_role.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_role from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestRoleModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_snmp_community.py b/test/units/modules/network/netvisor/test_pn_snmp_community.py index a5a0ec2ba38..fd4886a98d7 100644 --- a/test/units/modules/network/netvisor/test_pn_snmp_community.py +++ b/test/units/modules/network/netvisor/test_pn_snmp_community.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_snmp_community from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestSnmpCommunityModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_snmp_trap_sink.py b/test/units/modules/network/netvisor/test_pn_snmp_trap_sink.py index 95fb0facabb..85a12f02557 100644 --- a/test/units/modules/network/netvisor/test_pn_snmp_trap_sink.py +++ b/test/units/modules/network/netvisor/test_pn_snmp_trap_sink.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_snmp_trap_sink from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestSnmpTrapSinkModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_snmp_vacm.py b/test/units/modules/network/netvisor/test_pn_snmp_vacm.py index b1c3a67451c..593ce9a68b4 100644 --- a/test/units/modules/network/netvisor/test_pn_snmp_vacm.py +++ b/test/units/modules/network/netvisor/test_pn_snmp_vacm.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_snmp_vacm from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestSnmpVacmModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_stp.py b/test/units/modules/network/netvisor/test_pn_stp.py index 634e621872b..ebbb0827b00 100644 --- a/test/units/modules/network/netvisor/test_pn_stp.py +++ b/test/units/modules/network/netvisor/test_pn_stp.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_stp from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestStpModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_stp_port.py b/test/units/modules/network/netvisor/test_pn_stp_port.py index fb5e002ec0a..ffe7c73444a 100644 --- a/test/units/modules/network/netvisor/test_pn_stp_port.py +++ b/test/units/modules/network/netvisor/test_pn_stp_port.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_stp_port from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestStpPortModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_switch_setup.py b/test/units/modules/network/netvisor/test_pn_switch_setup.py index 8c2c77605bd..34c8339cb20 100644 --- a/test/units/modules/network/netvisor/test_pn_switch_setup.py +++ b/test/units/modules/network/netvisor/test_pn_switch_setup.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_switch_setup from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestSwitchSetupModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_user.py b/test/units/modules/network/netvisor/test_pn_user.py index 6d05f68af99..9a37fa93261 100644 --- a/test/units/modules/network/netvisor/test_pn_user.py +++ b/test/units/modules/network/netvisor/test_pn_user.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_user from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestUserModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vflow_table_profile.py b/test/units/modules/network/netvisor/test_pn_vflow_table_profile.py index 03bc02212c8..d31c0f8d48a 100644 --- a/test/units/modules/network/netvisor/test_pn_vflow_table_profile.py +++ b/test/units/modules/network/netvisor/test_pn_vflow_table_profile.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vflow_table_profile from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVflowTableProfileModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_bgp.py b/test/units/modules/network/netvisor/test_pn_vrouter_bgp.py index f5a759e989c..ca20c9eb345 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_bgp.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_bgp.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_bgp from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterBGPModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_bgp_network.py b/test/units/modules/network/netvisor/test_pn_vrouter_bgp_network.py index 5236f0f63e6..4b7ee6a7442 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_bgp_network.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_bgp_network.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_bgp_network from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterBGPNetworkModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_interface_ip.py b/test/units/modules/network/netvisor/test_pn_vrouter_interface_ip.py index 08e6cf68c0e..1e4e360b746 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_interface_ip.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_interface_ip.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_interface_ip from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterInterfaceIpModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_loopback_interface.py b/test/units/modules/network/netvisor/test_pn_vrouter_loopback_interface.py index 4d1823954f3..9bb2ba8dffd 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_loopback_interface.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_loopback_interface.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_loopback_interface from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterLoopbackInterfaceModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_ospf.py b/test/units/modules/network/netvisor/test_pn_vrouter_ospf.py index b44cb4364ba..d9d9fd5e29e 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_ospf.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_ospf.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_ospf from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterOSPFModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_ospf6.py b/test/units/modules/network/netvisor/test_pn_vrouter_ospf6.py index 38eb3ef3629..512348224a4 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_ospf6.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_ospf6.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_ospf6 from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterOSPF6Module(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_packet_relay.py b/test/units/modules/network/netvisor/test_pn_vrouter_packet_relay.py index 0a03cf7cbae..6258daedea9 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_packet_relay.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_packet_relay.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_packet_relay from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterPacketRelayModule(TestNvosModule): diff --git a/test/units/modules/network/netvisor/test_pn_vrouter_pim_config.py b/test/units/modules/network/netvisor/test_pn_vrouter_pim_config.py index cc19e9ca7ec..46261af9236 100644 --- a/test/units/modules/network/netvisor/test_pn_vrouter_pim_config.py +++ b/test/units/modules/network/netvisor/test_pn_vrouter_pim_config.py @@ -7,7 +7,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_pim_config from units.modules.utils import set_module_args -from .nvos_module import TestNvosModule, load_fixture +from .nvos_module import TestNvosModule class TestVrouterPimConfigModule(TestNvosModule): diff --git a/test/units/modules/network/nso/test_nso_config.py b/test/units/modules/network/nso/test_nso_config.py index 11c744d3dbc..64ed8f56c16 100644 --- a/test/units/modules/network/nso/test_nso_config.py +++ b/test/units/modules/network/nso/test_nso_config.py @@ -22,7 +22,7 @@ import json from units.compat.mock import patch from ansible.modules.network.nso import nso_config -from units.modules.utils import set_module_args, AnsibleFailJson +from units.modules.utils import set_module_args from . import nso_module from .nso_module import MockResponse diff --git a/test/units/modules/network/nuage/nuage_module.py b/test/units/modules/network/nuage/nuage_module.py index 417c9cdd0ff..8ded2fd989b 100644 --- a/test/units/modules/network/nuage/nuage_module.py +++ b/test/units/modules/network/nuage/nuage_module.py @@ -17,7 +17,7 @@ # along with Ansible. If not, see . from units.compat.mock import patch -from units.modules.utils import set_module_args as _set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase +from units.modules.utils import set_module_args as _set_module_args, ModuleTestCase import pytest diff --git a/test/units/modules/network/nxos/test_nxos_ospf.py b/test/units/modules/network/nxos/test_nxos_ospf.py index 13a8a965ca9..6f5cb3df82c 100644 --- a/test/units/modules/network/nxos/test_nxos_ospf.py +++ b/test/units/modules/network/nxos/test_nxos_ospf.py @@ -21,7 +21,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.nxos import nxos_ospf -from .nxos_module import TestNxosModule, load_fixture, set_module_args +from .nxos_module import TestNxosModule, set_module_args class TestNxosOspfModule(TestNxosModule): diff --git a/test/units/modules/network/nxos/test_nxos_pim_interface_bfd.py b/test/units/modules/network/nxos/test_nxos_pim_interface_bfd.py index 151ac3e8a4e..05375099e1c 100644 --- a/test/units/modules/network/nxos/test_nxos_pim_interface_bfd.py +++ b/test/units/modules/network/nxos/test_nxos_pim_interface_bfd.py @@ -21,7 +21,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.nxos import nxos_pim_interface -from .nxos_module import TestNxosModule, load_fixture, set_module_args +from .nxos_module import TestNxosModule, set_module_args class TestNxosPimInterfaceBfdModule(TestNxosModule): diff --git a/test/units/modules/network/opx/test_opx_cps.py b/test/units/modules/network/opx/test_opx_cps.py index 9a62820544c..d22850301be 100644 --- a/test/units/modules/network/opx/test_opx_cps.py +++ b/test/units/modules/network/opx/test_opx_cps.py @@ -22,7 +22,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from units.compat.mock import patch, Mock, MagicMock +from units.compat.mock import patch, Mock import sys sys.modules['cps'] = Mock(QUALIFIERS=[ "target", diff --git a/test/units/modules/network/vyos/test_vyos_banner.py b/test/units/modules/network/vyos/test_vyos_banner.py index 9e20f51b929..5837c5c5130 100644 --- a/test/units/modules/network/vyos/test_vyos_banner.py +++ b/test/units/modules/network/vyos/test_vyos_banner.py @@ -20,7 +20,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.vyos import vyos_banner from units.modules.utils import set_module_args -from .vyos_module import TestVyosModule, load_fixture +from .vyos_module import TestVyosModule class TestVyosBannerModule(TestVyosModule): diff --git a/test/units/modules/network/vyos/test_vyos_static_route.py b/test/units/modules/network/vyos/test_vyos_static_route.py index bee37a7a0d6..405b633992b 100644 --- a/test/units/modules/network/vyos/test_vyos_static_route.py +++ b/test/units/modules/network/vyos/test_vyos_static_route.py @@ -22,7 +22,7 @@ __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.vyos import vyos_static_route from units.modules.utils import set_module_args -from .vyos_module import TestVyosModule, load_fixture +from .vyos_module import TestVyosModule class TestVyosStaticRouteModule(TestVyosModule): diff --git a/test/units/modules/remote_management/oneview/oneview_module_loader.py b/test/units/modules/remote_management/oneview/oneview_module_loader.py index e0b0789f2c0..8d9eeaa0add 100644 --- a/test/units/modules/remote_management/oneview/oneview_module_loader.py +++ b/test/units/modules/remote_management/oneview/oneview_module_loader.py @@ -2,7 +2,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import sys -from units.compat.mock import patch, Mock +from units.compat.mock import Mock # FIXME: These should be done inside of a fixture so that they're only mocked during # these unittests diff --git a/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py b/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py index deddd8e39bf..fa89e22f082 100644 --- a/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py +++ b/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py @@ -18,7 +18,7 @@ import yaml from units.compat import unittest, mock -from oneview_module_loader import EthernetNetworkModule, OneViewModuleResourceNotFound +from oneview_module_loader import EthernetNetworkModule from hpe_test_utils import OneViewBaseTestCase FAKE_MSG_ERROR = 'Fake message error' diff --git a/test/units/modules/remote_management/oneview/test_oneview_ethernet_network_facts.py b/test/units/modules/remote_management/oneview/test_oneview_ethernet_network_facts.py index c00b8bcde5f..7b8944c8ccc 100644 --- a/test/units/modules/remote_management/oneview/test_oneview_ethernet_network_facts.py +++ b/test/units/modules/remote_management/oneview/test_oneview_ethernet_network_facts.py @@ -1,7 +1,7 @@ # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -from units.compat import unittest, mock +from units.compat import unittest from oneview_module_loader import EthernetNetworkFactsModule from hpe_test_utils import FactsParamsTestCase diff --git a/test/units/modules/storage/netapp/test_na_ontap_gather_facts.py b/test/units/modules/storage/netapp/test_na_ontap_gather_facts.py index c5c12d853b5..30028486a4c 100644 --- a/test/units/modules/storage/netapp/test_na_ontap_gather_facts.py +++ b/test/units/modules/storage/netapp/test_na_ontap_gather_facts.py @@ -9,7 +9,7 @@ import pytest import sys from units.compat import unittest -from units.compat.mock import patch, Mock +from units.compat.mock import patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes import ansible.module_utils.netapp as netapp_utils diff --git a/test/units/modules/storage/netapp/test_na_ontap_motd.py b/test/units/modules/storage/netapp/test_na_ontap_motd.py index a3b031aa739..dec9d2e91d4 100644 --- a/test/units/modules/storage/netapp/test_na_ontap_motd.py +++ b/test/units/modules/storage/netapp/test_na_ontap_motd.py @@ -8,7 +8,7 @@ import json import pytest from units.compat import unittest -from units.compat.mock import patch, Mock +from units.compat.mock import patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes import ansible.module_utils.netapp as netapp_utils diff --git a/test/units/modules/storage/netapp/test_na_ontap_vscan.py b/test/units/modules/storage/netapp/test_na_ontap_vscan.py index ba2fb2e73a1..bdc9eb1c59e 100644 --- a/test/units/modules/storage/netapp/test_na_ontap_vscan.py +++ b/test/units/modules/storage/netapp/test_na_ontap_vscan.py @@ -8,7 +8,7 @@ import json import pytest from units.compat import unittest -from units.compat.mock import patch, Mock +from units.compat.mock import patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes import ansible.module_utils.netapp as netapp_utils diff --git a/test/units/modules/storage/netapp/test_na_ontap_vscan_on_access_policy.py b/test/units/modules/storage/netapp/test_na_ontap_vscan_on_access_policy.py index fc9d9129a8c..50494f54ab5 100644 --- a/test/units/modules/storage/netapp/test_na_ontap_vscan_on_access_policy.py +++ b/test/units/modules/storage/netapp/test_na_ontap_vscan_on_access_policy.py @@ -8,7 +8,7 @@ import json import pytest from units.compat import unittest -from units.compat.mock import patch, Mock +from units.compat.mock import patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes import ansible.module_utils.netapp as netapp_utils diff --git a/test/units/modules/storage/netapp/test_netapp_e_global.py b/test/units/modules/storage/netapp/test_netapp_e_global.py index ff13bd3b565..0526aff9c77 100644 --- a/test/units/modules/storage/netapp/test_netapp_e_global.py +++ b/test/units/modules/storage/netapp/test_netapp_e_global.py @@ -3,7 +3,7 @@ from ansible.modules.storage.netapp.netapp_e_global import GlobalSettings -from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type from units.compat import mock diff --git a/test/units/modules/storage/netapp/test_netapp_e_host.py b/test/units/modules/storage/netapp/test_netapp_e_host.py index aedd7603f5f..4646805b46a 100644 --- a/test/units/modules/storage/netapp/test_netapp_e_host.py +++ b/test/units/modules/storage/netapp/test_netapp_e_host.py @@ -3,7 +3,7 @@ from mock import MagicMock -from ansible.module_utils import basic, netapp +from ansible.module_utils import netapp from ansible.modules.storage.netapp import netapp_e_host from ansible.modules.storage.netapp.netapp_e_host import Host from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args diff --git a/test/units/modules/storage/netapp/test_netapp_e_iscsi_interface.py b/test/units/modules/storage/netapp/test_netapp_e_iscsi_interface.py index 8da1d3289f4..19afe881a82 100644 --- a/test/units/modules/storage/netapp/test_netapp_e_iscsi_interface.py +++ b/test/units/modules/storage/netapp/test_netapp_e_iscsi_interface.py @@ -3,7 +3,7 @@ from mock import MagicMock -from ansible.module_utils import basic, netapp +from ansible.module_utils import netapp from ansible.modules.storage.netapp import netapp_e_host from ansible.modules.storage.netapp.netapp_e_host import Host from ansible.modules.storage.netapp.netapp_e_iscsi_interface import IscsiInterface diff --git a/test/units/modules/storage/netapp/test_netapp_e_iscsi_target.py b/test/units/modules/storage/netapp/test_netapp_e_iscsi_target.py index 8f44fb06c22..249c3adce3a 100644 --- a/test/units/modules/storage/netapp/test_netapp_e_iscsi_target.py +++ b/test/units/modules/storage/netapp/test_netapp_e_iscsi_target.py @@ -5,7 +5,7 @@ from mock import MagicMock from ansible.modules.storage.netapp.netapp_e_iscsi_target import IscsiTarget -from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type diff --git a/test/units/modules/storage/netapp/test_netapp_e_syslog.py b/test/units/modules/storage/netapp/test_netapp_e_syslog.py index ca02e28919e..ff8e3a96729 100644 --- a/test/units/modules/storage/netapp/test_netapp_e_syslog.py +++ b/test/units/modules/storage/netapp/test_netapp_e_syslog.py @@ -3,7 +3,7 @@ from ansible.modules.storage.netapp.netapp_e_syslog import Syslog from ansible.module_utils.six.moves.urllib.error import HTTPError -from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type from units.compat import mock diff --git a/test/units/modules/storage/netapp/test_netapp_e_volume.py b/test/units/modules/storage/netapp/test_netapp_e_volume.py index 77d113268b0..e91016b557e 100644 --- a/test/units/modules/storage/netapp/test_netapp_e_volume.py +++ b/test/units/modules/storage/netapp/test_netapp_e_volume.py @@ -9,7 +9,7 @@ except ImportError: from ansible.module_utils.netapp import NetAppESeriesModule from ansible.modules.storage.netapp.netapp_e_volume import NetAppESeriesVolume -from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type diff --git a/test/units/playbook/test_play.py b/test/units/playbook/test_play.py index 1bce51f67aa..d0848c236a4 100644 --- a/test/units/playbook/test_play.py +++ b/test/units/playbook/test_play.py @@ -22,7 +22,7 @@ __metaclass__ = type from units.compat import unittest from units.compat.mock import patch, MagicMock -from ansible.errors import AnsibleError, AnsibleParserError +from ansible.errors import AnsibleParserError from ansible.playbook.block import Block from ansible.playbook.play import Play from ansible.playbook.role import Role diff --git a/test/units/playbook/test_playbook.py b/test/units/playbook/test_playbook.py index 5220aed750f..5c5217e5cc7 100644 --- a/test/units/playbook/test_playbook.py +++ b/test/units/playbook/test_playbook.py @@ -20,8 +20,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat import unittest -from units.compat.mock import patch, MagicMock -from ansible.errors import AnsibleError, AnsibleParserError +from units.compat.mock import MagicMock +from ansible.errors import AnsibleParserError from ansible.playbook import Playbook from ansible.vars.manager import VariableManager diff --git a/test/units/plugins/action/test_raw.py b/test/units/plugins/action/test_raw.py index 455c910d7d1..34442a8442c 100644 --- a/test/units/plugins/action/test_raw.py +++ b/test/units/plugins/action/test_raw.py @@ -22,7 +22,7 @@ import os from ansible.errors import AnsibleActionFail from units.compat import unittest -from units.compat.mock import patch, MagicMock, Mock +from units.compat.mock import MagicMock, Mock from ansible.plugins.action.raw import ActionModule from ansible.playbook.task import Task from ansible.plugins.loader import connection_loader diff --git a/test/units/plugins/action/test_win_updates.py b/test/units/plugins/action/test_win_updates.py index 1eb9baddb5e..f07d1c61ea5 100644 --- a/test/units/plugins/action/test_win_updates.py +++ b/test/units/plugins/action/test_win_updates.py @@ -8,7 +8,7 @@ __metaclass__ = type import pytest -from units.compat.mock import patch, MagicMock, mock_open +from units.compat.mock import patch, MagicMock from ansible.plugins.action.win_updates import ActionModule from ansible.playbook.task import Task diff --git a/test/units/plugins/callback/test_callback.py b/test/units/plugins/callback/test_callback.py index b69a59ced58..52233800f36 100644 --- a/test/units/plugins/callback/test_callback.py +++ b/test/units/plugins/callback/test_callback.py @@ -25,7 +25,7 @@ import textwrap import types from units.compat import unittest -from units.compat.mock import patch, mock_open, MagicMock +from units.compat.mock import MagicMock from ansible.plugins.callback import CallbackBase diff --git a/test/units/plugins/cliconf/test_ios.py b/test/units/plugins/cliconf/test_ios.py index 3f3e9ddb466..44650b84b89 100644 --- a/test/units/plugins/cliconf/test_ios.py +++ b/test/units/plugins/cliconf/test_ios.py @@ -22,7 +22,7 @@ __metaclass__ = type from os import path import json -from mock import MagicMock, call +from mock import MagicMock from units.compat import unittest from ansible.plugins.cliconf import ios diff --git a/test/units/plugins/httpapi/test_checkpoint.py b/test/units/plugins/httpapi/test_checkpoint.py index a98237bc513..7d4695487bc 100644 --- a/test/units/plugins/httpapi/test_checkpoint.py +++ b/test/units/plugins/httpapi/test_checkpoint.py @@ -7,7 +7,7 @@ from ansible.module_utils.six.moves.urllib.error import HTTPError from units.compat import mock from units.compat import unittest from units.compat.builtins import BUILTINS -from units.compat.mock import mock_open, patch +from units.compat.mock import patch from ansible.errors import AnsibleConnectionFailure from ansible.module_utils.connection import ConnectionError diff --git a/test/units/plugins/strategy/test_strategy_base.py b/test/units/plugins/strategy/test_strategy_base.py index 841828c9b53..578acaae361 100644 --- a/test/units/plugins/strategy/test_strategy_base.py +++ b/test/units/plugins/strategy/test_strategy_base.py @@ -25,7 +25,7 @@ import uuid from units.compat import unittest from units.compat.mock import patch, MagicMock -from ansible.errors import AnsibleError, AnsibleParserError +from ansible.errors import AnsibleParserError from ansible.executor.process.worker import WorkerProcess from ansible.executor.task_queue_manager import TaskQueueManager from ansible.executor.task_result import TaskResult diff --git a/test/units/plugins/test_plugins.py b/test/units/plugins/test_plugins.py index 444fae8c1fb..03d627c5f74 100644 --- a/test/units/plugins/test_plugins.py +++ b/test/units/plugins/test_plugins.py @@ -24,8 +24,8 @@ import os from units.compat import unittest from units.compat.builtins import BUILTINS -from units.compat.mock import mock_open, patch, MagicMock -from ansible.plugins.loader import MODULE_CACHE, PATH_CACHE, PLUGIN_PATH_CACHE, PluginLoader +from units.compat.mock import patch, MagicMock +from ansible.plugins.loader import PluginLoader class TestErrors(unittest.TestCase): diff --git a/test/units/template/test_safe_eval.py b/test/units/template/test_safe_eval.py index 091e59fb45b..af308b052ce 100644 --- a/test/units/template/test_safe_eval.py +++ b/test/units/template/test_safe_eval.py @@ -23,7 +23,7 @@ import sys from collections import defaultdict from units.compat import unittest -from units.compat.mock import patch, MagicMock +from units.compat.mock import MagicMock from ansible.template.safe_eval import safe_eval