update tests
parent
4f4db18d41
commit
1ce17fab54
|
@ -1216,6 +1216,10 @@ from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_valid
|
|||
AnsibleArgSpecValidator,
|
||||
)
|
||||
|
||||
# import debugpy
|
||||
|
||||
# debugpy.listen(3000)
|
||||
# debugpy.wait_for_client()
|
||||
try:
|
||||
from jinja2.filters import pass_environment
|
||||
except ImportError:
|
||||
|
|
|
@ -160,9 +160,9 @@ def consolidate_facts(data_sources, all_values):
|
|||
|
||||
def consolidate(
|
||||
data_sources,
|
||||
fail_missing_match_key=False,
|
||||
fail_missing_match_value=False,
|
||||
fail_duplicate=False,
|
||||
fail_missing_match_key,
|
||||
fail_missing_match_value,
|
||||
fail_duplicate,
|
||||
):
|
||||
"""Calls data validation and consolidation functions
|
||||
|
||||
|
|
|
@ -244,7 +244,16 @@ class TestConsolidate(unittest.TestCase):
|
|||
"l3_interfaces": {"name": "Loopback999"},
|
||||
},
|
||||
}
|
||||
args = ["", data_sources]
|
||||
fail_missing_match_value = False
|
||||
fail_missing_match_key = False
|
||||
fail_duplicate = False
|
||||
args = [
|
||||
"",
|
||||
data_sources,
|
||||
fail_missing_match_key,
|
||||
fail_missing_match_value,
|
||||
fail_duplicate,
|
||||
]
|
||||
|
||||
result = _consolidate(*args)
|
||||
self.assertEqual(result, output)
|
||||
|
@ -366,7 +375,7 @@ class TestConsolidate(unittest.TestCase):
|
|||
]
|
||||
|
||||
fail_missing_match_key = True
|
||||
args = ["", data_sources, fail_missing_match_key]
|
||||
args = ["", data_sources, fail_missing_match_key, False, False]
|
||||
with self.assertRaises(AnsibleFilterError) as error:
|
||||
_consolidate(*args)
|
||||
self.assertIn(
|
||||
|
@ -374,7 +383,7 @@ class TestConsolidate(unittest.TestCase):
|
|||
str(error.exception),
|
||||
)
|
||||
|
||||
def test_fail_missing_match_value(self):
|
||||
def test_fail_duplicate(self):
|
||||
data_sources = [
|
||||
{
|
||||
"data": [
|
||||
|
|
Loading…
Reference in New Issue