Remove Py27 compat files and update imports for magicmock and patch (#342)
* remove compat files and mock imports * updates * updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>pull/343/head
parent
c176c23392
commit
1645351602
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
trivial:
|
||||
- remove compat files as we stopped testing against python 2.7.
|
||||
- update direct imports for patch and MagicMock from unittest.
|
|
@ -1,127 +0,0 @@
|
|||
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
"""
|
||||
Compat module for Python3.x's unittest.mock module
|
||||
"""
|
||||
import sys
|
||||
|
||||
import _io # pyright: ignore[reportMissingImports]
|
||||
|
||||
|
||||
# Python 2.7
|
||||
|
||||
# Note: Could use the pypi mock library on python3.x as well as python2.x. It
|
||||
# is the same as the python3 stdlib mock library
|
||||
|
||||
try:
|
||||
# Allow wildcard import because we really do want to import all of mock's
|
||||
# symbols into this compat shim
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
from unittest.mock import * # noqa F403
|
||||
except ImportError:
|
||||
# Python 2
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
try:
|
||||
from mock import * # pyright: ignore[reportMissingModuleSource] # noqa F403
|
||||
except ImportError:
|
||||
print("You need the mock library installed on python2.x to run tests")
|
||||
|
||||
|
||||
# Prior to 3.4.4, mock_open cannot handle binary read_data
|
||||
if sys.version_info >= (3,) and sys.version_info < (3, 4, 4):
|
||||
file_spec = None
|
||||
|
||||
def _iterate_read_data(read_data):
|
||||
# Helper for mock_open:
|
||||
# Retrieve lines from read_data via a generator so that separate calls to
|
||||
# readline, read, and readlines are properly interleaved
|
||||
sep = b"\n" if isinstance(read_data, bytes) else "\n"
|
||||
data_as_list = [line + sep for line in read_data.split(sep)]
|
||||
|
||||
if data_as_list[-1] == sep:
|
||||
# If the last line ended in a newline, the list comprehension will have an
|
||||
# extra entry that's just a newline. Remove this.
|
||||
data_as_list = data_as_list[:-1]
|
||||
else:
|
||||
# If there wasn't an extra newline by itself, then the file being
|
||||
# emulated doesn't have a newline to end the last line remove the
|
||||
# newline that our naive format() added
|
||||
data_as_list[-1] = data_as_list[-1][:-1]
|
||||
|
||||
for line in data_as_list:
|
||||
yield line
|
||||
|
||||
def mock_open(mock=None, read_data=""):
|
||||
"""
|
||||
A helper function to create a mock to replace the use of `open`. It works
|
||||
for `open` called directly or used as a context manager.
|
||||
|
||||
The `mock` argument is the mock object to configure. If `None` (the
|
||||
default) then a `MagicMock` will be created for you, with the API limited
|
||||
to methods or attributes available on standard file handles.
|
||||
|
||||
`read_data` is a string for the `read` methoddline`, and `readlines` of the
|
||||
file handle to return. This is an empty string by default.
|
||||
"""
|
||||
|
||||
def _readlines_side_effect(*args, **kwargs):
|
||||
if handle.readlines.return_value is not None:
|
||||
return handle.readlines.return_value
|
||||
return list(_data)
|
||||
|
||||
def _read_side_effect(*args, **kwargs):
|
||||
if handle.read.return_value is not None:
|
||||
return handle.read.return_value
|
||||
return type(read_data)().join(_data)
|
||||
|
||||
def _readline_side_effect():
|
||||
if handle.readline.return_value is not None:
|
||||
while True:
|
||||
yield handle.readline.return_value
|
||||
for line in _data:
|
||||
yield line
|
||||
|
||||
global file_spec
|
||||
if file_spec is None:
|
||||
file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
|
||||
|
||||
if mock is None:
|
||||
mock = MagicMock(name="open", spec=open) # noqa F405
|
||||
|
||||
handle = MagicMock(spec=file_spec) # noqa F405
|
||||
handle.__enter__.return_value = handle
|
||||
|
||||
_data = _iterate_read_data(read_data)
|
||||
|
||||
handle.write.return_value = None
|
||||
handle.read.return_value = None
|
||||
handle.readline.return_value = None
|
||||
handle.readlines.return_value = None
|
||||
|
||||
handle.read.side_effect = _read_side_effect
|
||||
handle.readline.side_effect = _readline_side_effect()
|
||||
handle.readlines.side_effect = _readlines_side_effect
|
||||
|
||||
mock.return_value = handle
|
||||
return mock
|
|
@ -1,41 +0,0 @@
|
|||
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
"""
|
||||
Compat module for Python2.7's unittest module
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
# Allow wildcard import because we really do want to import all of
|
||||
# unittests's symbols into this compat shim
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
if sys.version_info < (2, 7):
|
||||
try:
|
||||
# Need unittest2 on python2.6
|
||||
from unittest2 import * # noqa F403
|
||||
except ImportError:
|
||||
print("You need unittest2 installed on python2.6.x to run tests")
|
||||
else:
|
||||
from unittest import * # noqa F403
|
|
@ -2,8 +2,10 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from ansible.utils.path import unfrackpath
|
||||
from ansible_collections.ansible.netcommon.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
mock_unfrackpath_noop = MagicMock(spec_set=unfrackpath, side_effect=lambda x, *args, **kwargs: x)
|
||||
|
|
|
@ -27,10 +27,10 @@ import sys
|
|||
|
||||
from contextlib import contextmanager
|
||||
from io import BytesIO, StringIO
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils.six import PY3
|
||||
from ansible_collections.ansible.netcommon.tests.unit.compat import unittest
|
||||
|
||||
|
||||
@contextmanager
|
||||
|
@ -77,7 +77,7 @@ def swap_stdout():
|
|||
sys.stdout = old_stdout
|
||||
|
||||
|
||||
class ModuleTestCase(unittest.TestCase):
|
||||
class ModuleTestCase(TestCase):
|
||||
def setUp(self, module_args=None):
|
||||
if module_args is None:
|
||||
module_args = {
|
||||
|
|
|
@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
|
||||
AnsibleArgSpecValidator,
|
||||
|
@ -18,7 +18,7 @@ from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_valid
|
|||
from .fixtures.docstring import DOCUMENTATION
|
||||
|
||||
|
||||
class TestSortList(unittest.TestCase):
|
||||
class TestSortList(TestCase):
|
||||
def test_simple_pass(self):
|
||||
data = {"param_str": "string"}
|
||||
aav = AnsibleArgSpecValidator(
|
||||
|
|
|
@ -9,12 +9,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.module_utils.common.utils import dict_merge
|
||||
|
||||
|
||||
class TestDict_merge(unittest.TestCase):
|
||||
class TestDict_merge(TestCase):
|
||||
def test_not_dict_base(self):
|
||||
base = [0]
|
||||
other = {"a": "b"}
|
||||
|
|
|
@ -9,14 +9,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.template import Templar
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.module_utils.common.get_path import get_path
|
||||
|
||||
|
||||
class TestGetPath(unittest.TestCase):
|
||||
class TestGetPath(TestCase):
|
||||
def setUp(self):
|
||||
self._environment = Templar(loader=None).environment
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.module_utils.common.utils import sort_list
|
||||
|
||||
|
||||
class TestSortList(unittest.TestCase):
|
||||
class TestSortList(TestCase):
|
||||
def test_simple(self):
|
||||
var = [3, 2, 1]
|
||||
result = sort_list(var)
|
||||
|
|
|
@ -12,7 +12,8 @@ __metaclass__ = type
|
|||
import heapq
|
||||
import json
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.template import Templar
|
||||
|
||||
|
@ -20,7 +21,7 @@ from ansible_collections.ansible.utils.plugins.module_utils.common.get_path impo
|
|||
from ansible_collections.ansible.utils.plugins.module_utils.common.to_paths import to_paths
|
||||
|
||||
|
||||
class TestToPaths(unittest.TestCase):
|
||||
class TestToPaths(TestCase):
|
||||
def setUp(self):
|
||||
self._environment = Templar(loader=None).environment
|
||||
|
||||
|
|
|
@ -9,6 +9,9 @@ __metaclass__ = type
|
|||
import os
|
||||
import tempfile
|
||||
|
||||
from unittest import TestCase
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from ansible.module_utils.connection import ConnectionError as AnsibleConnectionError
|
||||
from ansible.playbook.task import Task
|
||||
from ansible.template import Templar
|
||||
|
@ -22,12 +25,10 @@ from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_valid
|
|||
)
|
||||
from ansible_collections.ansible.utils.plugins.modules.cli_parse import DOCUMENTATION
|
||||
from ansible_collections.ansible.utils.plugins.plugin_utils.base.cli_parser import CliParserBase
|
||||
from ansible_collections.ansible.utils.tests.unit.compat import unittest
|
||||
from ansible_collections.ansible.utils.tests.unit.compat.mock import MagicMock, patch
|
||||
from ansible_collections.ansible.utils.tests.unit.mock.loader import DictDataLoader
|
||||
|
||||
|
||||
class TestCli_Parse(unittest.TestCase):
|
||||
class TestCli_Parse(TestCase):
|
||||
def setUp(self):
|
||||
task = MagicMock(Task)
|
||||
play_context = MagicMock()
|
||||
|
|
|
@ -9,7 +9,8 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
import re
|
||||
import unittest
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.playbook.task import Task
|
||||
from ansible.template import Templar
|
||||
|
@ -23,7 +24,7 @@ except ImportError:
|
|||
from mock import MagicMock # pyright: ignore[reportMissingModuleSource]
|
||||
|
||||
|
||||
class TestUpdate_Fact(unittest.TestCase):
|
||||
class TestUpdate_Fact(TestCase):
|
||||
def setUp(self):
|
||||
task = MagicMock(Task)
|
||||
# Ansible > 2.13 looks for check_mode in task
|
||||
|
|
|
@ -9,7 +9,8 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
import copy
|
||||
import unittest
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.playbook.task import Task
|
||||
from ansible.template import Templar
|
||||
|
@ -79,7 +80,7 @@ INVALID_JINJA = [
|
|||
]
|
||||
|
||||
|
||||
class TestUpdate_Fact(unittest.TestCase):
|
||||
class TestUpdate_Fact(TestCase):
|
||||
def setUp(self):
|
||||
task = MagicMock(Task)
|
||||
# Ansible > 2.13 looks for check_mode in task
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleActionFail
|
||||
from ansible.playbook.task import Task
|
||||
|
@ -111,7 +111,7 @@ CRITERIA_FORMAT_SUPPORT_CHECK = {
|
|||
}
|
||||
|
||||
|
||||
class TestValidate(unittest.TestCase):
|
||||
class TestValidate(TestCase):
|
||||
def setUp(self):
|
||||
task = MagicMock(Task)
|
||||
play_context = MagicMock()
|
||||
|
|
|
@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
|
@ -30,7 +30,7 @@ VALID_DATA_SPAN = ["192.168.1.1", "192.168.1.2", "192.168.1.3", "192.168.1.4"]
|
|||
VALID_OUTPUT_SPAN = "192.168.1.0/29"
|
||||
|
||||
|
||||
class TestCidrMerge(unittest.TestCase):
|
||||
class TestCidrMerge(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.consolidate import _consolidate
|
||||
|
||||
|
||||
class TestConsolidate(unittest.TestCase):
|
||||
class TestConsolidate(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.fact_diff import _fact_diff
|
||||
|
||||
|
||||
class TestUpdate_Fact(unittest.TestCase):
|
||||
class TestUpdate_Fact(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleFilterError
|
||||
|
||||
|
@ -26,7 +26,7 @@ OUTPUT = """{"netconf-state": \
|
|||
{"@xmlns": "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring", "schemas": {"schema": null}}}"""
|
||||
|
||||
|
||||
class TestFromXml(unittest.TestCase):
|
||||
class TestFromXml(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.hwaddr import _hwaddr
|
||||
|
||||
|
||||
class Test_hwaddr(unittest.TestCase):
|
||||
class Test_hwaddr(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.ip4_hex import _ip4_hex
|
||||
|
||||
|
||||
class TestIpWrap(unittest.TestCase):
|
||||
class TestIpWrap(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -36,7 +36,7 @@ from ansible_collections.ansible.utils.plugins.plugin_utils.base.ipaddr_utils im
|
|||
netaddr = pytest.importorskip("netaddr")
|
||||
|
||||
|
||||
class TestIpFilter(unittest.TestCase):
|
||||
class TestIpFilter(TestCase):
|
||||
def test_cidr_merge(self):
|
||||
with pytest.raises(
|
||||
AnsibleFilterError,
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.ipcut import _ipcut
|
||||
|
||||
|
||||
class TestIpCut(unittest.TestCase):
|
||||
class TestIpCut(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.ipmath import _ipmath
|
||||
|
||||
|
||||
class TestIpAddr(unittest.TestCase):
|
||||
class TestIpAddr(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -23,7 +23,7 @@ address = "192.168.144.5"
|
|||
subnet = "192.168.0.0/16"
|
||||
|
||||
|
||||
class TestIpSubnet(unittest.TestCase):
|
||||
class TestIpSubnet(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -41,7 +41,7 @@ VALID_OUTPUT1 = ["::ffff:192.24.2.1/128", "::ffff:192.168.32.0/120"]
|
|||
VALID_OUTPUT2 = ["192.24.2.1"]
|
||||
|
||||
|
||||
class TestIp4(unittest.TestCase):
|
||||
class TestIp4(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -44,7 +44,7 @@ VALID_OUTPUT1 = ["192.168.32.0/24", "192.24.2.1/32"]
|
|||
VALID_OUTPUT2 = ["::ffff:192.168.32.0", "::ffff:192.24.2.1", "fe80::100"]
|
||||
|
||||
|
||||
class TestIp6(unittest.TestCase):
|
||||
class TestIp6(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.ipv6form import _ipv6form
|
||||
|
||||
|
||||
class TestIpv6Form(unittest.TestCase):
|
||||
class TestIpv6Form(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -46,7 +46,7 @@ VALID_OUTPUT = [
|
|||
]
|
||||
|
||||
|
||||
class TestIpWrap(unittest.TestCase):
|
||||
class TestIpWrap(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.keep_keys import _keep_keys
|
||||
|
||||
|
||||
class TestKeepKeys(unittest.TestCase):
|
||||
class TestKeepKeys(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.macaddr import _macaddr
|
||||
|
||||
|
||||
class Test_macaddr(unittest.TestCase):
|
||||
class Test_macaddr(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.network_in_network import _network_in_network
|
||||
|
||||
|
||||
class Test_network_in_network(unittest.TestCase):
|
||||
class Test_network_in_network(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.network_in_usable import _network_in_usable
|
||||
|
||||
|
||||
class Test_Network_In_Usable(unittest.TestCase):
|
||||
class Test_Network_In_Usable(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.next_nth_usable import _next_nth_usable
|
||||
|
||||
|
||||
class Test_Next_Nth_Usable(unittest.TestCase):
|
||||
class Test_Next_Nth_Usable(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.nthhost import _nthhost
|
||||
|
||||
|
||||
class Test_nthhost(unittest.TestCase):
|
||||
class Test_nthhost(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -9,14 +9,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.param_list_compare import param_list_compare
|
||||
|
||||
|
||||
class TestParam_list_compare_merge(unittest.TestCase):
|
||||
class TestParam_list_compare_merge(TestCase):
|
||||
def test_valid_data(self):
|
||||
"""Check passing valid data as per criteria"""
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.previous_nth_usable import (
|
||||
_previous_nth_usable,
|
||||
)
|
||||
|
||||
|
||||
class Test_previous_Nth_Usable(unittest.TestCase):
|
||||
class Test_previous_Nth_Usable(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.reduce_on_network import _reduce_on_network
|
||||
|
||||
|
||||
class Test_reduce_on_network(unittest.TestCase):
|
||||
class Test_reduce_on_network(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.remove_keys import _remove_keys
|
||||
|
||||
|
||||
class TestReplaceKeys(unittest.TestCase):
|
||||
class TestReplaceKeys(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.replace_keys import _replace_keys
|
||||
|
||||
|
||||
class TestReplaceKeys(unittest.TestCase):
|
||||
class TestReplaceKeys(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.filter.slaac import _slaac
|
||||
|
||||
|
||||
class Test_slaac(unittest.TestCase):
|
||||
class Test_slaac(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleFilterError
|
||||
|
||||
|
@ -35,7 +35,7 @@ OUTPUT_SPACES = """<?xml version="1.0" encoding="utf-8"?>
|
|||
</interface-configurations>"""
|
||||
|
||||
|
||||
class TestToXml(unittest.TestCase):
|
||||
class TestToXml(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
|
@ -73,7 +73,7 @@ VALID_OUTPUT_3 = {
|
|||
VALID_OUTPUT_4 = {"number_of_ips": 1, "usable_ips": ["2001:db8:abcd:12::"]}
|
||||
|
||||
|
||||
class TestUsableRange(unittest.TestCase):
|
||||
class TestUsableRange(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
|
@ -92,7 +92,7 @@ CRITERIA_IN_RATE_CHECK = {
|
|||
}
|
||||
|
||||
|
||||
class TestValidate(unittest.TestCase):
|
||||
class TestValidate(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleLookupError
|
||||
|
||||
|
@ -92,7 +92,7 @@ CRITERIA_IN_RATE_CHECK = {
|
|||
}
|
||||
|
||||
|
||||
class TestValidate(unittest.TestCase):
|
||||
class TestValidate(TestCase):
|
||||
def setUp(self):
|
||||
self._lp = LookupModule()
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.template import Templar
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.plugin_utils.index_of import index_of
|
||||
|
||||
|
||||
class TestIndexOfFilter(unittest.TestCase):
|
||||
class TestIndexOfFilter(TestCase):
|
||||
def setUp(self):
|
||||
self._tests = Templar(loader=None).environment.tests
|
||||
|
||||
|
|
|
@ -8,11 +8,12 @@ __metaclass__ = type
|
|||
|
||||
import json
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.sub_plugins.cli_parser.json_parser import CliParser
|
||||
from ansible_collections.ansible.utils.tests.unit.compat import unittest
|
||||
|
||||
|
||||
class TestJsonParser(unittest.TestCase):
|
||||
class TestJsonParser(TestCase):
|
||||
def test_json_parser(self):
|
||||
test_value = {
|
||||
"string": "This is a string",
|
||||
|
|
|
@ -8,18 +8,19 @@ __metaclass__ = type
|
|||
|
||||
import os
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.sub_plugins.cli_parser.textfsm_parser import (
|
||||
CliParser,
|
||||
)
|
||||
from ansible_collections.ansible.utils.tests.unit.compat import unittest
|
||||
|
||||
|
||||
textfsm = pytest.importorskip("textfsm")
|
||||
|
||||
|
||||
class TestTextfsmParser(unittest.TestCase):
|
||||
class TestTextfsmParser(TestCase):
|
||||
def test_textfsm_parser(self):
|
||||
nxos_cfg_path = os.path.join(os.path.dirname(__file__), "fixtures", "nxos_show_version.cfg")
|
||||
nxos_template_path = os.path.join(
|
||||
|
|
|
@ -8,16 +8,17 @@ __metaclass__ = type
|
|||
|
||||
import os
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.sub_plugins.cli_parser.ttp_parser import CliParser
|
||||
from ansible_collections.ansible.utils.tests.unit.compat import unittest
|
||||
|
||||
|
||||
textfsm = pytest.importorskip("ttp")
|
||||
|
||||
|
||||
class TestTextfsmParser(unittest.TestCase):
|
||||
class TestTextfsmParser(TestCase):
|
||||
def test_ttp_parser(self):
|
||||
nxos_cfg_path = os.path.join(os.path.dirname(__file__), "fixtures", "nxos_show_version.cfg")
|
||||
nxos_template_path = os.path.join(
|
||||
|
|
|
@ -7,17 +7,17 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
from collections import OrderedDict
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.sub_plugins.cli_parser.xml_parser import CliParser
|
||||
from ansible_collections.ansible.utils.tests.unit.compat import unittest
|
||||
|
||||
|
||||
xmltodict = pytest.importorskip("xmltodict")
|
||||
|
||||
|
||||
class TestXmlParser(unittest.TestCase):
|
||||
class TestXmlParser(TestCase):
|
||||
def test_valid_xml(self):
|
||||
xml = "<tag1><tag2 arg='foo'>text</tag2></tag1>"
|
||||
xml_dict = OrderedDict(
|
||||
|
|
|
@ -12,14 +12,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.in_any_network import _in_any_network
|
||||
|
||||
|
||||
class TestInAnyNetwork(unittest.TestCase):
|
||||
class TestInAnyNetwork(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.in_network import _in_network
|
||||
|
||||
|
||||
class TestInNetwork(unittest.TestCase):
|
||||
class TestInNetwork(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.in_one_network import _in_one_network
|
||||
|
||||
|
||||
class TestInOneNetwork(unittest.TestCase):
|
||||
class TestInOneNetwork(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ip import _ip
|
||||
|
||||
|
||||
class TestIp(unittest.TestCase):
|
||||
class TestIp(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ip_address import _ip_address
|
||||
|
||||
|
||||
class TestIpAddress(unittest.TestCase):
|
||||
class TestIpAddress(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv4 import _ipv4
|
||||
|
||||
|
||||
class TestIpV4(unittest.TestCase):
|
||||
class TestIpV4(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv4_address import _ipv4_address
|
||||
|
||||
|
||||
class TestIpV4Address(unittest.TestCase):
|
||||
class TestIpV4Address(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv4_hostmask import _ipv4_hostmask
|
||||
|
||||
|
||||
class TestIpV4Hostmask(unittest.TestCase):
|
||||
class TestIpV4Hostmask(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv4_netmask import _ipv4_netmask
|
||||
|
||||
|
||||
class TestIpV4Netmask(unittest.TestCase):
|
||||
class TestIpV4Netmask(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv6 import _ipv6
|
||||
|
||||
|
||||
class TestIpV6(unittest.TestCase):
|
||||
class TestIpV6(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv6_address import _ipv6_address
|
||||
|
||||
|
||||
class TestIpV6Address(unittest.TestCase):
|
||||
class TestIpV6Address(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv6_ipv4_mapped import _ipv6_ipv4_mapped
|
||||
|
||||
|
||||
class TestIpV6IpV4Mapped(unittest.TestCase):
|
||||
class TestIpV6IpV4Mapped(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv6_sixtofour import _ipv6_sixtofour
|
||||
|
||||
|
||||
class TestIpV6SixToFour(unittest.TestCase):
|
||||
class TestIpV6SixToFour(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.ipv6_teredo import _ipv6_teredo
|
||||
|
||||
|
||||
class TestIpV6Teredo(unittest.TestCase):
|
||||
class TestIpV6Teredo(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.loopback import _loopback
|
||||
|
||||
|
||||
class TestLoopback(unittest.TestCase):
|
||||
class TestLoopback(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.mac import _mac
|
||||
|
||||
|
||||
class TestMac(unittest.TestCase):
|
||||
class TestMac(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.multicast import _multicast
|
||||
|
||||
|
||||
class TestMulticast(unittest.TestCase):
|
||||
class TestMulticast(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.private import _private
|
||||
|
||||
|
||||
class TestPrivate(unittest.TestCase):
|
||||
class TestPrivate(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.public import _public
|
||||
|
||||
|
||||
class TestPublic(unittest.TestCase):
|
||||
class TestPublic(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.reserved import _reserved
|
||||
|
||||
|
||||
class TestReserved(unittest.TestCase):
|
||||
class TestReserved(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.resolvable import _resolvable
|
||||
|
||||
|
||||
class TestResolvable(unittest.TestCase):
|
||||
class TestResolvable(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.subnet_of import _subnet_of
|
||||
|
||||
|
||||
class TestSubnetOf(unittest.TestCase):
|
||||
class TestSubnetOf(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.supernet_of import _supernet_of
|
||||
|
||||
|
||||
class TestSupernetOf(unittest.TestCase):
|
||||
class TestSupernetOf(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible_collections.ansible.utils.plugins.test.unspecified import _unspecified
|
||||
|
||||
|
||||
class TestUnspecified(unittest.TestCase):
|
||||
class TestUnspecified(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
import unittest
|
||||
from unittest import TestCase
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
|
@ -92,7 +92,7 @@ CRITERIA_IN_RATE_CHECK = {
|
|||
}
|
||||
|
||||
|
||||
class TestValidate(unittest.TestCase):
|
||||
class TestValidate(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in New Issue