summaryrefslogtreecommitdiff
path: root/test/units
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2023-01-19 17:58:02 +0100
committerGitHub <noreply@github.com>2023-01-19 11:58:02 -0500
commit8a7185c224eb6e116d1233d37d57bbbb223cb5bb (patch)
tree44a2b59f472d6aabe0fcb22e6b89f6e9ee63d0ad /test/units
parentb5b7f9bce2c688eed90ef36b1f6b9f2ccd424706 (diff)
downloadansible-8a7185c224eb6e116d1233d37d57bbbb223cb5bb.tar.gz
Argument spec alias handling: actually report deprecated aliases in suboptions, and fix warning message in suboptions when two aliases of the same option are used (#79740)
* Normalize deprecation records. * Fix alias deprecations in suboptions. * Report in which option an alias warning happened for suboptions. * Add deprecation tests for suboptions. * Also test deprecation in list of dicts. * Adjust unit tests for toplevel alias deprecation field name change.
Diffstat (limited to 'test/units')
-rw-r--r--test/units/module_utils/common/arg_spec/test_aliases.py7
-rw-r--r--test/units/module_utils/common/arg_spec/test_module_validate.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/test/units/module_utils/common/arg_spec/test_aliases.py b/test/units/module_utils/common/arg_spec/test_aliases.py
index 1c1e243a7b..7d30fb0f0c 100644
--- a/test/units/module_utils/common/arg_spec/test_aliases.py
+++ b/test/units/module_utils/common/arg_spec/test_aliases.py
@@ -57,7 +57,12 @@ ALIAS_TEST_CASES = [
'path': '/tmp',
'not_yo_path': '/tmp',
},
- {'version': '1.7', 'date': None, 'collection_name': None, 'name': 'not_yo_path'},
+ {
+ 'version': '1.7',
+ 'date': None,
+ 'collection_name': None,
+ 'msg': "Alias 'not_yo_path' is deprecated. See the module docs for more information",
+ },
"",
)
]
diff --git a/test/units/module_utils/common/arg_spec/test_module_validate.py b/test/units/module_utils/common/arg_spec/test_module_validate.py
index 5041d521bd..2c2211c9d4 100644
--- a/test/units/module_utils/common/arg_spec/test_module_validate.py
+++ b/test/units/module_utils/common/arg_spec/test_module_validate.py
@@ -49,7 +49,7 @@ def test_module_alias_deprecations_warnings(monkeypatch):
{
'collection_name': None,
'date': '2020-03-04',
- 'name': 'flamethrower',
+ 'msg': "Alias 'flamethrower' is deprecated. See the module docs for more information",
'version': None,
}
]