mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
Use arg_spec type for comparisons on default and choices (#37741)
* Use arg_spec type for comparisons on default and choices * Further improve type casting * Make sure to capture output in more places * Individually report invalid choices * Update ignore.txt after resolving merge conflicts
This commit is contained in:
parent
9890ce47e8
commit
ffbbb5a25b
6 changed files with 330 additions and 206 deletions
|
@ -45,22 +45,14 @@ def add_mocks(filename):
|
|||
pre_sys_modules = list(sys.modules.keys())
|
||||
|
||||
module_mock = mock.MagicMock()
|
||||
mocks = []
|
||||
for module_class in MODULE_CLASSES:
|
||||
mocks.append(
|
||||
mock.patch('%s.__init__' % module_class, new=module_mock)
|
||||
)
|
||||
for m in mocks:
|
||||
p = m.start()
|
||||
p = mock.patch('%s.__init__' % module_class, new=module_mock).start()
|
||||
p.side_effect = AnsibleModuleCallError('AnsibleModuleCallError')
|
||||
mocks.append(
|
||||
mock.patch('ansible.module_utils.basic._load_params').start()
|
||||
)
|
||||
mock.patch('ansible.module_utils.basic._load_params').start()
|
||||
|
||||
yield module_mock
|
||||
|
||||
for m in mocks:
|
||||
m.stop()
|
||||
mock.patch.stopall()
|
||||
|
||||
# Clean up imports to prevent issues with mutable data being used in modules
|
||||
for k in list(sys.modules.keys()):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue