Merging upstream version 0.15.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 11:39:50 +01:00
parent bfebc2a0f4
commit 0a0cb7f4fd
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
103 changed files with 79620 additions and 742 deletions

View file

@ -5,13 +5,14 @@
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, Callable
import pytest
from rich.table import Table
from anta import RICH_COLOR_PALETTE
from anta.reporter import ReportTable
from anta.reporter import ReportJinja, ReportTable
if TYPE_CHECKING:
from anta.custom_types import TestStatus
@ -185,3 +186,14 @@ class TestReportTable:
assert isinstance(res, Table)
assert res.title == (title or "Summary per device")
assert res.row_count == expected_length
class TestReportJinja:
"""Tests for ReportJinja class."""
# pylint: disable=too-few-public-methods
def test_fail__init__file_not_found(self) -> None:
"""Test __init__ failure if file is not found."""
with pytest.raises(FileNotFoundError, match="template file is not found: /gnu/terry/pratchett"):
ReportJinja(Path("/gnu/terry/pratchett"))