summaryrefslogtreecommitdiffstats
path: root/test/units/cli
diff options
context:
space:
mode:
authorRichie B2B <github@vdberg.org>2021-11-19 16:29:47 +0100
committerGitHub <noreply@github.com>2021-11-19 16:29:47 +0100
commit1b34933414551dde61572f43d23602505b090f42 (patch)
tree89f3cb554e73f93b5a15b96a0a6e0bce7be6a509 /test/units/cli
parentUpdate docs build requirements to most recent versions of dependencies (#76283) (diff)
downloadansible-1b34933414551dde61572f43d23602505b090f42.tar.xz
ansible-1b34933414551dde61572f43d23602505b090f42.zip
Fix ansible-doc -l ansible.builtin / ansible.legacy (#76235)
Diffstat (limited to 'test/units/cli')
-rw-r--r--test/units/cli/test_doc.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/units/cli/test_doc.py b/test/units/cli/test_doc.py
index 5cdf974b4b..576bdb28fe 100644
--- a/test/units/cli/test_doc.py
+++ b/test/units/cli/test_doc.py
@@ -5,6 +5,7 @@ __metaclass__ = type
import pytest
from ansible.cli.doc import DocCLI, RoleMixin
+from ansible.plugins.loader import module_loader
TTY_IFY_DATA = {
@@ -111,3 +112,19 @@ def test_rolemixin__build_doc_no_filter_match():
fqcn, doc = obj._build_doc(role_name, path, collection_name, argspec, entrypoint_filter)
assert fqcn == '.'.join([collection_name, role_name])
assert doc is None
+
+
+def test_builtin_modules_list():
+ args = ['ansible-doc', '-l', 'ansible.builtin', '-t', 'module']
+ obj = DocCLI(args=args)
+ obj.parse()
+ result = obj._list_plugins('module', module_loader)
+ assert len(result) > 0
+
+
+def test_legacy_modules_list():
+ args = ['ansible-doc', '-l', 'ansible.legacy', '-t', 'module']
+ obj = DocCLI(args=args)
+ obj.parse()
+ result = obj._list_plugins('module', module_loader)
+ assert len(result) > 0