summaryrefslogtreecommitdiff
path: root/test/units/parsing/test_mod_args.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/parsing/test_mod_args.py')
-rw-r--r--test/units/parsing/test_mod_args.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/units/parsing/test_mod_args.py b/test/units/parsing/test_mod_args.py
index aeb74ad5..5d3f5d25 100644
--- a/test/units/parsing/test_mod_args.py
+++ b/test/units/parsing/test_mod_args.py
@@ -6,10 +6,10 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
+import re
from ansible.errors import AnsibleParserError
from ansible.parsing.mod_args import ModuleArgsParser
-from ansible.plugins.loader import init_plugin_loader
from ansible.utils.sentinel import Sentinel
@@ -119,19 +119,19 @@ class TestModArgsDwim:
assert err.value.args[0] == msg
def test_multiple_actions_ping_shell(self):
- init_plugin_loader()
args_dict = {'ping': 'data=hi', 'shell': 'echo hi'}
m = ModuleArgsParser(args_dict)
with pytest.raises(AnsibleParserError) as err:
m.parse()
- assert err.value.args[0] == f'conflicting action statements: {", ".join(args_dict)}'
+ assert err.value.args[0].startswith("conflicting action statements: ")
+ actions = set(re.search(r'(\w+), (\w+)', err.value.args[0]).groups())
+ assert actions == set(['ping', 'shell'])
def test_bogus_action(self):
- init_plugin_loader()
args_dict = {'bogusaction': {}}
m = ModuleArgsParser(args_dict)
with pytest.raises(AnsibleParserError) as err:
m.parse()
- assert err.value.args[0].startswith(f"couldn't resolve module/action '{next(iter(args_dict))}'")
+ assert err.value.args[0].startswith("couldn't resolve module/action 'bogusaction'")