feat: write snapshots to fixed filename snapshots.html
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import asyncio
|
||||
import json
|
||||
import pytest
|
||||
from unittest.mock import patch, AsyncMock
|
||||
|
||||
from src.snapshot_downloader import SnapshotDownloader
|
||||
|
||||
@@ -74,3 +76,13 @@ def test_save_last_run_date_writes_json(tmp_path):
|
||||
d.save_last_run_date("2025-06-01")
|
||||
data = json.loads((tmp_path / "last_run.json").read_text())
|
||||
assert data == {"last_date_to": "2025-06-01"}
|
||||
|
||||
|
||||
# --- generate_html_file fixed filename ---
|
||||
|
||||
def test_generate_html_file_uses_fixed_filename(tmp_path):
|
||||
d = _downloader(tmp_path)
|
||||
with patch.object(d, "generate_html_template", new_callable=AsyncMock, return_value="<html></html>"):
|
||||
result = asyncio.run(d.generate_html_file([], "2024-01-01", "2025-01-01"))
|
||||
assert result.name == "snapshots.html"
|
||||
assert (tmp_path / "snapshots.html").exists()
|
||||
|
||||
Reference in New Issue
Block a user