Unit tests: remove unused imports (#59812)

* Unit tests: remove unused imports

* Unit tests: remove unused imports, fix
This commit is contained in:
Andrey Klychkov 2019-08-02 18:18:14 +03:00 committed by Felix Fontein
parent fc558fb85f
commit 64e3cb0fa8
84 changed files with 87 additions and 87 deletions

View file

@ -22,7 +22,7 @@ import sys
from units.compat import unittest from units.compat import unittest
from ansible.module_utils.network.aci.aci import ACIModule 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 from ansible.module_utils._text import to_native
import pytest import pytest

View file

@ -13,7 +13,7 @@ import os
import json import json
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FakeAnsibleModule
from ansible.module_utils import six from ansible.module_utils import six
from mock import MagicMock from mock import MagicMock

View file

@ -9,7 +9,7 @@ __metaclass__ = type
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from .common import testcase_bad_xenapi_refs from .common import testcase_bad_xenapi_refs

View file

@ -9,7 +9,7 @@ __metaclass__ = type
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from .common import fake_xenapi_ref from .common import fake_xenapi_ref

View file

@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
def test_xapi_to_module_vm_power_state_bad_power_state(xenserver): def test_xapi_to_module_vm_power_state_bad_power_state(xenserver):

View file

@ -9,7 +9,7 @@ __metaclass__ = type
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from ansible.module_utils.common.network import is_mac from ansible.module_utils.common.network import is_mac
testcase_is_valid_mac_addr = [ testcase_is_valid_mac_addr = [

View file

@ -9,7 +9,7 @@ __metaclass__ = type
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from .common import fake_xenapi_ref, testcase_bad_xenapi_refs from .common import fake_xenapi_ref, testcase_bad_xenapi_refs

View file

@ -9,7 +9,7 @@ __metaclass__ = type
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from .common import fake_xenapi_ref, testcase_bad_xenapi_refs from .common import fake_xenapi_ref, testcase_bad_xenapi_refs

View file

@ -10,7 +10,7 @@ __metaclass__ = type
import pytest import pytest
import atexit import atexit
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from ansible.module_utils.ansible_release import __version__ as ANSIBLE_VERSION from ansible.module_utils.ansible_release import __version__ as ANSIBLE_VERSION

View file

@ -9,7 +9,7 @@ __metaclass__ = type
import pytest import pytest
from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .FakeAnsibleModule import FailJsonException
from .common import fake_xenapi_ref from .common import fake_xenapi_ref

View file

@ -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.s3_bucket_notification import AmazonBucket, Config
from ansible.modules.cloud.amazon import s3_bucket_notification from ansible.modules.cloud.amazon import s3_bucket_notification
try: try:
from botocore.exceptions import ClientError, ParamValidationError, BotoCoreError from botocore.exceptions import ClientError
except ImportError: except ImportError:
pass pass

View file

@ -1,7 +1,7 @@
from units.compat import unittest from units.compat import unittest
from ansible.modules.monitoring import pagerduty_alert 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): class PagerDutyAlertsTest(unittest.TestCase):

View file

@ -22,7 +22,7 @@ import pytest
from units.modules.utils import set_module_args, exit_json, fail_json, AnsibleFailJson, AnsibleExitJson from units.modules.utils import set_module_args, exit_json, fail_json, AnsibleFailJson, AnsibleExitJson
from ansible.module_utils import basic 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 from ansible.modules.network.checkpoint import cp_network

View file

@ -22,7 +22,7 @@ __metaclass__ = type
from units.compat.mock import patch, MagicMock from units.compat.mock import patch, MagicMock
from ansible.modules.network.cli import cli_config from ansible.modules.network.cli import cli_config
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .cli_module import TestCliModule, load_fixture from .cli_module import TestCliModule
class TestCliConfigModule(TestCliModule): class TestCliConfigModule(TestCliModule):

View file

@ -20,9 +20,9 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
try: try:
from lxml.etree import tostring, fromstring from lxml.etree import fromstring
except ImportError: except ImportError:
from xml.etree.ElementTree import tostring, fromstring from xml.etree.ElementTree import fromstring
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.junos import junos_rpc from ansible.modules.network.junos import junos_rpc

View file

@ -33,7 +33,7 @@ from ansible.module_utils._text import to_bytes
from ansible.modules.network.netact import netact_cm_command from ansible.modules.network.netact import netact_cm_command
from units.compat.mock import patch 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): class AnsibleExitJson(Exception):

View file

@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# #
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 units.modules.utils import set_module_args
from .netscaler_module import TestModule, nitro_base_patcher from .netscaler_module import TestModule, nitro_base_patcher

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_access_list_ip from ansible.modules.network.netvisor import pn_access_list_ip
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAccessListIpModule(TestNvosModule): class TestAccessListIpModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_admin_service from ansible.modules.network.netvisor import pn_admin_service
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAdminServiceModule(TestNvosModule): class TestAdminServiceModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_admin_session_timeout from ansible.modules.network.netvisor import pn_admin_session_timeout
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAdminServiceModule(TestNvosModule): class TestAdminServiceModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_admin_syslog from ansible.modules.network.netvisor import pn_admin_syslog
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAdminSyslogModule(TestNvosModule): class TestAdminSyslogModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_connection_stats_settings from ansible.modules.network.netvisor import pn_connection_stats_settings
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAdminServiceModule(TestNvosModule): class TestAdminServiceModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_cpu_class from ansible.modules.network.netvisor import pn_cpu_class
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestCpuClassModule(TestNvosModule): class TestCpuClassModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_cpu_mgmt_class from ansible.modules.network.netvisor import pn_cpu_mgmt_class
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestCpuMgmtClassModule(TestNvosModule): class TestCpuMgmtClassModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_dhcp_filter from ansible.modules.network.netvisor import pn_dhcp_filter
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestDhcpFilterModule(TestNvosModule): class TestDhcpFilterModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_dscp_map from ansible.modules.network.netvisor import pn_dscp_map
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestDscpMapModule(TestNvosModule): class TestDscpMapModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_dscp_map_pri_map from ansible.modules.network.netvisor import pn_dscp_map_pri_map
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestCpuClassModule(TestNvosModule): class TestCpuClassModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_fabric_local from ansible.modules.network.netvisor import pn_fabric_local
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestFabricLocalModule(TestNvosModule): class TestFabricLocalModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_igmp_snooping from ansible.modules.network.netvisor import pn_igmp_snooping
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAdminServiceModule(TestNvosModule): class TestAdminServiceModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_ipv6security_raguard from ansible.modules.network.netvisor import pn_ipv6security_raguard
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestIPV6SecurityRaguardModule(TestNvosModule): class TestIPV6SecurityRaguardModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_ipv6security_raguard_port from ansible.modules.network.netvisor import pn_ipv6security_raguard_port
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestIPV6SecurityRaguardPortModule(TestNvosModule): class TestIPV6SecurityRaguardPortModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_ipv6security_raguard_vlan from ansible.modules.network.netvisor import pn_ipv6security_raguard_vlan
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestIPV6SecurityReguardVlanModule(TestNvosModule): class TestIPV6SecurityReguardVlanModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_port_config from ansible.modules.network.netvisor import pn_port_config
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestPortConfigModule(TestNvosModule): class TestPortConfigModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_port_cos_bw from ansible.modules.network.netvisor import pn_port_cos_bw
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestAdminServiceModule(TestNvosModule): class TestAdminServiceModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_port_cos_rate_setting from ansible.modules.network.netvisor import pn_port_cos_rate_setting
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestPortCosRateSettingModule(TestNvosModule): class TestPortCosRateSettingModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_prefix_list from ansible.modules.network.netvisor import pn_prefix_list
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestPrefixListModule(TestNvosModule): class TestPrefixListModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_prefix_list_network from ansible.modules.network.netvisor import pn_prefix_list_network
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestPrefixListNetworkModule(TestNvosModule): class TestPrefixListNetworkModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_role from ansible.modules.network.netvisor import pn_role
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestRoleModule(TestNvosModule): class TestRoleModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_snmp_community from ansible.modules.network.netvisor import pn_snmp_community
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestSnmpCommunityModule(TestNvosModule): class TestSnmpCommunityModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_snmp_trap_sink from ansible.modules.network.netvisor import pn_snmp_trap_sink
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestSnmpTrapSinkModule(TestNvosModule): class TestSnmpTrapSinkModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_snmp_vacm from ansible.modules.network.netvisor import pn_snmp_vacm
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestSnmpVacmModule(TestNvosModule): class TestSnmpVacmModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_stp from ansible.modules.network.netvisor import pn_stp
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestStpModule(TestNvosModule): class TestStpModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_stp_port from ansible.modules.network.netvisor import pn_stp_port
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestStpPortModule(TestNvosModule): class TestStpPortModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_switch_setup from ansible.modules.network.netvisor import pn_switch_setup
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestSwitchSetupModule(TestNvosModule): class TestSwitchSetupModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_user from ansible.modules.network.netvisor import pn_user
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestUserModule(TestNvosModule): class TestUserModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vflow_table_profile from ansible.modules.network.netvisor import pn_vflow_table_profile
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVflowTableProfileModule(TestNvosModule): class TestVflowTableProfileModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_bgp from ansible.modules.network.netvisor import pn_vrouter_bgp
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterBGPModule(TestNvosModule): class TestVrouterBGPModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_bgp_network from ansible.modules.network.netvisor import pn_vrouter_bgp_network
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterBGPNetworkModule(TestNvosModule): class TestVrouterBGPNetworkModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_interface_ip from ansible.modules.network.netvisor import pn_vrouter_interface_ip
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterInterfaceIpModule(TestNvosModule): class TestVrouterInterfaceIpModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_loopback_interface from ansible.modules.network.netvisor import pn_vrouter_loopback_interface
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterLoopbackInterfaceModule(TestNvosModule): class TestVrouterLoopbackInterfaceModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_ospf from ansible.modules.network.netvisor import pn_vrouter_ospf
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterOSPFModule(TestNvosModule): class TestVrouterOSPFModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_ospf6 from ansible.modules.network.netvisor import pn_vrouter_ospf6
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterOSPF6Module(TestNvosModule): class TestVrouterOSPF6Module(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_packet_relay from ansible.modules.network.netvisor import pn_vrouter_packet_relay
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterPacketRelayModule(TestNvosModule): class TestVrouterPacketRelayModule(TestNvosModule):

View file

@ -7,7 +7,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_pim_config from ansible.modules.network.netvisor import pn_vrouter_pim_config
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule, load_fixture from .nvos_module import TestNvosModule
class TestVrouterPimConfigModule(TestNvosModule): class TestVrouterPimConfigModule(TestNvosModule):

View file

@ -22,7 +22,7 @@ import json
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.nso import nso_config 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 . import nso_module
from .nso_module import MockResponse from .nso_module import MockResponse

View file

@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from units.compat.mock import patch 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 import pytest

View file

@ -21,7 +21,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.nxos import nxos_ospf 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): class TestNxosOspfModule(TestNxosModule):

View file

@ -21,7 +21,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.nxos import nxos_pim_interface 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): class TestNxosPimInterfaceBfdModule(TestNxosModule):

View file

@ -22,7 +22,7 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
from units.compat.mock import patch, Mock, MagicMock from units.compat.mock import patch, Mock
import sys import sys
sys.modules['cps'] = Mock(QUALIFIERS=[ sys.modules['cps'] = Mock(QUALIFIERS=[
"target", "target",

View file

@ -20,7 +20,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.vyos import vyos_banner from ansible.modules.network.vyos import vyos_banner
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .vyos_module import TestVyosModule, load_fixture from .vyos_module import TestVyosModule
class TestVyosBannerModule(TestVyosModule): class TestVyosBannerModule(TestVyosModule):

View file

@ -22,7 +22,7 @@ __metaclass__ = type
from units.compat.mock import patch from units.compat.mock import patch
from ansible.modules.network.vyos import vyos_static_route from ansible.modules.network.vyos import vyos_static_route
from units.modules.utils import set_module_args from units.modules.utils import set_module_args
from .vyos_module import TestVyosModule, load_fixture from .vyos_module import TestVyosModule
class TestVyosStaticRouteModule(TestVyosModule): class TestVyosStaticRouteModule(TestVyosModule):

View file

@ -2,7 +2,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import sys 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 # FIXME: These should be done inside of a fixture so that they're only mocked during
# these unittests # these unittests

View file

@ -18,7 +18,7 @@
import yaml import yaml
from units.compat import unittest, mock 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 from hpe_test_utils import OneViewBaseTestCase
FAKE_MSG_ERROR = 'Fake message error' FAKE_MSG_ERROR = 'Fake message error'

View file

@ -1,7 +1,7 @@
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # 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) # 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 oneview_module_loader import EthernetNetworkFactsModule
from hpe_test_utils import FactsParamsTestCase from hpe_test_utils import FactsParamsTestCase

View file

@ -9,7 +9,7 @@ import pytest
import sys import sys
from units.compat import unittest 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 import basic
from ansible.module_utils._text import to_bytes from ansible.module_utils._text import to_bytes
import ansible.module_utils.netapp as netapp_utils import ansible.module_utils.netapp as netapp_utils

View file

@ -8,7 +8,7 @@ import json
import pytest import pytest
from units.compat import unittest 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 import basic
from ansible.module_utils._text import to_bytes from ansible.module_utils._text import to_bytes
import ansible.module_utils.netapp as netapp_utils import ansible.module_utils.netapp as netapp_utils

View file

@ -8,7 +8,7 @@ import json
import pytest import pytest
from units.compat import unittest 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 import basic
from ansible.module_utils._text import to_bytes from ansible.module_utils._text import to_bytes
import ansible.module_utils.netapp as netapp_utils import ansible.module_utils.netapp as netapp_utils

View file

@ -8,7 +8,7 @@ import json
import pytest import pytest
from units.compat import unittest 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 import basic
from ansible.module_utils._text import to_bytes from ansible.module_utils._text import to_bytes
import ansible.module_utils.netapp as netapp_utils import ansible.module_utils.netapp as netapp_utils

View file

@ -3,7 +3,7 @@
from ansible.modules.storage.netapp.netapp_e_global import GlobalSettings 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 __metaclass__ = type
from units.compat import mock from units.compat import mock

View file

@ -3,7 +3,7 @@
from mock import MagicMock 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 import netapp_e_host
from ansible.modules.storage.netapp.netapp_e_host import Host from ansible.modules.storage.netapp.netapp_e_host import Host
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args

View file

@ -3,7 +3,7 @@
from mock import MagicMock 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 import netapp_e_host
from ansible.modules.storage.netapp.netapp_e_host import Host from ansible.modules.storage.netapp.netapp_e_host import Host
from ansible.modules.storage.netapp.netapp_e_iscsi_interface import IscsiInterface from ansible.modules.storage.netapp.netapp_e_iscsi_interface import IscsiInterface

View file

@ -5,7 +5,7 @@
from mock import MagicMock from mock import MagicMock
from ansible.modules.storage.netapp.netapp_e_iscsi_target import IscsiTarget 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 __metaclass__ = type

View file

@ -3,7 +3,7 @@
from ansible.modules.storage.netapp.netapp_e_syslog import Syslog from ansible.modules.storage.netapp.netapp_e_syslog import Syslog
from ansible.module_utils.six.moves.urllib.error import HTTPError 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 __metaclass__ = type
from units.compat import mock from units.compat import mock

View file

@ -9,7 +9,7 @@ except ImportError:
from ansible.module_utils.netapp import NetAppESeriesModule from ansible.module_utils.netapp import NetAppESeriesModule
from ansible.modules.storage.netapp.netapp_e_volume import NetAppESeriesVolume 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 __metaclass__ = type

View file

@ -22,7 +22,7 @@ __metaclass__ = type
from units.compat import unittest from units.compat import unittest
from units.compat.mock import patch, MagicMock 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.block import Block
from ansible.playbook.play import Play from ansible.playbook.play import Play
from ansible.playbook.role import Role from ansible.playbook.role import Role

View file

@ -20,8 +20,8 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
from units.compat import unittest from units.compat import unittest
from units.compat.mock import patch, MagicMock from units.compat.mock import MagicMock
from ansible.errors import AnsibleError, AnsibleParserError from ansible.errors import AnsibleParserError
from ansible.playbook import Playbook from ansible.playbook import Playbook
from ansible.vars.manager import VariableManager from ansible.vars.manager import VariableManager

View file

@ -22,7 +22,7 @@ import os
from ansible.errors import AnsibleActionFail from ansible.errors import AnsibleActionFail
from units.compat import unittest 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.plugins.action.raw import ActionModule
from ansible.playbook.task import Task from ansible.playbook.task import Task
from ansible.plugins.loader import connection_loader from ansible.plugins.loader import connection_loader

View file

@ -8,7 +8,7 @@ __metaclass__ = type
import pytest 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.plugins.action.win_updates import ActionModule
from ansible.playbook.task import Task from ansible.playbook.task import Task

View file

@ -25,7 +25,7 @@ import textwrap
import types import types
from units.compat import unittest 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 from ansible.plugins.callback import CallbackBase

View file

@ -22,7 +22,7 @@ __metaclass__ = type
from os import path from os import path
import json import json
from mock import MagicMock, call from mock import MagicMock
from units.compat import unittest from units.compat import unittest
from ansible.plugins.cliconf import ios from ansible.plugins.cliconf import ios

View file

@ -7,7 +7,7 @@ from ansible.module_utils.six.moves.urllib.error import HTTPError
from units.compat import mock from units.compat import mock
from units.compat import unittest from units.compat import unittest
from units.compat.builtins import BUILTINS 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.errors import AnsibleConnectionFailure
from ansible.module_utils.connection import ConnectionError from ansible.module_utils.connection import ConnectionError

View file

@ -25,7 +25,7 @@ import uuid
from units.compat import unittest from units.compat import unittest
from units.compat.mock import patch, MagicMock 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.process.worker import WorkerProcess
from ansible.executor.task_queue_manager import TaskQueueManager from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.executor.task_result import TaskResult from ansible.executor.task_result import TaskResult

View file

@ -24,8 +24,8 @@ import os
from units.compat import unittest from units.compat import unittest
from units.compat.builtins import BUILTINS from units.compat.builtins import BUILTINS
from units.compat.mock import mock_open, patch, MagicMock from units.compat.mock import patch, MagicMock
from ansible.plugins.loader import MODULE_CACHE, PATH_CACHE, PLUGIN_PATH_CACHE, PluginLoader from ansible.plugins.loader import PluginLoader
class TestErrors(unittest.TestCase): class TestErrors(unittest.TestCase):

View file

@ -23,7 +23,7 @@ import sys
from collections import defaultdict from collections import defaultdict
from units.compat import unittest 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 from ansible.template.safe_eval import safe_eval