summaryrefslogtreecommitdiffstats
path: root/tests/units/reporter
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 05:06:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 05:06:46 +0000
commit92240acb5cc600eec60624ece9ed4b9ec43b386f (patch)
tree13328d0de4f37030731a96e25749563742fce0cb /tests/units/reporter
parentAdding upstream version 0.14.0. (diff)
downloadanta-upstream/0.15.0.tar.xz
anta-upstream/0.15.0.zip
Adding upstream version 0.15.0.upstream/0.15.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/units/reporter/test__init__.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/units/reporter/test__init__.py b/tests/units/reporter/test__init__.py
index 0dc9f9a..2fc62ce 100644
--- a/tests/units/reporter/test__init__.py
+++ b/tests/units/reporter/test__init__.py
@@ -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"))