summaryrefslogtreecommitdiffstats
path: root/test/test_mockings.py
diff options
context:
space:
mode:
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