Unit tests: remove unused imports (#59740)

pull/59748/head
Andrey Klychkov 5 years ago committed by Felix Fontein
parent 8944be32bf
commit 32de51adac

@ -17,8 +17,6 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
from units.compat import unittest
from ansible.module_utils.hwc_utils import are_different_dicts

@ -8,7 +8,7 @@ __metaclass__ = type
import datetime
import os
from ansible.module_utils.urls import (Request, open_url, urllib_request, HAS_SSLCONTEXT, cookiejar, ConnectionError, RequestWithMethod,
from ansible.module_utils.urls import (Request, open_url, urllib_request, HAS_SSLCONTEXT, cookiejar, RequestWithMethod,
UnixHTTPHandler, UnixHTTPSConnection, httplib)
from ansible.module_utils.urls import SSLValidationHandler, HTTPSClientAuthHandler, RedirectHandlerFactory

@ -7,8 +7,6 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException

@ -1,5 +1,3 @@
import pytest
from ansible.modules.cloud.amazon import ec2_group as group_module

@ -1,8 +1,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_bgp
from units.modules.utils import set_module_args

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_command
from units.modules.utils import set_module_args

@ -20,8 +20,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_config

@ -20,9 +20,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_interface
from units.modules.utils import set_module_args

@ -19,9 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_l2_interface
from units.modules.utils import set_module_args

@ -19,9 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_l3_interface
from units.modules.utils import set_module_args

@ -20,9 +20,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_linkagg
from units.modules.utils import set_module_args

@ -19,9 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_lldp
from units.modules.utils import set_module_args

@ -21,8 +21,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_logging
from units.modules.utils import set_module_args

@ -1,8 +1,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_vlag
from units.modules.utils import set_module_args

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_vlan
from ansible.modules.network.cnos.cnos_vlan import parse_vlan_brief

@ -18,8 +18,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.edgeswitch import edgeswitch_facts
from units.modules.utils import set_module_args

@ -18,8 +18,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.edgeswitch import edgeswitch_vlan
from ansible.modules.network.edgeswitch.edgeswitch_vlan import parse_vlan_brief, parse_interfaces_switchport

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.enos import enos_command
from units.modules.utils import set_module_args

@ -20,8 +20,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.enos import enos_config
from .enos_module import TestEnosModule, load_fixture

@ -17,8 +17,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from ansible.module_utils.network.fortios.fortios import FortiOSHandler

@ -21,8 +21,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.ios import ios_logging
from units.modules.utils import set_module_args

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.ios import ios_user
from units.modules.utils import set_module_args

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.ios import ios_vlan
from ansible.modules.network.ios.ios_vlan import parse_vlan_brief

@ -4,7 +4,6 @@ netact_cm_command unit tests
# -*- coding: utf-8 -*-
# (c) 2017, Nokia
# This file is part of Ansible
#
@ -28,8 +27,6 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat import unittest
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes

@ -22,7 +22,6 @@ from .netscaler_module import TestModule
import copy
import tempfile
import json
import sys
import codecs
from ansible.modules.network.netscaler import netscaler_nitro_request

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_access_list_ip
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_admin_service
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_admin_session_timeout
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_admin_syslog
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_connection_stats_settings
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_cpu_class
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_cpu_mgmt_class
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_dhcp_filter
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_dscp_map
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
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

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_fabric_local
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_igmp_snooping
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_ipv6security_raguard
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_ipv6security_raguard_port
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_ipv6security_raguard_vlan
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_port_config
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_port_cos_bw
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
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

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_prefix_list
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_prefix_list_network
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_role
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_snmp_community
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_snmp_trap_sink
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_snmp_vacm
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_stp
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_stp_port
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_switch_setup
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_user
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vflow_table_profile
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_bgp
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_bgp_network
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_interface_ip
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_loopback_interface
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_ospf
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_ospf6
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_packet_relay
from units.modules.utils import set_module_args

@ -4,8 +4,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_pim_config
from units.modules.utils import set_module_args

@ -18,8 +18,6 @@
from __future__ import (absolute_import, division, print_function)
import json
from units.compat.mock import patch
from ansible.modules.network.nso import nso_show
from . import nso_module

@ -20,8 +20,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.onyx import onyx_lldp
from units.modules.utils import set_module_args

@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import os
from units.compat.mock import patch, MagicMock
from units.compat import unittest

@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import os
from units.compat.mock import patch, MagicMock
from units.compat import unittest

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.vyos import vyos_command
from units.modules.utils import set_module_args

@ -1,7 +1,6 @@
# Copyright (c) 2018 Antoine Catton
# MIT License (see licenses/MIT-license.txt or https://opensource.org/licenses/MIT)
import copy
import json
import pytest

@ -1,5 +1,4 @@
import collections
import os
import sys
from units.compat import mock

@ -1,4 +1,3 @@
import contextlib
import json
import os

@ -4,7 +4,6 @@
import mock
import pytest
import sys
sys.modules['hpe3par_sdk'] = mock.Mock()
sys.modules['hpe3par_sdk.client'] = mock.Mock()

@ -4,7 +4,6 @@ from __future__ import print_function
import json
import pytest
import time
from units.compat import unittest
from units.compat.mock import patch, Mock
from ansible.module_utils import basic

@ -1,6 +1,5 @@
# (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
from ansible.modules.storage.netapp.netapp_e_alerts import Alerts
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args

@ -9,10 +9,7 @@ from ansible.modules.storage.netapp.netapp_e_host import Host
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
__metaclass__ = type
import unittest
import mock
import pytest
import json
from units.compat.mock import patch
from ansible.module_utils._text import to_bytes

@ -10,10 +10,7 @@ from ansible.modules.storage.netapp.netapp_e_iscsi_interface import IscsiInterfa
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
__metaclass__ = type
import unittest
import mock
import pytest
import json
from units.compat.mock import patch
from ansible.module_utils._text import to_bytes

@ -1,11 +1,9 @@
# (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
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
import time
__metaclass__ = type
from units.compat import mock

@ -1,5 +1,3 @@
import os
import tempfile
from units.compat import unittest
from ansible.modules.system.systemd import parse_systemctl_show

@ -12,7 +12,6 @@
import json
import os
import sys
import unittest
import yaml

@ -27,8 +27,6 @@ import types
from units.compat import unittest
from units.compat.mock import patch, mock_open, MagicMock
import pytest
from ansible.plugins.callback import CallbackBase

@ -21,8 +21,6 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
import re
import json
import pytest
from io import StringIO

@ -21,7 +21,6 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import time
import json
from io import StringIO

@ -20,7 +20,6 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from os import path
import json
from mock import MagicMock

@ -6,9 +6,6 @@
from __future__ import (absolute_import, division)
__metaclass__ = type
import pytest
from ansible import context

@ -1,4 +1,3 @@
import json
import pytest
from units.compat.mock import MagicMock

@ -16,7 +16,6 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import pytest
import sys
from ansible.errors import AnsibleError, AnsibleFilterError
from ansible.plugins.filter.core import get_encrypted_password

Loading…
Cancel
Save