summaryrefslogtreecommitdiffstats
path: root/test/test_mockings.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /test/test_mockings.py
parentInitial commit. (diff)
downloadansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.tar.xz
ansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test_mockings.py')
-rw-r--r--test/test_mockings.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_mockings.py b/test/test_mockings.py
new file mode 100644
index 0000000..0e8d77a
--- /dev/null
+++ b/test/test_mockings.py
@@ -0,0 +1,18 @@
+"""Test mockings module."""
+from typing import Any
+
+import pytest
+
+from ansiblelint._mockings import _make_module_stub
+from ansiblelint.config import options
+from ansiblelint.constants import RC
+
+
+def test_make_module_stub(mocker: Any) -> None:
+ """Test make module stub."""
+ mocker.patch("ansiblelint.config.options.cache_dir", return_value=".")
+ assert options.cache_dir is not None
+ with pytest.raises(SystemExit) as exc:
+ _make_module_stub(module_name="", options=options)
+ assert exc.type == SystemExit
+ assert exc.value.code == RC.INVALID_CONFIG