mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
Fix logic that prevents multiple action, local_action, and modules to be specified.
This commit is contained in:
parent
6c94d85690
commit
c1b290a311
2 changed files with 25 additions and 15 deletions
|
@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.parsing.mod_args import ModuleArgsParser
|
||||
from ansible.errors import AnsibleParserError
|
||||
|
||||
from ansible.compat.tests import unittest
|
||||
|
||||
|
@ -106,3 +107,9 @@ class TestModArgsDwim(unittest.TestCase):
|
|||
self.assertEqual(mod, 'copy')
|
||||
self.assertEqual(args, dict(src='a', dest='b'))
|
||||
self.assertIs(to, 'localhost')
|
||||
|
||||
def test_multiple_actions(self):
|
||||
self.assertRaises(AnsibleParserError, self.m.parse, dict(action='shell echo hi', local_action='shell echo hi'))
|
||||
self.assertRaises(AnsibleParserError, self.m.parse, dict(action='shell echo hi', shell='echo hi'))
|
||||
self.assertRaises(AnsibleParserError, self.m.parse, dict(local_action='shell echo hi', shell='echo hi'))
|
||||
self.assertRaises(AnsibleParserError, self.m.parse, dict(ping='data=hi', shell='echo hi'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue