Coverage for tests / integration / tools / osv_scanner / test_definition.py: 100%
12 statements
« prev ^ index » next coverage.py v7.13.0, created at 2026-04-03 18:53 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2026-04-03 18:53 +0000
1"""Integration tests for OsvScannerPlugin definition."""
3from __future__ import annotations
5from collections.abc import Callable
6from typing import TYPE_CHECKING
8import pytest
9from assertpy import assert_that
11if TYPE_CHECKING:
12 from lintro.plugins.base import BaseToolPlugin
15@pytest.mark.parametrize(
16 ("attr", "expected"),
17 [
18 ("name", "osv_scanner"),
19 ("can_fix", False),
20 ],
21 ids=["name", "can_fix"],
22)
23def test_definition_attributes(
24 get_plugin: Callable[[str], BaseToolPlugin],
25 attr: str,
26 expected: object,
27) -> None:
28 """Verify OsvScannerPlugin definition has correct attribute values."""
29 plugin = get_plugin("osv_scanner")
30 assert_that(getattr(plugin.definition, attr)).is_equal_to(expected)
33def test_definition_file_patterns_empty(
34 get_plugin: Callable[[str], BaseToolPlugin],
35) -> None:
36 """Verify OsvScannerPlugin has empty file_patterns (uses --recursive)."""
37 plugin = get_plugin("osv_scanner")
38 assert_that(plugin.definition.file_patterns).is_empty()