summaryrefslogtreecommitdiffstats
path: root/test/test_mockings.py
blob: 417d5d5b14de9eac60c6f1240e3c8da1076f84de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Test mockings module."""

from pathlib import Path

import pytest

from ansiblelint._mockings import _make_module_stub
from ansiblelint.config import Options
from ansiblelint.constants import RC


def test_make_module_stub(config_options: Options) -> None:
    """Test make module stub."""
    config_options.cache_dir = Path()  # current directory
    with pytest.raises(SystemExit) as exc:
        _make_module_stub(module_name="", options=config_options)
    assert exc.type == SystemExit
    assert exc.value.code == RC.INVALID_CONFIG