mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Use more unit test utils from community.internal_test_tools (#9918)
* Make conftest's patch_ansible_module use the context manager from .utils. * Fix test dependencies. * Use module mock utils from community.internal_test_tools. * Use DataDictLoader from community.internal_test_tools. * Use trust util from community.internal_test_tools.
This commit is contained in:
parent
9286b60182
commit
8ab8010b6d
94 changed files with 217 additions and 267 deletions
|
@ -13,6 +13,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.compat.unittes
|
|||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.utils.trust import make_trusted
|
||||
|
||||
from ansible.plugins.loader import lookup_loader
|
||||
|
||||
|
@ -30,9 +31,9 @@ class TestLookupModule(TestCase):
|
|||
self.assertListEqual(
|
||||
self.lookup.run(
|
||||
[
|
||||
{'a': '[1, 2]'},
|
||||
{'b': '[item.a + 3, item.a + 6]'},
|
||||
{'c': '[item.a + item.b * 10]'},
|
||||
{'a': make_trusted('[1, 2]')},
|
||||
{'b': make_trusted('[item.a + 3, item.a + 6]')},
|
||||
{'c': make_trusted('[item.a + item.b * 10]')},
|
||||
],
|
||||
{},
|
||||
),
|
||||
|
|
|
@ -8,7 +8,7 @@ __metaclass__ = type
|
|||
|
||||
from ansible_collections.community.general.tests.unit.compat import unittest
|
||||
from ansible_collections.community.general.tests.unit.compat.mock import patch
|
||||
from ansible_collections.community.general.tests.unit.mock.loader import DictDataLoader
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.mock.loader import DictDataLoader
|
||||
|
||||
from ansible.plugins import AnsiblePlugin
|
||||
from ansible.template import Templar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue