diff --git a/examples/ipsec/filter_plugins/pfsense.py b/examples/ipsec/filter_plugins/pfsense.py index e067f5a6..4106e6de 100644 --- a/examples/ipsec/filter_plugins/pfsense.py +++ b/examples/ipsec/filter_plugins/pfsense.py @@ -7,14 +7,6 @@ __metaclass__ = type from ansible.errors import AnsibleFilterError -from ipaddress import ip_network -import re - -try: - from __main__ import display -except ImportError: - from ansible.utils.display import Display - display = Display() def format_ipsec_aggregate_ipsecs(all_tunnels, pfname): diff --git a/tests/unit/plugins/lookup/test_pfsense.py b/tests/unit/plugins/lookup/test_pfsense.py index a5d55eaf..b908d5da 100644 --- a/tests/unit/plugins/lookup/test_pfsense.py +++ b/tests/unit/plugins/lookup/test_pfsense.py @@ -4,7 +4,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import os from collections import OrderedDict import yaml from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch @@ -43,7 +42,6 @@ def setUp(self): self.build_definitions() - # self.fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'pfsense.yaml') self.mock_get_hostname = patch('ansible_collections.pfsensible.core.plugins.lookup.pfsense.LookupModule.get_hostname') get_hostname = self.mock_get_hostname.start() get_hostname.return_value = ('pf_test1') diff --git a/tests/unit/plugins/modules/test_pfsense_alias_null.py b/tests/unit/plugins/modules/test_pfsense_alias_null.py index ac1591bc..5be91a7b 100644 --- a/tests/unit/plugins/modules/test_pfsense_alias_null.py +++ b/tests/unit/plugins/modules/test_pfsense_alias_null.py @@ -4,7 +4,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from copy import copy import pytest import sys diff --git a/tests/unit/plugins/modules/test_pfsense_authserver_ldap.py b/tests/unit/plugins/modules/test_pfsense_authserver_ldap.py index d8c968f6..da286ac6 100644 --- a/tests/unit/plugins/modules/test_pfsense_authserver_ldap.py +++ b/tests/unit/plugins/modules/test_pfsense_authserver_ldap.py @@ -10,10 +10,8 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_authserver_ldap -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule class TestPFSenseAuthserverLDAPModule(TestPFSenseModule): diff --git a/tests/unit/plugins/modules/test_pfsense_authserver_radius.py b/tests/unit/plugins/modules/test_pfsense_authserver_radius.py index 1c5c2d51..cc4d879f 100644 --- a/tests/unit/plugins/modules/test_pfsense_authserver_radius.py +++ b/tests/unit/plugins/modules/test_pfsense_authserver_radius.py @@ -10,10 +10,8 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_authserver_radius -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule class TestPFSenseAuthserverRADIUSModule(TestPFSenseModule): diff --git a/tests/unit/plugins/modules/test_pfsense_ca.py b/tests/unit/plugins/modules/test_pfsense_ca.py index c1dd03ed..8269027d 100644 --- a/tests/unit/plugins/modules/test_pfsense_ca.py +++ b/tests/unit/plugins/modules/test_pfsense_ca.py @@ -10,10 +10,8 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_ca -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule CERTIFICATE = ( "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlFQ0RDQ0F2Q2dBd0lCQWdJSUZqRk9oczFuTXpRd0RRWUpLb1pJaHZjTkFRRUxCUUF3WERFVE1CRUdBMVVFDQpBeE1LYjNCbGJuWndiaTFqWVRF" diff --git a/tests/unit/plugins/modules/test_pfsense_ipsec.py b/tests/unit/plugins/modules/test_pfsense_ipsec.py index fa7319e7..d4dacd65 100644 --- a/tests/unit/plugins/modules/test_pfsense_ipsec.py +++ b/tests/unit/plugins/modules/test_pfsense_ipsec.py @@ -13,7 +13,6 @@ from ansible_collections.pfsensible.core.plugins.modules import pfsense_ipsec from ansible_collections.pfsensible.core.plugins.module_utils.ipsec import PFSenseIpsecModule from .pfsense_module import TestPFSenseModule -from parameterized import parameterized class TestPFSenseIpsecModule(TestPFSenseModule): diff --git a/tests/unit/plugins/modules/test_pfsense_log_settings.py b/tests/unit/plugins/modules/test_pfsense_log_settings.py index 3e3397fc..bfc11823 100644 --- a/tests/unit/plugins/modules/test_pfsense_log_settings.py +++ b/tests/unit/plugins/modules/test_pfsense_log_settings.py @@ -4,14 +4,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from copy import copy import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args from ansible_collections.pfsensible.core.plugins.modules import pfsense_log_settings from .pfsense_module import TestPFSenseModule diff --git a/tests/unit/plugins/modules/test_pfsense_openvpn_override.py b/tests/unit/plugins/modules/test_pfsense_openvpn_override.py index a0001868..530d1f2f 100644 --- a/tests/unit/plugins/modules/test_pfsense_openvpn_override.py +++ b/tests/unit/plugins/modules/test_pfsense_openvpn_override.py @@ -10,10 +10,8 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_openvpn_override -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule class TestPFSenseOpenVPNOverrideModule(TestPFSenseModule): diff --git a/tests/unit/plugins/modules/test_pfsense_openvpn_server.py b/tests/unit/plugins/modules/test_pfsense_openvpn_server.py index 7974fd1f..7f9431b9 100644 --- a/tests/unit/plugins/modules/test_pfsense_openvpn_server.py +++ b/tests/unit/plugins/modules/test_pfsense_openvpn_server.py @@ -10,10 +10,8 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_openvpn_server -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule CERTIFICATE = ( "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlFQ0RDQ0F2Q2dBd0lCQWdJSUZqRk9oczFuTXpRd0RRWUpLb1pJaHZjTkFRRUxCUUF3WERFVE1CRUdBMVVFDQpBeE1LYjNCbGJuWndiaTFqWVRF" diff --git a/tests/unit/plugins/modules/test_pfsense_rule.py b/tests/unit/plugins/modules/test_pfsense_rule.py index cdf12614..90bfbbe8 100644 --- a/tests/unit/plugins/modules/test_pfsense_rule.py +++ b/tests/unit/plugins/modules/test_pfsense_rule.py @@ -10,11 +10,9 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_rule from ansible_collections.pfsensible.core.plugins.module_utils.rule import PFSenseRuleModule -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule class TestPFSenseRuleModule(TestPFSenseModule): diff --git a/tests/unit/plugins/modules/test_pfsense_user.py b/tests/unit/plugins/modules/test_pfsense_user.py index a71cf469..535df690 100644 --- a/tests/unit/plugins/modules/test_pfsense_user.py +++ b/tests/unit/plugins/modules/test_pfsense_user.py @@ -10,10 +10,8 @@ if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("pfSense Ansible modules require Python >= 2.7") -from xml.etree.ElementTree import fromstring, ElementTree -from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch from ansible_collections.pfsensible.core.plugins.modules import pfsense_user -from .pfsense_module import TestPFSenseModule, load_fixture +from .pfsense_module import TestPFSenseModule class TestPFSenseUserModule(TestPFSenseModule):