mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-29 13:51:28 -07:00
Deprecate Entity, EntityCollection and use subspec in network modules (#33575)
* Deprecate Entity, EntityCollection and use subspec in network modules * As per proposal https://github.com/ansible/proposals/issues/76 deprecate use of Entity, EntityCollection, ComplexDict, ComplexList and use subspec instead. * Refactor ios modules * Refactor eos modules * Refactor vyos modules * Refactor nxos modules * Refactor iosxr modules * Add support for key in suboptions handling * Fix CI issues
This commit is contained in:
parent
a23da23491
commit
4349b56643
15 changed files with 195 additions and 200 deletions
|
@ -575,6 +575,21 @@ class TestModuleUtilsBasic(ModuleTestCase):
|
|||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
# should test ok, handles key argument
|
||||
key_spec = dict(foo=dict(key=True), bar=dict())
|
||||
args = json.dumps(dict(ANSIBLE_MODULE_ARGS={'foobar': ['test-1', 'test-2']}))
|
||||
with swap_stdin_and_argv(stdin_data=args):
|
||||
basic._ANSIBLE_ARGS = None
|
||||
am = basic.AnsibleModule(
|
||||
argument_spec=dict(foobar=dict(type='list', elements='dict', options=key_spec, required=True)),
|
||||
no_log=True,
|
||||
check_invalid_arguments=False,
|
||||
add_file_common_args=True,
|
||||
supports_check_mode=True
|
||||
)
|
||||
self.assertEqual(am.params['foobar'][0]['foo'], 'test-1')
|
||||
self.assertEqual(am.params['foobar'][1]['foo'], 'test-2')
|
||||
|
||||
def test_module_utils_basic_ansible_module_type_check(self):
|
||||
from ansible.module_utils import basic
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue