diff --git a/config/templates/report.html b/config/templates/report.html deleted file mode 100644 index 901b40d..0000000 --- a/config/templates/report.html +++ /dev/null @@ -1,218 +0,0 @@ - - -
- - -| 画像名 | -平均輝度 | -標準偏差 | -CoV | -最大/最小比 | -最大輝度 | -最小輝度 | -
|---|---|---|---|---|---|---|
| {{ row.image_name }} | -{{ "%.2f"|format(row.mean|float) }} | -{{ "%.2f"|format(row.std|float) }} | -{{ "%.4f"|format(row.cov|float) }} | -{{ "%.4f"|format(row.max_min_ratio|float) }} | -{{ "%.2f"|format(row.max|float) }} | -{{ "%.2f"|format(row.min|float) }} | -
| 画像名 | -中心平均輝度 | -中間平均輝度 | -周辺平均輝度 | -中心/周辺比 | -勾配量 (%) | -
|---|---|---|---|---|---|
| {{ row.image_name }} | -{{ "%.2f"|format(row.center_mean|float) }} | -{{ "%.2f"|format(row.middle_mean|float) }} | -{{ "%.2f"|format(row.periphery_mean|float) }} | -{{ "%.4f"|format(row.center_periphery_ratio|float) }} | -{{ "%.2f"|format(row.gradient_magnitude|float) }} | -
輝度マップ
-輝度ヒストグラム
-放射状輝度プロファイル
-ゾーンマップ(中心 / 中間 / 周辺)
-Generated: {{ generated_at }}
" - "{% for row in summary_rows %}" - "{{ row.image_name }}
" - "{% endfor %}" - "", - encoding="utf-8", - ) - return template_path - - @pytest.fixture - def simple_context(self) -> dict: - """シンプルなレンダリングコンテキストを返す fixture.""" - return { - "generated_at": "2026-04-08 12:00:00", - "summary_rows": [{"image_name": "image_001"}], - "spatial_rows": [], - "image_details": [], - } - - def test_output_html_file_is_created( - self, - simple_template: Path, - simple_context: dict, - tmp_path: Path, - ) -> None: - """正常: HTML ファイルが生成されること.""" - output_path = str(tmp_path / "report.html") - render_html_report(simple_context, str(simple_template), output_path) - assert Path(output_path).exists() - - def test_output_html_file_is_not_empty( - self, - simple_template: Path, - simple_context: dict, - tmp_path: Path, - ) -> None: - """正常: 出力ファイルが空でないこと.""" - output_path = str(tmp_path / "report.html") - render_html_report(simple_context, str(simple_template), output_path) - assert Path(output_path).stat().st_size > 0 - - def test_output_html_contains_rendered_content( - self, - simple_template: Path, - simple_context: dict, - tmp_path: Path, - ) -> None: - """正常: テンプレートがコンテキストで正しくレンダリングされること.""" - output_path = str(tmp_path / "report.html") - render_html_report(simple_context, str(simple_template), output_path) - - html_content = Path(output_path).read_text(encoding="utf-8") - assert "2026-04-08 12:00:00" in html_content - assert "image_001" in html_content - - def test_creates_parent_directory_automatically( - self, - simple_template: Path, - simple_context: dict, - tmp_path: Path, - ) -> None: - """正常: 出力ディレクトリが存在しない場合に自動作成されること.""" - nested_output = str(tmp_path / "output" / "reports" / "report.html") - render_html_report(simple_context, str(simple_template), nested_output) - assert Path(nested_output).exists() - - def test_output_is_utf8_encoded( - self, - simple_template: Path, - simple_context: dict, - tmp_path: Path, - ) -> None: - """正常: 出力ファイルが UTF-8 エンコードで書き込まれること.""" - output_path = str(tmp_path / "report.html") - render_html_report(simple_context, str(simple_template), output_path) - # UTF-8 として読み込めること(例外が発生しないこと) - content = Path(output_path).read_text(encoding="utf-8") - assert isinstance(content, str)