File: test_mockings.py

package info (click to toggle)
ansible-lint 25.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,660 kB
  • sloc: python: 19,201; sh: 70; makefile: 7
file content (18 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (2)
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 is SystemExit
    assert exc.value.code == RC.INVALID_CONFIG